Examples of readFields()


Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken.readFields()

  public static AuthenticationToken extractToken(String tokenClass, byte[] token) throws AccumuloSecurityException {
    try {
      Object obj = Class.forName(tokenClass).newInstance();
      if (obj instanceof AuthenticationToken) {
        AuthenticationToken toRet = (AuthenticationToken) obj;
        toRet.readFields(new DataInputStream(new ByteArrayInputStream(token)));
        return toRet;
      }
    } catch (ClassNotFoundException cnfe) {
      log.error(cnfe, cnfe);
    } catch (InstantiationException e) {
View Full Code Here

Examples of org.apache.accumulo.core.data.Key.readFields()

          Mutation m = null;
          Text currentRow = null;
          int dirCount = 0;
         
          while (true) {
            key.readFields(in);
            val.readFields(in);
           
            Text endRow = new KeyExtent(key.getRow(), (Text) null).getEndRow();
            Text metadataRow = new KeyExtent(new Text(tableInfo.tableId), endRow, null).getMetadataEntry();
           
View Full Code Here

Examples of org.apache.accumulo.core.data.Mutation.readFields()

          System.out.println("Log : " + entry.getValue());
        lastLog = entry.getValue().toString();
      } else if (entry.getKey().getColumnQualifier().toString().equals("mut")) {
        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(entry.getValue().get()));
        Mutation m = new Mutation();
        m.readFields(dis);
       
        LogFileValue lfv = new LogFileValue();
        lfv.mutations = Collections.singletonList(m);
       
        System.out.println(LogFileValue.format(lfv, 1));
View Full Code Here

Examples of org.apache.accumulo.core.data.Range.readFields()

  public static List<Range> getRanges(Class<?> implementingClass, Configuration conf) throws IOException {
    ArrayList<Range> ranges = new ArrayList<Range>();
    for (String rangeString : conf.getStringCollection(enumToConfKey(implementingClass, ScanOpts.RANGES))) {
      ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decodeBase64(rangeString.getBytes(Charset.forName("UTF-8"))));
      Range range = new Range();
      range.readFields(new DataInputStream(bais));
      ranges.add(range);
    }
    return ranges;
  }
 
View Full Code Here

Examples of org.apache.accumulo.core.data.Value.readFields()

    while (count < (indexEntry.getNumEntries() - interval + 1)) {

      Key myPrevKey = rk.getKey();
      int pos = cacheBlock.getPosition();
      rk.readFields(cacheBlock);
      val.readFields(cacheBlock);

      if (count > 0 && count % interval == 0) {
        index.add(new BlockIndexEntry(pos, indexEntry.getNumEntries() - count, myPrevKey));
      }
     
View Full Code Here

Examples of org.apache.accumulo.core.file.rfile.MultiLevelIndex.Reader.readFields()

    FSDataInputStream in = new FSDataInputStream(bais);
    CachableBlockFile.Reader _cbr = new CachableBlockFile.Reader(in, data.length, CachedConfiguration.getInstance());
   
    Reader reader = new Reader(_cbr, RFile.RINDEX_VER_6);
    BlockRead rootIn = _cbr.getMetaBlock("root");
    reader.readFields(rootIn);
    rootIn.close();
    IndexIterator liter = reader.lookup(new Key("000000"));
    int count = 0;
    while (liter.hasNext()) {
      assertEquals(count, liter.nextIndex());
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.ingest.WikipediaInputFormat.WikipediaInputSplit.readFields()

   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    DataInput in = new ObjectInputStream(bais);
   
    WikipediaInputSplit split2 = new WikipediaInputSplit();
    split2.readFields(in);
    Assert.assertTrue(bais.available() == 0);
    bais.close();
   
    Assert.assertTrue(split.getPartition() == split2.getPartition());
   
View Full Code Here

Examples of org.apache.accumulo.server.data.ServerMutation.readFields()

  public void readFields(DataInput in) throws IOException {
    int count = in.readInt();
    mutations = new ArrayList<Mutation>(count);
    for (int i = 0; i < count; i++) {
      ServerMutation mutation = new ServerMutation();
      mutation.readFields(in);
      mutations.add(mutation);
    }
  }
 
  @Override
View Full Code Here

Examples of org.apache.accumulo.server.logger.LogFileKey.readFields()

          try {
            long start = input.getPos();
            while (input.getPos() - start < bufferSize) {
              LogFileKey key = new LogFileKey();
              LogFileValue value = new LogFileValue();
              key.readFields(decryptingInput);
              value.readFields(decryptingInput);
              buffer.add(new Pair<LogFileKey,LogFileValue>(key, value));
            }
            writeBuffer(destPath, buffer, part++);
            buffer.clear();
View Full Code Here

Examples of org.apache.accumulo.server.logger.LogFileValue.readFields()

            long start = input.getPos();
            while (input.getPos() - start < bufferSize) {
              LogFileKey key = new LogFileKey();
              LogFileValue value = new LogFileValue();
              key.readFields(decryptingInput);
              value.readFields(decryptingInput);
              buffer.add(new Pair<LogFileKey,LogFileValue>(key, value));
            }
            writeBuffer(destPath, buffer, part++);
            buffer.clear();
          } catch (EOFException ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.