List of usage examples for org.apache.hadoop.io Text readString
public static String readString(DataInput in) throws IOException
From source file:org.apache.taverna.platform.execution.impl.hadoop.CrossProductInputSplit.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { super.readFields(in); workingDirectory = new Path(Text.readString(in)); int length = in.readInt(); for (int i = 0; i < length; i++) { inputPortDirectories.add(new Path(Text.readString(in))); }/*from ww w. j a v a2s.com*/ }
From source file:org.apache.tez.common.ContainerContext.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { this.containerIdentifier = Text.readString(in); }
From source file:org.apache.tez.common.counters.AbstractCounterGroup.java
License:Apache License
@Override public synchronized void readFields(DataInput in) throws IOException { displayName = Text.readString(in); counters.clear();/*from ww w .ja v a 2 s . c om*/ int size = WritableUtils.readVInt(in); for (int i = 0; i < size; i++) { T counter = newCounter(); counter.readFields(in); counters.put(counter.getName(), counter); limits.incrCounters(); } }
From source file:org.apache.tez.common.counters.AbstractCounters.java
License:Apache License
@Override public synchronized void readFields(DataInput in) throws IOException { int version = WritableUtils.readVInt(in); if (version != groupFactory.version()) { throw new IOException( "Counters version mismatch, expected " + groupFactory.version() + " got " + version); }// w w w.jav a 2s . c om int numFGroups = WritableUtils.readVInt(in); fgroups.clear(); GroupType[] groupTypes = GroupType.values(); while (numFGroups-- > 0) { GroupType groupType = groupTypes[WritableUtils.readVInt(in)]; G group; switch (groupType) { case FILESYSTEM: // with nothing group = groupFactory.newFileSystemGroup(); break; case FRAMEWORK: // with group id group = groupFactory.newFrameworkGroup(WritableUtils.readVInt(in)); break; default: // Silence dumb compiler, as it would've thrown earlier throw new IOException("Unexpected counter group type: " + groupType); } group.readFields(in); fgroups.put(group.getName(), group); } int numGroups = WritableUtils.readVInt(in); while (numGroups-- > 0) { limits.checkGroups(groups.size() + 1); G group = groupFactory.newGenericGroup(Text.readString(in), null, limits); group.readFields(in); groups.put(group.getName(), group); } }
From source file:org.apache.tez.common.counters.GenericCounter.java
License:Apache License
@Override public synchronized void readFields(DataInput in) throws IOException { name = Text.readString(in); displayName = in.readBoolean() ? Text.readString(in) : name; value = WritableUtils.readVLong(in); }
From source file:org.apache.tez.common.InputSpec.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { vertexName = Text.readString(in); this.inDegree = in.readInt(); inputClassName = Text.readString(in); }
From source file:org.apache.tez.common.OutputSpec.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { vertexName = Text.readString(in); this.outDegree = in.readInt(); outputClassName = Text.readString(in); }
From source file:org.apache.tez.common.TezTaskContext.java
License:Apache License
public void readFields(DataInput in) throws IOException { taskAttemptId = TezTaskAttemptID.read(in); user = Text.readString(in); jobName = Text.readString(in); vertexName = Text.readString(in); }
From source file:org.apache.tez.dag.api.EntityDescriptor.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { this.className = Text.readString(in); int payloadLength = in.readInt(); if (payloadLength != -1) { byte[] bb = new byte[payloadLength]; in.readFully(bb);/* w ww. j a v a 2 s . c om*/ int version = in.readInt(); this.userPayload = DagTypeConverters.convertToTezUserPayload(ByteBuffer.wrap(bb), version); } }
From source file:org.apache.tez.dag.api.TezEntityDescriptor.java
License:Apache License
@Override public void readFields(DataInput in) throws IOException { this.className = Text.readString(in); int payloadLength = in.readInt(); if (payloadLength != -1) { userPayload = new byte[payloadLength]; in.readFully(userPayload);/*w ww.j a v a 2 s . co m*/ } }