当前位置: 首页>>代码示例>>Java>>正文


Java StreamRecord.replace方法代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:haoch,项目名称:flink-siddhi,代码行数:27,代码来源:StreamOutputHandler.java

示例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);
        }
    }
}
 
开发者ID:apache,项目名称:bahir-flink,代码行数:27,代码来源:StreamOutputHandler.java

示例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());
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:15,代码来源:CEPPatternOperator.java

示例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);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:TimeoutKeyedCEPPatternOperator.java

示例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);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:TimeoutKeyedCEPPatternOperator.java

示例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);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:TimeoutCEPPatternOperator.java

示例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);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:TimeoutCEPPatternOperator.java

示例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());
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:13,代码来源:KeyedCEPPatternOperator.java

示例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;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:7,代码来源:StreamRecordSerializer.java


注:本文中的org.apache.flink.streaming.runtime.streamrecord.StreamRecord.replace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。