本文整理汇总了Java中backtype.storm.tuple.MessageId.deserialize方法的典型用法代码示例。如果您正苦于以下问题:Java MessageId.deserialize方法的具体用法?Java MessageId.deserialize怎么用?Java MessageId.deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backtype.storm.tuple.MessageId
的用法示例。
在下文中一共展示了MessageId.deserialize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import backtype.storm.tuple.MessageId; //导入方法依赖的package包/类
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);
TupleImpl tuple = new TupleImpl(_context, values, taskId,
streamName, id);
long transferStartTime = _kryoInput.readLong(true);
if (transferStartTime != -1) {
tuple.setTransferSampleStartTime(transferStartTime);
}
return tuple;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例2: deserialize
import backtype.storm.tuple.MessageId; //导入方法依赖的package包/类
@Override
public Tuple deserialize(byte[] ser) {
int targetTaskId = 0;
int taskId = 0;
int streamId = 0;
String componentName = null;
String streamName = null;
MessageId id = null;
try {
_kryoInput.setBuffer(ser);
targetTaskId = _kryoInput.readInt();
taskId = _kryoInput.readInt(true);
streamId = _kryoInput.readInt(true);
componentName = _context.getComponentId(taskId);
streamName = _ids.getStreamName(componentName, streamId);
id = MessageId.deserialize(_kryoInput);
List<Object> values = _kryo.deserializeFrom(_kryoInput);
TupleImplExt tuple = new TupleImplExt(_context, values, taskId,
streamName, id);
tuple.setTargetTaskId(targetTaskId);
return tuple;
} catch (Throwable e) {
StringBuilder sb = new StringBuilder();
sb.append("Deserialize error:");
sb.append("targetTaskId:").append(targetTaskId);
sb.append(",taskId:").append(taskId);
sb.append(",streamId:").append(streamId);
sb.append(",componentName:").append(componentName);
sb.append(",streamName:").append(streamName);
sb.append(",MessageId").append(id);
LOG.info(sb.toString(), e );
throw new RuntimeException(e);
}
}
示例3: deserialize
import backtype.storm.tuple.MessageId; //导入方法依赖的package包/类
public Tuple deserialize(byte[] ser) {
int targetTaskId = 0;
int taskId = 0;
int streamId = 0;
String componentName = null;
String streamName = null;
MessageId id = null;
try {
_kryoInput.setBuffer(ser);
targetTaskId = _kryoInput.readInt();
taskId = _kryoInput.readInt(true);
streamId = _kryoInput.readInt(true);
componentName = _context.getComponentId(taskId);
streamName = _ids.getStreamName(componentName, streamId);
id = MessageId.deserialize(_kryoInput);
List<Object> values = _kryo.deserializeFrom(_kryoInput);
TupleImplExt tuple = new TupleImplExt(_context, values, taskId,
streamName, id);
tuple.setTargetTaskId(targetTaskId);
return tuple;
} catch (Throwable e) {
StringBuilder sb = new StringBuilder();
sb.append("Deserialize error:");
sb.append("targetTaskId:").append(targetTaskId);
sb.append(",taskId:").append(taskId);
sb.append(",streamId:").append(streamId);
sb.append(",componentName:").append(componentName);
sb.append(",streamName:").append(streamName);
sb.append(",MessageId").append(id);
LOG.info(sb.toString(), e );
throw new RuntimeException(e);
}
}
示例4: deserialize
import backtype.storm.tuple.MessageId; //导入方法依赖的package包/类
public Tuple deserialize(Input input) {
int targetTaskId = 0;
long timeStamp = 0l;
int taskId = 0;
int streamId = 0;
String componentName = null;
String streamName = null;
MessageId id = null;
try {
targetTaskId = input.readInt();
timeStamp = input.readLong();
taskId = input.readInt(true);
streamId = input.readInt(true);
componentName = _context.getComponentId(taskId);
streamName = _ids.getStreamName(componentName, streamId);
id = MessageId.deserialize(input);
List<Object> values = _kryo.deserializeFrom(input);
TupleImplExt tuple = new TupleImplExt(_context, values, taskId, streamName, id);
tuple.setTargetTaskId(targetTaskId);
tuple.setCreationTimeStamp(timeStamp);
return tuple;
} catch (Throwable e) {
StringBuilder sb = new StringBuilder();
sb.append("Deserialize error:");
sb.append("targetTaskId:").append(targetTaskId);
sb.append(",creationTimeStamp:").append(timeStamp);
sb.append(",taskId:").append(taskId);
sb.append(",streamId:").append(streamId);
sb.append(",componentName:").append(componentName);
sb.append(",streamName:").append(streamName);
sb.append(",MessageId").append(id);
LOG.info(sb.toString(), e);
throw new RuntimeException(e);
}
}
示例5: deserialize
import backtype.storm.tuple.MessageId; //导入方法依赖的package包/类
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);
}
}
示例6: deserialize
import backtype.storm.tuple.MessageId; //导入方法依赖的package包/类
public Tuple deserialize(Input input) {
int targetTaskId = 0;
long timeStamp = 0l;
int taskId = 0;
int streamId = 0;
String componentName = null;
String streamName = null;
MessageId id = null;
boolean isBatchTuple = false;
try {
targetTaskId = input.readInt();
timeStamp = input.readLong();
isBatchTuple = input.readBoolean();
taskId = input.readInt(true);
streamId = input.readInt(true);
componentName = _context.getComponentId(taskId);
streamName = _ids.getStreamName(componentName, streamId);
List<Object> values;
int groupId = -1;
long batchId = -1;
if (isBatchTuple) {
if(_isTransactionTuple) {
batchId = input.readLong(true);
}
values = new ArrayList<>();
int len = input.readInt(true);
if (_ackerNum > 0) {
for (int i = 0; i < len; i++) {
values.add(new Pair<>(MessageId.deserialize(input), _kryo.deserializeFrom(input)));
}
} else {
for (int i = 0; i < len; i++) {
values.add(new Pair<MessageId, List<Object>>(null, _kryo.deserializeFrom(input)));
}
}
} else {
id = MessageId.deserialize(input);
values = _kryo.deserializeFrom(input);
}
TupleImplExt tuple = new TupleImplExt(_context, values, taskId, streamName, id);
tuple.setBatchTuple(isBatchTuple);
tuple.setTargetTaskId(targetTaskId);
tuple.setCreationTimeStamp(timeStamp);
if (_isTransactionTuple) {
tuple.setBatchId(batchId);
}
return tuple;
} catch (Exception e) {
StringBuilder sb = new StringBuilder();
sb.append("Deserialize error:");
sb.append("targetTaskId:").append(targetTaskId);
sb.append(",creationTimeStamp:").append(timeStamp);
sb.append(",isBatchTuple:").append(isBatchTuple);
sb.append(",taskId:").append(taskId);
sb.append(",streamId:").append(streamId);
sb.append(",componentName:").append(componentName);
sb.append(",streamName:").append(streamName);
sb.append(",MessageId:").append(id);
LOG.error("Kryo error!!! {}", sb.toString());
LOG.error("Exception: ", e);
throw new RuntimeException(e);
}
}