当前位置: 首页>>代码示例>>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;未经允许,请勿转载。