use of org.apache.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 org.apache.storm.tuple.TupleImpl in project heron by twitter.
the class IRichBoltDelegate method execute.
@Override
public void execute(com.twitter.heron.api.tuple.Tuple tuple) {
TupleImpl impl = new TupleImpl(tuple);
delegate.execute(impl);
}
use of org.apache.storm.tuple.TupleImpl in project storm by apache.
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);
}
}
use of org.apache.storm.tuple.TupleImpl in project storm by apache.
the class TestHiveWriter method generateTestTuple.
private Tuple generateTestTuple(Object id, Object msg) {
TopologyBuilder builder = new TopologyBuilder();
GeneralTopologyContext topologyContext = new GeneralTopologyContext(builder.createTopology(), new Config(), new HashMap(), new HashMap(), new HashMap(), "") {
@Override
public Fields getComponentOutputFields(String componentId, String streamId) {
return new Fields("id", "msg");
}
};
return new TupleImpl(topologyContext, new Values(id, msg), 1, "");
}
use of org.apache.storm.tuple.TupleImpl in project storm by apache.
the class TestHiveBolt method generateTestTuple.
private Tuple generateTestTuple(Object id, Object msg, Object city, Object state) {
TopologyBuilder builder = new TopologyBuilder();
GeneralTopologyContext topologyContext = new GeneralTopologyContext(builder.createTopology(), new Config(), new HashMap(), new HashMap(), new HashMap(), "") {
@Override
public Fields getComponentOutputFields(String componentId, String streamId) {
return new Fields("id", "msg", "city", "state");
}
};
return new TupleImpl(topologyContext, new Values(id, msg, city, state), 1, "");
}
Aggregations