Search in sources :

Example 1 with KryoTupleSerializer

use of backtype.storm.serialization.KryoTupleSerializer in project jstorm by alibaba.

the class WorkerData method updateKryoSerializer.

// create kryo serializer
public void updateKryoSerializer() {
    WorkerTopologyContext workerTopologyContext = contextMaker.makeWorkerTopologyContext(sysTopology);
    KryoTupleDeserializer kryoTupleDeserializer = new KryoTupleDeserializer(stormConf, workerTopologyContext, workerTopologyContext.getRawTopology());
    KryoTupleSerializer kryoTupleSerializer = new KryoTupleSerializer(stormConf, workerTopologyContext.getRawTopology());
    atomKryoDeserializer.getAndSet(kryoTupleDeserializer);
    atomKryoSerializer.getAndSet(kryoTupleSerializer);
}
Also used : WorkerTopologyContext(backtype.storm.task.WorkerTopologyContext) KryoTupleDeserializer(backtype.storm.serialization.KryoTupleDeserializer) KryoTupleSerializer(backtype.storm.serialization.KryoTupleSerializer)

Example 2 with KryoTupleSerializer

use of backtype.storm.serialization.KryoTupleSerializer in project jstorm by alibaba.

the class DrainerCtrlRunable method serialize.

protected byte[] serialize(ITupleExt tuple) {
    byte[] bytes = null;
    KryoTupleSerializer kryo = atomKryoSerializer.get();
    if (kryo != null) {
        bytes = kryo.serialize((TupleExt) tuple);
    } else {
        LOG.warn("KryoTupleSerializer is null, so drop tuple...");
    }
    return bytes;
}
Also used : TupleExt(backtype.storm.tuple.TupleExt) ITupleExt(backtype.storm.tuple.ITupleExt) KryoTupleSerializer(backtype.storm.serialization.KryoTupleSerializer)

Example 3 with KryoTupleSerializer

use of backtype.storm.serialization.KryoTupleSerializer in project jstorm by alibaba.

the class Task method mkTaskSending.

private TaskTransfer mkTaskSending(WorkerData workerData) {
    // sending tuple's serializer
    KryoTupleSerializer serializer = new KryoTupleSerializer(workerData.getStormConf(), topologyContext.getRawTopology());
    String taskName = JStormServerUtils.getName(componentId, taskId);
    // Task sending all tuples through this Object
    TaskTransfer taskTransfer;
    taskTransfer = new TaskTransfer(this, taskName, serializer, taskStatus, workerData, topologyContext);
    return taskTransfer;
}
Also used : KryoTupleSerializer(backtype.storm.serialization.KryoTupleSerializer)

Aggregations

KryoTupleSerializer (backtype.storm.serialization.KryoTupleSerializer)3 KryoTupleDeserializer (backtype.storm.serialization.KryoTupleDeserializer)1 WorkerTopologyContext (backtype.storm.task.WorkerTopologyContext)1 ITupleExt (backtype.storm.tuple.ITupleExt)1 TupleExt (backtype.storm.tuple.TupleExt)1