use of backtype.storm.tuple.TupleImpl in project heron by twitter.
the class OutputCollectorImpl method emit.
@Override
public List<Integer> emit(String streamId, Collection<Tuple> anchors, List<Object> tuple) {
if (anchors != null) {
ArrayList<com.twitter.heron.api.tuple.Tuple> l = new ArrayList<com.twitter.heron.api.tuple.Tuple>();
for (Tuple t : anchors) {
TupleImpl i = (TupleImpl) t;
l.add(i.getDelegate());
}
return delegate.emit(streamId, l, tuple);
} else {
return delegate.emit(streamId, (Collection<com.twitter.heron.api.tuple.Tuple>) null, tuple);
}
}
use of backtype.storm.tuple.TupleImpl in project storm by nathanmarz.
the class KryoTupleDeserializer method deserialize.
public Tuple deserialize(byte[] ser) {
try {
_kryoInput.setBuffer(ser);
int taskId = _kryoInput.readInt(true);
int streamId = _kryoInput.readInt(true);
String componentName = _context.getComponentId(taskId);
String streamName = _ids.getStreamName(componentName, streamId);
MessageId id = MessageId.deserialize(_kryoInput);
List<Object> values = _kryo.deserializeFrom(_kryoInput);
return new TupleImpl(_context, values, taskId, streamName, id);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations