当前位置: 首页>>代码示例>>Java>>正文


Java Text.readString方法代码示例

本文整理汇总了Java中org.apache.hadoop.io.Text.readString方法的典型用法代码示例。如果您正苦于以下问题:Java Text.readString方法的具体用法?Java Text.readString怎么用?Java Text.readString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.io.Text的用法示例。


在下文中一共展示了Text.readString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  String strPath = Text.readString(in, Text.DEFAULT_MAX_LEN);
  this.path = new Path(strPath);
  this.length = in.readLong();
  this.isdir = in.readBoolean();
  this.block_replication = in.readShort();
  blocksize = in.readLong();
  modification_time = in.readLong();
  access_time = in.readLong();
  permission.readFields(in);
  owner = Text.readString(in, Text.DEFAULT_MAX_LEN);
  group = Text.readString(in, Text.DEFAULT_MAX_LEN);
  if (in.readBoolean()) {
    this.symlink = new Path(Text.readString(in, Text.DEFAULT_MAX_LEN));
  } else {
    this.symlink = null;
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:20,代码来源:FileStatus.java

示例2: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
public void readFields(DataInput in) throws IOException {
  totLength = in.readLong();
  int arrLength = in.readInt();
  lengths = new long[arrLength];
  for(int i=0; i<arrLength;i++) {
    lengths[i] = in.readLong();
  }
  int filesLength = in.readInt();
  paths = new Path[filesLength];
  for(int i=0; i<filesLength;i++) {
    paths[i] = new Path(Text.readString(in));
  }
  arrLength = in.readInt();
  startoffset = new long[arrLength];
  for(int i=0; i<arrLength;i++) {
    startoffset[i] = in.readLong();
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:19,代码来源:CombineFileSplit.java

示例3: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
/**
 * {@inheritDoc}
 */
public void readFields(DataInput in) throws IOException {
  this.isNew = in.readBoolean();
  String className = Text.readString(in);
  if (null == this.sqoopRecord) {
    // If we haven't already instantiated an inner SqoopRecord, do so here.
    try {
      Class<? extends SqoopRecord> recordClass =
          (Class<? extends SqoopRecord>) config.getClassByName(className);
      this.sqoopRecord = recordClass.newInstance();
    } catch (Exception e) {
      throw new IOException(e);
    }
  }

  this.sqoopRecord.readFields(in);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:21,代码来源:MergeRecord.java

示例4: readClass

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
/** Reads and returns the class as written by {@link #writeClass(DataOutput, Class)} */
static Class<?> readClass(Configuration conf, DataInput in) throws IOException {
  Class<?> instanceClass = null;
  int b = (byte)WritableUtils.readVInt(in);
  if (b == NOT_ENCODED) {
    String className = Text.readString(in);
    try {
      instanceClass = getClassByName(conf, className);
    } catch (ClassNotFoundException e) {
      LOG.error("Can't find class " + className, e);
      throw new IOException("Can't find class " + className, e);
    }
  } else {
    instanceClass = CODE_TO_CLASS.get(b);
  }
  return instanceClass;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:HbaseObjectWritableFor96Migration.java

示例5: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  protocol = Text.readString(in);
  if (protocol.isEmpty()) {
    protocol = null;
  }
}
 
开发者ID:spafka,项目名称:spark_deep,代码行数:8,代码来源:ConnectionHeader.java

示例6: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  // The serialization format for this object is:
  // boolean isExternal
  // if true, then:
  //   a string identifying the external storage type
  //   and external-storage-specific data.
  // if false, then we use readFieldsInternal() to allow BlobRef/ClobRef
  // to serialize as it sees fit.
  //
  // Currently the only external storage supported is LobFile, identified
  // by the string "lf". This serializes with the filename (as a string),
  // followed by a long-valued offset and a long-valued length.

  boolean isExternal = in.readBoolean();
  if (isExternal) {
    this.realData = null;

    String storageType = Text.readString(in);
    if (!storageType.equals("lf")) {
      throw new IOException("Unsupported external LOB storage code: "
          + storageType);
    }

    // Storage type "lf" is LobFile: filename, offset, length.
    this.fileName = Text.readString(in);
    this.offset = in.readLong();
    this.length = in.readLong();
  } else {
    readFieldsInternal(in);

    this.fileName = null;
    this.offset = 0;
    this.length = 0;
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:37,代码来源:LobRef.java

示例7: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void readFields(DataInput in) throws IOException {
  this.src = new Path(Text.readString(in));
  owner = DistTool.readString(in);
  group = DistTool.readString(in);
  permission = in.readBoolean()? FsPermission.read(in): null;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:DistCh.java

示例8: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  name = Text.readString(in);
  isBlacklisted = in.readBoolean();
  reasonForBlacklist = Text.readString(in);
  blacklistReport = Text.readString(in);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TaskTrackerInfo.java

示例9: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
  file = new Path(Text.readString(in));
  start = in.readLong();
  length = in.readLong();
  hosts = null;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:FileSplit.java

示例10: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
/**
 * Deserializes the AccessControlList object
 */
@Override
public void readFields(DataInput in) throws IOException {
  String aclString = Text.readString(in);
  buildACL(aclString.split(" ", 2));
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:9,代码来源:AccessControlList.java

示例11: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
@Override
/** {@inheritDoc} */
public void readFields(DataInput input) throws IOException {
  this.lowerBoundClause = Text.readString(input);
  this.upperBoundClause = Text.readString(input);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:7,代码来源:DataDrivenDBInputFormat.java

示例12: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
public void readFields(DataInput in) throws IOException {
    from = in.readInt();
    length = in.readLong();
    hosts = new String[in.readInt()];
    for (int i = 0; i < hosts.length; i++) hosts[i] = Text.readString(in);
}
 
开发者ID:helgeho,项目名称:HadoopWebGraph,代码行数:7,代码来源:NodeIteratorInputSplit.java

示例13: binaryProtocolStub

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
public void binaryProtocolStub() {
  try {

    initSoket();
    System.out.println("start OK");

    // RUN_MAP.code
    // should be 3

    int answer = WritableUtils.readVInt(dataInput);
    System.out.println("RunMap:" + answer);
    TestPipeApplication.FakeSplit split = new TestPipeApplication.FakeSplit();
    readObject(split, dataInput);

    WritableUtils.readVInt(dataInput);
    WritableUtils.readVInt(dataInput);
    // end runMap
    // get InputTypes
    WritableUtils.readVInt(dataInput);
    String inText = Text.readString(dataInput);
    System.out.println("Key class:" + inText);
    inText = Text.readString(dataInput);
    System.out.println("Value class:" + inText);

    @SuppressWarnings("unused")
    int inCode = 0;

    // read all data from sender and write to output
    while ((inCode = WritableUtils.readVInt(dataInput)) == 4) {
      FloatWritable key = new FloatWritable();
      NullWritable value = NullWritable.get();
      readObject(key, dataInput);
      System.out.println("value:" + key.get());
      readObject(value, dataInput);
    }

    WritableUtils.writeVInt(dataOut, 54);

    dataOut.flush();
    dataOut.close();

  } catch (Exception x) {
    x.printStackTrace();
  } finally {
    closeSoket();
  }

}
 
开发者ID:naver,项目名称:hadoop,代码行数:49,代码来源:PipeApplicationRunnableStub.java

示例14: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
public void readFields(DataInput in) throws IOException {
  jvmId.readFields(in);
  this.pid = Text.readString(in);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:JvmContext.java

示例15: readFields

import org.apache.hadoop.io.Text; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void readFields(DataInput input) throws IOException {
  this.lowerBoundClause = Text.readString(input);
  this.upperBoundClause = Text.readString(input);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:DataDrivenDBInputFormat.java


注:本文中的org.apache.hadoop.io.Text.readString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。