Search in sources :

Example 1 with TupleImpl

use of backtype.storm.tuple.TupleImpl in project heron by twitter.

the class OutputCollectorImpl method ack.

@Override
public void ack(Tuple input) {
    TupleImpl i = (TupleImpl) input;
    delegate.ack(i.getDelegate());
}
Also used : TupleImpl(backtype.storm.tuple.TupleImpl)

Example 2 with TupleImpl

use of backtype.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);
}
Also used : TupleImpl(backtype.storm.tuple.TupleImpl)

Example 3 with TupleImpl

use of backtype.storm.tuple.TupleImpl in project storm-elastic-search by hmsonline.

the class ElasticSearchTest method testBolt.

@Test
public void testBolt() {
    TopologyBuilder builder = new TopologyBuilder();
    ElasticSearchBolt bolt = new ElasticSearchBolt(new DefaultTupleMapper());
    builder.setBolt("TEST_BOLT", bolt);
    TopologyContext context = new MockTopologyContext(builder.createTopology());
    Config config = new Config();
    config.put(ElasticSearchBolt.ELASTIC_LOCAL_MODE, true);
    bolt.prepare(config, context, null);
    List<Object> values = new ArrayList<Object>();
    values.add("testIndex");
    values.add("entity");
    values.add("testId");
    values.add("{\"bolt\":\"lightning\"}");
    Tuple tuple = new TupleImpl(context, values, 5, "test");
    bolt.execute(tuple);
}
Also used : DefaultTupleMapper(com.hmsonline.storm.contrib.bolt.elasticsearch.mapper.DefaultTupleMapper) TopologyBuilder(backtype.storm.topology.TopologyBuilder) Config(backtype.storm.Config) ArrayList(java.util.ArrayList) TopologyContext(backtype.storm.task.TopologyContext) TupleImpl(backtype.storm.tuple.TupleImpl) Tuple(backtype.storm.tuple.Tuple) Test(org.junit.Test)

Example 4 with TupleImpl

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);
    }
}
Also used : IOException(java.io.IOException) TupleImpl(backtype.storm.tuple.TupleImpl) MessageId(backtype.storm.tuple.MessageId)

Example 5 with TupleImpl

use of backtype.storm.tuple.TupleImpl in project heron by twitter.

the class OutputCollectorImpl method fail.

@Override
public void fail(Tuple input) {
    TupleImpl i = (TupleImpl) input;
    delegate.fail(i.getDelegate());
}
Also used : TupleImpl(backtype.storm.tuple.TupleImpl)

Aggregations

TupleImpl (backtype.storm.tuple.TupleImpl)7 Tuple (backtype.storm.tuple.Tuple)3 ArrayList (java.util.ArrayList)3 Config (backtype.storm.Config)1 TopologyContext (backtype.storm.task.TopologyContext)1 TopologyBuilder (backtype.storm.topology.TopologyBuilder)1 MessageId (backtype.storm.tuple.MessageId)1 DefaultTupleMapper (com.hmsonline.storm.contrib.bolt.elasticsearch.mapper.DefaultTupleMapper)1 IOException (java.io.IOException)1 Test (org.junit.Test)1