當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。