本文整理汇总了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;
}
}
示例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));
}
示例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
}
}
}
示例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);
}
示例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));
}
}
示例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;
}
}
示例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));
}
}
示例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);
}
示例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);
}