/** * Gets the fields at the given positions into an array. * If at any position a field is null, then this method returns false. * All fields that have been successfully read until the failing read are correctly contained in the record. * All other fields are not set. * * @param positions The positions of the fields to get. * @param targets The values into which the content of the fields is put. * * @return True if all fields were successfully read, false if some read failed. */ public boolean getFieldsInto(int[] positions, Value[] targets) { for (int i = 0; i < positions.length; i++) { if (!getFieldInto(positions[i], targets[i])) { return false; } } return true; }
/** * Gets the fields at the given positions into an array. * If at any position a field is null, then this method returns false. * All fields that have been successfully read until the failing read are correctly contained in the record. * All other fields are not set. * * @param positions The positions of the fields to get. * @param targets The values into which the content of the fields is put. * * @return True if all fields were successfully read, false if some read failed. */ public boolean getFieldsInto(int[] positions, Value[] targets) { for (int i = 0; i < positions.length; i++) { if (!getFieldInto(positions[i], targets[i])) { return false; } } return true; }
@Override public final Message next() { this.source.next().getFieldInto(1, this.instance); return this.instance; }
@Override public Edge<VertexKey, EdgeValue> next() { Record next = input.next(); next.getFieldInto(0, keyHolder); next.getFieldInto(1, edgeValueHolder); edge.set(keyHolder, edgeValueHolder); return edge; }
@Override public void setReference(Record toCompare) { for (int i = 0; i < this.keyFields.length; i++) { if (!toCompare.getFieldInto(this.keyFields[i], this.keyHolders[i])) { throw new NullKeyFieldException(this.keyFields[i]); } } }
@Override public void coGroup(Iterator<Record> edges, Iterator<Record> state, Collector<Record> out) throws Exception { if (state.hasNext()) { Record first = state.next(); first.getFieldInto(0, vertexKey); first.getFieldInto(1, vertexValue); messagingFunction.set(edges, out); messagingFunction.sendMessages(vertexKey, vertexValue); } }
@Override public void setReference(Record reference) { for (int i = 0; i < this.keyFields1.length; i++) { if (!reference.getFieldInto(this.keyFields1[i], this.keyHolders1[i])) { throw new NullKeyFieldException(this.keyFields1[i]); } } }
/** * Gets the fields at the given positions into an array. * If at any position a field is null, then this method throws a @link NullKeyFieldException. * All fields that have been successfully read until the failing read are correctly contained in the record. * All other fields are not set. * * @param positions The positions of the fields to get. * @param targets The values into which the content of the fields is put. * * @throws A NullKeyFieldException in case of a failing field read. */ public void getFieldsIntoCheckingNull(int[] positions, Value[] targets) { for (int i = 0; i < positions.length; i++) { if (!getFieldInto(positions[i], targets[i])) { throw new NullKeyFieldException(i); } } }
/** * Gets the fields at the given positions into an array. * If at any position a field is null, then this method throws a @link NullKeyFieldException. * All fields that have been successfully read until the failing read are correctly contained in the record. * All other fields are not set. * * @param positions The positions of the fields to get. * @param targets The values into which the content of the fields is put. * * @throws A NullKeyFieldException in case of a failing field read. */ public void getFieldsIntoCheckingNull(int[] positions, Value[] targets) { for (int i = 0; i < positions.length; i++) { if (!getFieldInto(positions[i], targets[i])) { throw new NullKeyFieldException(i); } } }
@Override public void coGroup(Iterator<Record> messages, Iterator<Record> vertex, Collector<Record> out) throws Exception { if (vertex.hasNext()) { Record first = vertex.next(); first.getFieldInto(0, vertexKey); first.getFieldInto(1, vertexValue); messageIter.setSource(messages); vertexUpdateFunction.setOutput(first, out); vertexUpdateFunction.updateVertex(vertexKey, vertexValue, messageIter); } else { if (messages.hasNext()) { String message = "Target vertex does not exist!."; try { Record next = messages.next(); next.getFieldInto(0, vertexKey); message = "Target vertex '" + vertexKey + "' does not exist!."; } catch (Throwable t) {} throw new Exception(message); } else { throw new Exception(); } } }
rec.getFieldInto(0, this.matchVertex); rec.getFieldInto(1, this.otherVertices.get(0)); next.getFieldInto(1, myVertex);
if (rec.getFieldInto(pos, new IntValue())) { Assert.fail("Value at position " + pos + " expected to be null in " + Arrays.toString(expected)); if (!rec.getFieldInto(pos, retrieved)) { Assert.fail("Value at position " + pos + " expected to be not null in " + Arrays.toString(expected));
res.getFieldInto(1, this.position);