org.apache.hadoop.io.UTF8.readString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中org.apache.hadoop.io.UTF8.readString()方法的一些代码示例,展示了UTF8.readString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UTF8.readString()方法的具体详情如下:
包路径:org.apache.hadoop.io.UTF8
类名称:UTF8
方法名:readString

UTF8.readString介绍

[英]Read a UTF-8 encoded string.
[中]读取UTF-8编码的字符串。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Override
public void readFields(DataInput in) throws IOException {
 String className = UTF8.readString(in);
 declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  try {
   declaredClass = getConf().getClassByName(className);
  } catch (ClassNotFoundException e) {
   throw new RuntimeException(e.toString());
  }
 }
}
@Override

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Override
@SuppressWarnings("deprecation")
public void readFields(DataInput in) throws IOException {
 rpcVersion = in.readLong();
 declaringClassProtocolName = UTF8.readString(in);
 methodName = UTF8.readString(in);
 clientVersion = in.readLong();
 clientMethodsHash = in.readInt();
 parameters = new Object[in.readInt()];
 parameterClasses = new Class[parameters.length];
 ObjectWritable objectWritable = new ObjectWritable();
 for (int i = 0; i < parameters.length; i++) {
  parameters[i] = 
    ObjectWritable.readObject(in, objectWritable, this.conf);
  parameterClasses[i] = objectWritable.getDeclaredClass();
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

public static Object readObject(DataInput in, ObjectWritable objectWritable, Configuration conf)
 throws IOException {
 String className = UTF8.readString(in);
 Class<?> declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  instance = UTF8.readString(in);
 } else if (declaredClass.isEnum()) {         // enum
  instance = Enum.valueOf((Class<? extends Enum>) declaredClass, UTF8.readString(in));
 } else if (Message.class.isAssignableFrom(declaredClass)) {
  instance = tryInstantiateProtobuf(declaredClass, in);
 } else {                                      // Writable
  Class instanceClass = null;
  String str = UTF8.readString(in);
  instanceClass = loadClass(conf, str);

代码示例来源:origin: org.apache.hadoop/hadoop-common

String className = UTF8.readString(in);
Class<?> componentType = getPrimitiveClass(className);
if (componentType == null) {

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

public static String readString(DataInput in) throws IOException {
 return org.apache.hadoop.io.UTF8.readString(in);
}

代码示例来源:origin: linkedin/camus

@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);
 }
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

@Override
@SuppressWarnings("deprecation")    
public void fromBinary(DataInputStream in) throws IOException {
 value = UTF8.readString(in);
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** {@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;
 }
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** {@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;
 }
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
 file = UTF8.readString(in).intern();
 start = in.readLong();
 length = in.readLong();
 hosts = null;
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
 file = new Path(UTF8.readString(in));
 start = in.readLong();
 length = in.readLong();
 hosts = null;
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
  buildVersion = UTF8.readString(in);
  layoutVersion = in.readInt();
  namespaceID = in.readInt();
  cTime = in.readLong();
  distributedUpgradeVersion = in.readInt();
 }
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
  buildVersion = UTF8.readString(in);
  layoutVersion = in.readInt();
  namespaceID = in.readInt();
  cTime = in.readLong();
  distributedUpgradeVersion = in.readInt();
 }
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
 String className = UTF8.readString(in);
 declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  try {
   declaredClass = getConf().getClassByName(className);
  } catch (ClassNotFoundException e) {
   throw new RuntimeException(e.toString());
  }
 }
}
public void write(DataOutput out) throws IOException {

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
 String className = UTF8.readString(in);
 declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  try {
   declaredClass = getConf().getClassByName(className);
  } catch (ClassNotFoundException e) {
   throw new RuntimeException(e.toString());
  }
 }
}
public void write(DataOutput out) throws IOException {

代码示例来源:origin: io.hops/hadoop-common

@Override
public void readFields(DataInput in) throws IOException {
 String className = UTF8.readString(in);
 declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  try {
   declaredClass = getConf().getClassByName(className);
  } catch (ClassNotFoundException e) {
   throw new RuntimeException(e.toString());
  }
 }
}
@Override

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
public void readFields(DataInput in) throws IOException {
 String className = UTF8.readString(in);
 declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  try {
   declaredClass = getConf().getClassByName(className);
  } catch (ClassNotFoundException e) {
   throw new RuntimeException(e.toString());
  }
 }
}
@Override

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
public void readFields(DataInput in) throws IOException {
 String className = UTF8.readString(in);
 declaredClass = PRIMITIVE_NAMES.get(className);
 if (declaredClass == null) {
  try {
   declaredClass = getConf().getClassByName(className);
  } catch (ClassNotFoundException e) {
   throw new RuntimeException(e.toString());
  }
 }
}
@Override

代码示例来源:origin: com.facebook.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
 methodName = UTF8.readString(in);
 parameters = new Object[in.readInt()];
 parameterClasses = new Class[parameters.length];
 ObjectWritable objectWritable = new ObjectWritable();
 for (int i = 0; i < parameters.length; i++) {
  parameters[i] = ObjectWritable.readObject(in, objectWritable, this.conf);
  parameterClasses[i] = objectWritable.getDeclaredClass();
 }
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

public void readFields(DataInput in) throws IOException {
 methodName = UTF8.readString(in);
 parameters = new Object[in.readInt()];
 parameterClasses = new Class[parameters.length];
 ObjectWritable objectWritable = new ObjectWritable();
 for (int i = 0; i < parameters.length; i++) {
  parameters[i] = ObjectWritable.readObject(in, objectWritable, this.conf);
  parameterClasses[i] = objectWritable.getDeclaredClass();
 }
}

相关文章