本文整理汇总了Java中org.apache.flink.streaming.runtime.streamrecord.StreamRecord.replace方法的典型用法代码示例。如果您正苦于以下问题:Java StreamRecord.replace方法的具体用法?Java StreamRecord.replace怎么用?Java StreamRecord.replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.streaming.runtime.streamrecord.StreamRecord
的用法示例。
在下文中一共展示了StreamRecord.replace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: receive
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
@Override
public void receive(Event[] events) {
StreamRecord<R> reusableRecord = new StreamRecord<>(null, 0L);
for (Event event : events) {
if (typeInfo == null || Map.class.isAssignableFrom(typeInfo.getTypeClass())) {
reusableRecord.replace(toMap(event), event.getTimestamp());
output.collect(reusableRecord);
} else if (typeInfo.isTupleType()) {
Tuple tuple = this.toTuple(event);
reusableRecord.replace(tuple, event.getTimestamp());
output.collect(reusableRecord);
} else if (typeInfo instanceof PojoTypeInfo) {
R obj;
try {
obj = objectMapper.convertValue(toMap(event), typeInfo.getTypeClass());
} catch (IllegalArgumentException ex) {
LOGGER.error("Failed to map event: " + event + " into type: " + typeInfo, ex);
throw ex;
}
reusableRecord.replace(obj, event.getTimestamp());
output.collect(reusableRecord);
} else {
throw new IllegalArgumentException("Unable to format " + event + " as type " + typeInfo);
}
}
}
示例2: receive
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
@Override
public void receive(Event[] events) {
StreamRecord<R> reusableRecord = new StreamRecord<>(null, 0L);
for (Event event : events) {
if (typeInfo == null || Map.class.isAssignableFrom(typeInfo.getTypeClass())) {
reusableRecord.replace(toMap(event), event.getTimestamp());
output.collect(reusableRecord);
} else if (typeInfo.isTupleType()) {
Tuple tuple = this.toTuple(event);
reusableRecord.replace(tuple, event.getTimestamp());
output.collect(reusableRecord);
} else if (typeInfo instanceof PojoTypeInfo) {
R obj;
try {
obj = objectMapper.convertValue(toMap(event), typeInfo.getTypeClass());
} catch (IllegalArgumentException ex) {
LOGGER.error("Failed to map event: " + event + " into type: " + typeInfo, ex);
throw ex;
}
reusableRecord.replace(obj, event.getTimestamp());
output.collect(reusableRecord);
} else {
throw new IllegalArgumentException("Unable to format " + event + " as type " + typeInfo);
}
}
}
示例3: emitMatchedSequences
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
private void emitMatchedSequences(Iterable<Map<String, IN>> matchedSequences, long timestamp) {
Iterator<Map<String, IN>> iterator = matchedSequences.iterator();
if (iterator.hasNext()) {
StreamRecord<Map<String, IN>> streamRecord = new StreamRecord<Map<String, IN>>(
null,
timestamp);
do {
streamRecord.replace(iterator.next());
output.collect(streamRecord);
} while (iterator.hasNext());
}
}
示例4: emitTimedOutSequences
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
private void emitTimedOutSequences(Iterable<Tuple2<Map<String, List<IN>>, Long>> timedOutSequences, long timestamp) {
StreamRecord<Either<Tuple2<Map<String, List<IN>>, Long>, Map<String, List<IN>>>> streamRecord =
new StreamRecord<>(null, timestamp);
for (Tuple2<Map<String, List<IN>>, Long> partialPattern: timedOutSequences) {
streamRecord.replace(Either.Left(partialPattern));
output.collect(streamRecord);
}
}
示例5: emitMatchedSequences
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
protected void emitMatchedSequences(Iterable<Map<String, List<IN>>> matchedSequences, long timestamp) {
StreamRecord<Either<Tuple2<Map<String, List<IN>>, Long>, Map<String, List<IN>>>> streamRecord =
new StreamRecord<>(null, timestamp);
for (Map<String, List<IN>> matchedPattern : matchedSequences) {
streamRecord.replace(Either.Right(matchedPattern));
output.collect(streamRecord);
}
}
示例6: emitTimedOutSequences
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
private void emitTimedOutSequences(Iterable<Tuple2<Map<String, IN>, Long>> timedOutSequences, long timestamp) {
StreamRecord<Either<Tuple2<Map<String, IN>, Long>, Map<String, IN>>> streamRecord = new StreamRecord<Either<Tuple2<Map<String, IN>, Long>, Map<String, IN>>>(
null,
timestamp);
for (Tuple2<Map<String, IN>, Long> partialPattern: timedOutSequences) {
streamRecord.replace(Either.Left(partialPattern));
output.collect(streamRecord);
}
}
示例7: emitMatchedSequences
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
protected void emitMatchedSequences(Iterable<Map<String, IN>> matchedSequences, long timestamp) {
StreamRecord<Either<Tuple2<Map<String, IN>, Long>, Map<String, IN>>> streamRecord = new StreamRecord<Either<Tuple2<Map<String, IN>, Long>, Map<String, IN>>>(
null,
timestamp);
for (Map<String, IN> matchedPattern : matchedSequences) {
streamRecord.replace(Either.Right(matchedPattern));
output.collect(streamRecord);
}
}
示例8: emitMatchedSequences
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
private void emitMatchedSequences(Iterable<Map<String, List<IN>>> matchedSequences, long timestamp) {
Iterator<Map<String, List<IN>>> iterator = matchedSequences.iterator();
if (iterator.hasNext()) {
StreamRecord<Map<String, List<IN>>> streamRecord = new StreamRecord<>(null, timestamp);
do {
streamRecord.replace(iterator.next());
output.collect(streamRecord);
} while (iterator.hasNext());
}
}
示例9: deserialize
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; //导入方法依赖的package包/类
@Override
public StreamRecord<T> deserialize(StreamRecord<T> reuse, DataInputView source) throws IOException {
T element = typeSerializer.deserialize(reuse.getValue(), source);
reuse.replace(element);
return reuse;
}