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);
}
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;
}
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;
}
Aggregations