Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.Text.readFields()


    DataInputBuffer valueBuf = new DataInputBuffer();
    long prev = Long.MIN_VALUE;
    while (reader.nextRawKey(keyBuf)) {
      reader.nextRawValue(valueBuf);
      key.readFields(keyBuf);
      value.readFields(valueBuf);
      if (prev != Long.MIN_VALUE) {
        assert(prev <= key.get());
        prev = key.get();
      }
      LOG.info("key = " + key.get() + "; value = " + value);
View Full Code Here


    FSDataInputStream in = dfs.open(new Path(expectedPath));

    String className = in.readUTF();
    Text message = (Text) ReflectionUtils.newInstance(Class.forName(className),
        config);
    message.readFields(in);

    assertEquals("data", message.toString());

    dfs.delete(new Path("checkpoint"), true);
  }
View Full Code Here

      SpilledDataInputBuffer inputBuffer = outputBuffer
          .getInputStreamToRead(fileName);

      for (int i = 0; i < 100; ++i) {
        text.readFields(inputBuffer);
        assertTrue("Testing the spillage of spilling buffer".equals(text
            .toString()));
        text.clear();
      }
View Full Code Here

            .toString()));
        text.clear();
      }

      try {
        text.readFields(inputBuffer);
        assertTrue(false);
      } catch (EOFException eof) {
        assertTrue(true);
      }
View Full Code Here

  public void readFields(DataInput in) throws IOException {
    int version = in.readByte();
    if (version < 6) {
      if (version <= 2) {
        Text t = new Text();
        t.readFields(in);
        this.name = t.getBytes();
//        if(KeyValue.getFamilyDelimiterIndex(this.name, 0, this.name.length)
//            > 0) {
//          this.name = stripColon(this.name);
//        }
View Full Code Here

    this.length = in.readLong();
    int numNames = in.readInt();
    this.names = new String[numNames];
    for (int i = 0; i < numNames; i++) {
      Text name = new Text();
      name.readFields(in);
      names[i] = name.toString();
    }
   
    int numHosts = in.readInt();
    this.hosts = new String[numHosts];
View Full Code Here

   
    int numHosts = in.readInt();
    this.hosts = new String[numHosts];
    for (int i = 0; i < numHosts; i++) {
      Text host = new Text();
      host.readFields(in);
      hosts[i] = host.toString();
    }
   
    int numTops = in.readInt();
    topologyPaths = new String[numTops];
View Full Code Here

   
    int numTops = in.readInt();
    topologyPaths = new String[numTops];
    for (int i = 0; i < numTops; i++) {
      Text path = new Text();
      path.readFields(in);
      topologyPaths[i] = path.toString();
    }
  }
 
  public String toString() {
View Full Code Here

    tokenMap.clear();
   
    int size = WritableUtils.readVInt(in);
    for(int i=0; i<size; i++) {
      Text alias = new Text();
      alias.readFields(in);
      Token<? extends TokenIdentifier> t = new Token<TokenIdentifier>();
      t.readFields(in);
      tokenMap.put(alias, t);
    }
   
View Full Code Here

    }
   
    size = WritableUtils.readVInt(in);
    for(int i=0; i<size; i++) {
      Text alias = new Text();
      alias.readFields(in);
      byte[] key = WritableUtils.readCompressedByteArray(in);
      secretKeysMap.put(alias, key);
    }
  }
}
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.