當前位置: 首頁>>代碼示例>>Java>>正文


Java WritableUtils.readString方法代碼示例

本文整理匯總了Java中org.apache.hadoop.io.WritableUtils.readString方法的典型用法代碼示例。如果您正苦於以下問題:Java WritableUtils.readString方法的具體用法?Java WritableUtils.readString怎麽用?Java WritableUtils.readString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.io.WritableUtils的用法示例。


在下文中一共展示了WritableUtils.readString方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
@Override
public void readFields(DataInput in) throws IOException {
  super.readFields(in);
  byte aclEntriesSize = in.readByte();
  if (aclEntriesSize != NO_ACL_ENTRIES) {
    aclEntries = Lists.newArrayListWithCapacity(aclEntriesSize);
    for (int i = 0; i < aclEntriesSize; ++i) {
      aclEntries.add(new AclEntry.Builder()
          .setScope(ACL_ENTRY_SCOPES[in.readByte()])
          .setType(ACL_ENTRY_TYPES[in.readByte()])
          .setName(WritableUtils.readString(in))
          .setPermission(FS_ACTIONS[in.readByte()])
          .build());
    }
  } else {
    aclEntries = null;
  }

  int xAttrsSize = in.readInt();
  if (xAttrsSize != NO_XATTRS) {
    xAttrs = Maps.newHashMap();
    for (int i = 0; i < xAttrsSize; ++i) {
      final String name = WritableUtils.readString(in);
      final int valueLen = in.readInt();
      byte[] value = null;
      if (valueLen > -1) {
        value = new byte[valueLen];
        if (valueLen > 0) {
          in.readFully(value);
        }
      }
      xAttrs.put(name, value);
    }
  } else {
    xAttrs = null;
  }
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:38,代碼來源:CopyListingFileStatus.java

示例2: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
public void readFields(DataInput in) throws IOException {
  id = new org.apache.hadoop.mapreduce.JobID();
  id.readFields(in);
  user = new Text();
  user.readFields(in);
  jobSubmitDir = new Path(WritableUtils.readString(in));
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:8,代碼來源:JobInfo.java

示例3: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
@Override
public void readFields(DataInput in) throws IOException {
  int numSchemes = WritableUtils.readVInt(in);    // #scheme
  FileSystemCounter[] enums = FileSystemCounter.values();
  for (int i = 0; i < numSchemes; ++i) {
    String scheme = WritableUtils.readString(in); // scheme
    int numCounters = WritableUtils.readVInt(in); // #counter
    for (int j = 0; j < numCounters; ++j) {
      findCounter(scheme, enums[WritableUtils.readVInt(in)])  // key
          .setValue(WritableUtils.readVLong(in)); // value
    }
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:14,代碼來源:FileSystemCounterGroup.java

示例4: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
public void readFields(DataInput in) throws IOException {
  taskId.readFields(in); 
  idWithinJob = WritableUtils.readVInt(in);
  isMap = in.readBoolean();
  status = WritableUtils.readEnum(in, Status.class);
  taskTrackerHttp = WritableUtils.readString(in);
  taskRunTime = WritableUtils.readVInt(in);
  eventId = WritableUtils.readVInt(in);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:10,代碼來源:TaskCompletionEvent.java

示例5: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
@Override
public void readFields(DataInput in) throws IOException {
  this.cache = null;
  expiryDate = WritableUtils.readVLong(in);
  keyId = WritableUtils.readVInt(in);
  userId = WritableUtils.readString(in);
  blockPoolId = WritableUtils.readString(in);
  blockId = WritableUtils.readVLong(in);
  int length = WritableUtils.readVIntInRange(in, 0,
      AccessMode.class.getEnumConstants().length);
  for (int i = 0; i < length; i++) {
    modes.add(WritableUtils.readEnum(in, AccessMode.class));
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:15,代碼來源:BlockTokenIdentifier.java

示例6: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
@Override
public void readFields(DataInput in) throws IOException {
  super.readFields(in);
  byte aclEntriesSize = in.readByte();
  if (aclEntriesSize != NO_ACL_ENTRIES) {
    aclEntries = Lists.newArrayListWithCapacity(aclEntriesSize);
    for (int i = 0; i < aclEntriesSize; ++i) {
      aclEntries.add(new AclEntry.Builder()
        .setScope(ACL_ENTRY_SCOPES[in.readByte()])
        .setType(ACL_ENTRY_TYPES[in.readByte()])
        .setName(WritableUtils.readString(in))
        .setPermission(FS_ACTIONS[in.readByte()])
        .build());
    }
  } else {
    aclEntries = null;
  }
  
  int xAttrsSize = in.readInt();
  if (xAttrsSize != NO_XATTRS) {
    xAttrs = Maps.newHashMap();
    for (int i = 0; i < xAttrsSize; ++i) {
      final String name = WritableUtils.readString(in);
      final int valueLen = in.readInt();
      byte[] value = null;
      if (valueLen > -1) {
        value = new byte[valueLen];
        if (valueLen > 0) {
          in.readFully(value);
        }
      }
      xAttrs.put(name, value);
    }
  } else {
    xAttrs = null;
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:38,代碼來源:CopyListingFileStatus.java

示例7: readStatus

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
private static void readStatus(DataInputStream inStream) throws IOException {
  int status = inStream.readInt(); // read status
  if (status != SaslStatus.SUCCESS.state) {
    throw new RemoteException(WritableUtils.readString(inStream),
        WritableUtils.readString(inStream));
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:8,代碼來源:HBaseSaslRpcClient.java

示例8: readFields

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
public void readFields(DataInput in) throws IOException {
  file = new Path(WritableUtils.readString(in));
  len = WritableUtils.readVLong(in);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:5,代碼來源:GenericMRLoadGenerator.java

示例9: readString

import org.apache.hadoop.io.WritableUtils; //導入方法依賴的package包/類
/**
 * Reads the string following a <code>Type.STRING</code> code.
 * @return the obtained string
 * @throws IOException
 */
public String readString() throws IOException {
  return WritableUtils.readString(in);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:9,代碼來源:TypedBytesInput.java


注:本文中的org.apache.hadoop.io.WritableUtils.readString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。