public void readFields(DataInput in) throws IOException { this.blockId = in.readLong(); this.numBytes = in.readLong(); this.generationStamp = in.readLong(); if (numBytes < 0) { throw new IOException("Unexpected block size: " + numBytes); } }
/** * {@inheritDoc} * * @see Writable#readFields(DataInput) */ public void readFields(DataInput in) throws IOException { BSONDecoder dec = new BSONDecoder(); BSONCallback cb = new BasicBSONCallback(); // Read the BSON length from the start of the record int dataLen = in.readInt(); byte[] buf = new byte[dataLen]; in.readFully(buf); dec.decode(buf, cb); _doc = (BSONObject) cb.get(); log.info("Decoded a BSON Object: " + _doc); }
public void readFields(DataInput in) throws IOException { blockToken.readFields(in); this.corrupt = in.readBoolean(); offset = in.readLong(); this.b = new Block(); b.readFields(in); int count = in.readInt(); this.locs = new DatanodeInfo[count]; for (int i = 0; i < locs.length; i++) { locs[i] = new DatanodeInfo(); locs[i].readFields(in); } }
@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(); } }
public void readFields(DataInput in) throws IOException { // instance-specific this.sampleStrs = new ArrayList<String>(); int numSamples = in.readInt(); for (int i = 0; i < numSamples; i++) { sampleStrs.add(UTF8.readString(in).toString()); } this.tokenClassIdentifier = in.readInt(); if (in.readBoolean()) { this.tokenParameter = UTF8.readString(in); } else { this.tokenParameter = null; } this.schema = computeAvroSchema(); }
public void readFields(DataInput in) throws IOException { int numUnionElts = in.readInt(); this.unionTypes = new ArrayList<InferredType>(); for (int i = 0; i < numUnionElts; i++) { unionTypes.add(InferredType.readType(in)); } this.schema = computeAvroSchema(); }
/** Deserialize an unknown InferredType from the given input stream */ public static InferredType readType(DataInput in) throws IOException { InferredType it = null; byte b = in.readByte(); String name = in.readUTF(); if (b == BASE_TYPE) { it = new BaseType(name); } else if (b == STRUCT_TYPE) { it = new StructType(name); } else if (b == ARRAY_TYPE) { it = new ArrayType(name); } else if (b == UNION_TYPE) { it = new UnionType(name); } else { throw new IOException("No type found: " + b); } it.readFields(in); return it; }
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(); } }
public void readFields(DataInput in) throws IOException { isNode = in.readBoolean(); if (isNode) { node = new PageRankNode(); node.readFields(in); } else { contribution = new Contribution(); contribution.readFields(in); } }
/** Implement readFields of Writable */ public void readFields(DataInput in) throws IOException { this.offset = in.readLong(); this.length = in.readLong(); int numNames = in.readInt(); this.names = new String[numNames]; for (int i = 0; i < numNames; i++) { Text name = new Text(); name.readFields(in); names[i] = name.toString(); } int numHosts = in.readInt(); for (int i = 0; i < numHosts; i++) { Text host = new Text(); host.readFields(in); hosts[i] = host.toString(); } int numTops = in.readInt(); Text path = new Text(); for (int i = 0; i < numTops; i++) { path.readFields(in); topologyPaths[i] = path.toString(); } }
public void readFields(DataInput in) throws IOException { leftBigram = new Text(in.readUTF()); rightBigram = new Text(in.readUTF()); }
public void readFields(DataInput in) throws IOException { this.action = in.readInt(); }
public void readFields(DataInput in) throws IOException { this.genstamp = in.readLong(); if (this.genstamp < 0) { throw new IOException("Bad Generation Stamp: " + this.genstamp); } }