本文整理汇总了Java中com.ibm.streams.operator.Tuple.getBlob方法的典型用法代码示例。如果您正苦于以下问题:Java Tuple.getBlob方法的具体用法?Java Tuple.getBlob怎么用?Java Tuple.getBlob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.streams.operator.Tuple
的用法示例。
在下文中一共展示了Tuple.getBlob方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.ibm.streams.operator.Tuple; //导入方法依赖的package包/类
/**
* Process an incoming tuple that arrived on the specified port.
*
*/
@Override
public final void process(StreamingInput<Tuple> inputStream, Tuple tuple) throws Exception {
// Create a new tuple for output port 0
StreamingOutput<OutputTuple> outStream = getOutput(0);
OutputTuple outTuple = outStream.newTuple();
outTuple.assign(tuple);
// Get the incoming binary Avro message record(s)
Blob avroMessage = tuple.getBlob(inputAvroMessage);
if (LOGGER.isTraceEnabled())
LOGGER.log(TraceLevel.TRACE, "Processing Avro message with length " + avroMessage.getLength());
// Get the incoming binary Avro key (if specified)
Blob avroKey = null;
if (inputAvroKey != null) {
avroKey = tuple.getBlob(inputAvroKey);
if (LOGGER.isTraceEnabled())
LOGGER.log(TraceLevel.TRACE, "Processing Avro key with length " + avroKey.getLength());
}
// Submit JSON tuples based on the Avro content received in the Blob
try {
if (!avroSchemaEmbedded) {
processAvroMessage(avroMessage, avroKey, outStream, outTuple, messageSchema, keySchema);
} else {
processAvroMessage(avroMessage, outStream, outTuple);
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例2: convertFrom
import com.ibm.streams.operator.Tuple; //导入方法依赖的package包/类
@Override
public Blob convertFrom(Tuple tuple) {
return tuple.getBlob(0);
}