下面列出了org.apache.hadoop.io.UTF8#readString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public void readFields(DataInput in) throws IOException {
this.leaderId = UTF8.readString(in);
this.partition = in.readInt();
this.beginOffset = in.readLong();
this.offset = in.readLong();
this.checksum = in.readLong();
this.topic = in.readUTF();
this.time = in.readLong();
this.server = in.readUTF(); // left for legacy
this.service = in.readUTF(); // left for legacy
this.partitionMap = new MapWritable();
try {
this.partitionMap.readFields(in);
} catch (IOException e) {
this.setServer(this.server);
this.setService(this.service);
}
}
@Override
public void readFields(DataInput in) throws IOException {
topic = UTF8.readString(in);
leaderId = UTF8.readString(in);
String str = UTF8.readString(in);
if (!str.isEmpty())
try {
uri = new URI(str);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
partition = in.readInt();
offset = in.readLong();
latestOffset = in.readLong();
}
/** {@inheritDoc} */
public void readFields(DataInput in) throws IOException {
name = UTF8.readString(in);
storageID = UTF8.readString(in);
// the infoPort read could be negative, if the port is a large number (more
// than 15 bits in storage size (but less than 16 bits).
// So chop off the first two bytes (and hence the signed bits) before
// setting the field.
this.infoPort = in.readShort() & 0x0000ffff;
}
/** Serialization for FSEditLog */
void readFieldsFromFSEditLog(DataInput in) throws IOException {
this.name = UTF8.readString(in);
this.storageID = UTF8.readString(in);
this.infoPort = in.readShort() & 0x0000ffff;
this.capacity = in.readLong();
this.dfsUsed = in.readLong();
this.remaining = in.readLong();
this.lastUpdate = in.readLong();
this.xceiverCount = in.readInt();
this.location = Text.readString(in);
this.hostName = Text.readString(in);
setAdminState(WritableUtils.readEnum(in, AdminStates.class));
}
public void readFields(DataInput in) throws IOException {
buildVersion = UTF8.readString(in);
layoutVersion = in.readInt();
namespaceID = in.readInt();
cTime = in.readLong();
distributedUpgradeVersion = in.readInt();
}
/** {@inheritDoc} */
public void readFields(DataInput in) throws IOException {
name = UTF8.readString(in);
storageID = UTF8.readString(in);
// the infoPort read could be negative, if the port is a large number (more
// than 15 bits in storage size (but less than 16 bits).
// So chop off the first two bytes (and hence the signed bits) before
// setting the field.
this.infoPort = in.readShort() & 0x0000ffff;
}
/** Serialization for FSEditLog */
void readFieldsFromFSEditLog(DataInput in) throws IOException {
this.name = UTF8.readString(in);
this.storageID = UTF8.readString(in);
this.infoPort = in.readShort() & 0x0000ffff;
this.capacity = in.readLong();
this.dfsUsed = in.readLong();
this.remaining = in.readLong();
this.lastUpdate = in.readLong();
this.xceiverCount = in.readInt();
this.location = Text.readString(in);
this.hostName = Text.readString(in);
setAdminState(WritableUtils.readEnum(in, AdminStates.class));
}
public void readFields(DataInput in) throws IOException {
buildVersion = UTF8.readString(in);
layoutVersion = in.readInt();
namespaceID = in.readInt();
cTime = in.readLong();
distributedUpgradeVersion = in.readInt();
}
@Override
@SuppressWarnings("deprecation")
public void fromBinary(DataInputStream in) throws IOException {
value = UTF8.readString(in);
}
public void readFields(DataInput in) throws IOException {
file = new Path(UTF8.readString(in));
start = in.readLong();
length = in.readLong();
hosts = null;
}