org.apache.hadoop.io.Text#readString ( )源码实例Demo

下面列出了org.apache.hadoop.io.Text#readString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hadoop   文件: SleepJob.java
@Override
public void readFields(DataInput in) throws IOException {
  id = WritableUtils.readVInt(in);
  sleepDuration = WritableUtils.readVLong(in);
  nMaps = WritableUtils.readVInt(in);
  nSpec = WritableUtils.readVInt(in);
  if (reduceDurations.length < nSpec) {
    reduceDurations = new long[nSpec];
  }
  for (int i = 0; i < nSpec; ++i) {
    reduceDurations[i] = WritableUtils.readVLong(in);
  }
  final int nLoc = WritableUtils.readVInt(in);
  if (nLoc != locations.length) {
    locations = new String[nLoc];
  }
  for (int i = 0; i < nLoc; ++i) {
    locations[i] = Text.readString(in);
  }
}
 
源代码2 项目: RDFS   文件: RecoverTreeNode.java
public void readFields(DataInput in) throws IOException {
	hostName = Text.readString(in);
	if(in.readBoolean()) {
		element = new RecoverTreeNodeElement();
		element.readFields(in);
	}
	
	int childrenNumber = in.readInt();
	if(childrenNumber > 0) {
		children = new LinkedList<TreeNode>();
		for(int i = 0; i < childrenNumber; i++) {
			TreeNode child = new RecoverTreeNode();
			child.readFields(in);
			this.addChild(child);
		}
	}
	else {
		children = null;
	}
}
 
源代码3 项目: tez   文件: TezHeartbeatRequest.java
@Override
public void readFields(DataInput in) throws IOException {
  if (in.readBoolean()) {
    int eventsCount = in.readInt();
    events = new ArrayList<TezEvent>(eventsCount);
    for (int i = 0; i < eventsCount; ++i) {
      TezEvent e = new TezEvent();
      e.readFields(in);
      events.add(e);
    }
  }
  if (in.readBoolean()) {
    currentTaskAttemptID = TezTaskAttemptID.readTezTaskAttemptID(in);
  } else {
    currentTaskAttemptID = null;
  }
  startIndex = in.readInt();
  preRoutedStartIndex = in.readInt();
  maxEvents = in.readInt();
  requestId = in.readLong();
  containerIdentifier = Text.readString(in);
}
 
@Override
public void readFields(DataInput in) throws IOException {
    super.readFields(in);
    path = new Path(Text.readString(in));
    offset = in.readLong();
    size = in.readLong();
    binaryOrigLen = in.readLong();
    conf = new Configuration();
    conf.readFields(in);
}
 
源代码5 项目: RDFS   文件: DataTransferPacket.java
public void read(DataInputStream in) throws IOException {
	readHeader(in);
	if (dataLength > 0) {
		try {
			IOUtils.readFully(in, buffer, 0, dataLength);
		} catch (ArrayIndexOutOfBoundsException e) {
			throw new ArrayIndexOutOfBoundsException("buffer.length = "
					+ buffer.length + ", dataLength = "
					+ dataLength);
		}
	} else if (dataLength < 0) {
		errMessage = Text.readString(in);
	}
}
 
源代码6 项目: nutch-htmlunit   文件: Loops.java
public void readFields(DataInput in)
  throws IOException {

  int numNodes = in.readInt();
  loopSet = new HashSet<String>();
  for (int i = 0; i < numNodes; i++) {
    String url = Text.readString(in);
    loopSet.add(url);
  }
}
 
源代码7 项目: hadoop-gpu   文件: BlocksWithLocations.java
/** deserialization method */
public void readFields(DataInput in) throws IOException {
  block.readFields(in);
  int len = WritableUtils.readVInt(in); // variable length integer
  datanodeIDs = new String[len];
  for(int i=0; i<len; i++) {
    datanodeIDs[i] = Text.readString(in);
  }
}
 
源代码8 项目: RDFS   文件: IncrementalBlockReport.java
@Override
public void readFields(DataInput in) throws IOException {
  super.readFields(in);
  delHintsMap = new long[in.readInt()];
  for (int i = 0; i < delHintsMap.length; i++) {
    delHintsMap[i] = in.readLong();
  }
  delHints = new String[in.readInt()];
  for (int i = 0; i < delHints.length; i++) {
    delHints[i] = Text.readString(in);
  }
  currentBlock = 0;
  currentHint = 0;
}
 
源代码9 项目: hadoop-sstable   文件: SSTableSplit.java
@Override
public void readFields(DataInput in) throws IOException {
    file = new Path(Text.readString(in));
    length = in.readLong();
    start = in.readLong();
    end = in.readLong();
    hosts = null;
}
 
源代码10 项目: RDFS   文件: FileStatus.java
public void readFields(DataInput in) throws IOException {
  String strPath = Text.readString(in);
  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);
  group = Text.readString(in);
}
 
源代码11 项目: nutch-htmlunit   文件: Content.java
private final void readFieldsCompressed(DataInput in) throws IOException {
  byte oldVersion = in.readByte();
  switch (oldVersion) {
  case 0:
  case 1:
    url = Text.readString(in); // read url
    base = Text.readString(in); // read base

    content = new byte[in.readInt()]; // read content
    in.readFully(content);

    contentType = Text.readString(in); // read contentType
    // reconstruct metadata
    int keySize = in.readInt();
    String key;
    for (int i = 0; i < keySize; i++) {
      key = Text.readString(in);
      int valueSize = in.readInt();
      for (int j = 0; j < valueSize; j++) {
        metadata.add(key, Text.readString(in));
      }
    }
    break;
  case 2:
    url = Text.readString(in); // read url
    base = Text.readString(in); // read base

    content = new byte[in.readInt()]; // read content
    in.readFully(content);

    contentType = Text.readString(in); // read contentType
    metadata.readFields(in); // read meta data
    break;
  default:
    throw new VersionMismatchException((byte)2, oldVersion);
  }

}
 
源代码12 项目: RDFS   文件: ReplaceBlockHeader.java
public void readFields(DataInput in) throws IOException {
  namespaceId = in.readInt();
  blockId = in.readLong();
  genStamp = in.readLong();
  sourceID = Text.readString(in);
  proxySource = new DatanodeInfo();
  proxySource.readFields(in);
}
 
源代码13 项目: big-c   文件: AccessControlList.java
/**
 * Deserializes the AccessControlList object
 */
@Override
public void readFields(DataInput in) throws IOException {
  String aclString = Text.readString(in);
  buildACL(aclString.split(" ", 2));
}
 
源代码14 项目: marklogic-contentpump   文件: DocumentURI.java
@Override
public void readFields(DataInput in) throws IOException {
    uri = Text.readString(in);
}
 
源代码15 项目: hadoop   文件: DistTool.java
protected static String readString(DataInput in) throws IOException {
  if (in.readBoolean()) {
    return Text.readString(in);
  }
  return null;
}
 
源代码16 项目: RDFS   文件: QueueAclsInfo.java
@Override
public void readFields(DataInput in) throws IOException {
  queueName = Text.readString(in);
  operations = WritableUtils.readStringArray(in);
}
 
源代码17 项目: RDFS   文件: OpenFileInfo.java
public void readFields(DataInput in) throws IOException {
  filePath = Text.readString(in);
  millisOpen = in.readLong();
}
 
源代码18 项目: hadoop-gpu   文件: MultiFileWordCount.java
public void readFields(DataInput in) throws IOException {
  this.offset = in.readLong();
  this.fileName = Text.readString(in);
}
 
源代码19 项目: hadoop   文件: DataDrivenDBInputFormat.java
/** {@inheritDoc} */
public void readFields(DataInput input) throws IOException {
  this.lowerBoundClause = Text.readString(input);
  this.upperBoundClause = Text.readString(input);
}
 
源代码20 项目: hadoop   文件: JobSplit.java
public void readFields(DataInput in) throws IOException {
  splitLocation = Text.readString(in);
  startOffset = WritableUtils.readVLong(in);
}