Package org.apache.hadoop.io

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


  /**
   */
  public void readFields(DataInput in) throws IOException {
    this.version = in.readInt();
    UTF8 uStr = new UTF8();
    uStr.readFields(in);
    this.name = uStr.toString();
    uStr.readFields(in);
    this.storageID = uStr.toString();
    uStr.readFields(in);
    this.registrationID = uStr.toString();  
View Full Code Here


  public void readFields(DataInput in) throws IOException {
    this.version = in.readInt();
    UTF8 uStr = new UTF8();
    uStr.readFields(in);
    this.name = uStr.toString();
    uStr.readFields(in);
    this.storageID = uStr.toString();
    uStr.readFields(in);
    this.registrationID = uStr.toString();  
  }
}
View Full Code Here

    UTF8 uStr = new UTF8();
    uStr.readFields(in);
    this.name = uStr.toString();
    uStr.readFields(in);
    this.storageID = uStr.toString();
    uStr.readFields(in);
    this.registrationID = uStr.toString();  
  }
}
View Full Code Here

      short replication = FSNamesystem.getFSNamesystem().getDefaultReplication();
      for (int i = 0; i < numFiles; i++) {
        UTF8 name = new UTF8();
        long modificationTime = 0;
        long blockSize = 0;
        name.readFields(in);
        // version 0 does not support per file replication
        if (!(imgVersion >= 0)) {
          replication = in.readShort(); // other versions do
          replication = FSEditLog.adjustReplication(replication);
        }
View Full Code Here

  // from the input stream
  //
  static INodeFileUnderConstruction readINodeUnderConstruction(
                            DataInputStream in) throws IOException {
    UTF8 src = new UTF8();
    src.readFields(in);
    byte[] name = src.getBytes();
    short blockReplication = in.readShort();
    long modificationTime = in.readLong();
    long preferredBlockSize = in.readLong();
    int numBlocks = in.readInt();
View Full Code Here

      blk.readFields(in);
      blocks[i] = new BlockInfo(blk, blockReplication);
    }
    PermissionStatus perm = PermissionStatus.read(in);
    UTF8 clientName = new UTF8();
    clientName.readFields(in);
    UTF8 clientMachine = new UTF8();
    clientMachine.readFields(in);

    int numLocs = in.readInt();
    DatanodeDescriptor[] locations = new DatanodeDescriptor[numLocs];
View Full Code Here

    }
    PermissionStatus perm = PermissionStatus.read(in);
    UTF8 clientName = new UTF8();
    clientName.readFields(in);
    UTF8 clientMachine = new UTF8();
    clientMachine.readFields(in);

    int numLocs = in.readInt();
    DatanodeDescriptor[] locations = new DatanodeDescriptor[numLocs];
    for (int i = 0; i < numLocs; i++) {
      locations[i] = new DatanodeDescriptor();
View Full Code Here

      short replication = FSNamesystem.getFSNamesystem().getDefaultReplication();
      for (int i = 0; i < numFiles; i++) {
        UTF8 name = new UTF8();
        long modificationTime = 0;
        long blockSize = 0;
        name.readFields(in);
        // version 0 does not support per file replication
        if (!(imgVersion >= 0)) {
          replication = in.readShort(); // other versions do
          replication = FSEditLog.adjustReplication(replication);
        }
View Full Code Here

  // code is moved into this package. This method should not be called
  // by other code.
  @SuppressWarnings("deprecation")
  public static String readString(DataInputStream in) throws IOException {
    UTF8 ustr = TL_DATA.get().U_STR;
    ustr.readFields(in);
    return ustr.toString();
  }

  static String readString_EmptyAsNull(DataInputStream in) throws IOException {
    final String s = readString(in);
View Full Code Here

 
  // Same comments apply for this method as for readString()
  @SuppressWarnings("deprecation")
  public static byte[] readBytes(DataInputStream in) throws IOException {
    UTF8 ustr = TL_DATA.get().U_STR;
    ustr.readFields(in);
    int len = ustr.getLength();
    byte[] bytes = new byte[len];
    System.arraycopy(ustr.getBytes(), 0, bytes, 0, len);
    return bytes;
  }
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.