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


Java DataInputViewStreamWrapper.readInt方法代码示例

本文整理汇总了Java中org.apache.flink.core.memory.DataInputViewStreamWrapper.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputViewStreamWrapper.readInt方法的具体用法?Java DataInputViewStreamWrapper.readInt怎么用?Java DataInputViewStreamWrapper.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.flink.core.memory.DataInputViewStreamWrapper的用法示例。


在下文中一共展示了DataInputViewStreamWrapper.readInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: restoreKeysForKeyGroup

import org.apache.flink.core.memory.DataInputViewStreamWrapper; //导入方法依赖的package包/类
public void restoreKeysForKeyGroup(DataInputViewStreamWrapper stream, int keyGroupIdx,
								ClassLoader userCodeClassLoader) throws IOException, ClassNotFoundException {

	checkArgument(localKeyGroupRange.contains(keyGroupIdx),
		"Key Group " + keyGroupIdx + " does not belong to the local range.");

	int numKeys = stream.readInt();
	if (numKeys > 0) {

		TypeSerializer<K> tmpKeyDeserializer = InstantiationUtil.deserializeObject(stream, userCodeClassLoader);

		if (keySerializer != null && !keySerializer.equals(tmpKeyDeserializer)) {
			throw new IllegalArgumentException("Tried to restore keys " +
				"for the watermark callback service with mismatching serializers.");
		}

		this.keySerializer = tmpKeyDeserializer;

		Set<K> keys = getRegisteredKeysForKeyGroup(keyGroupIdx);
		for (int i = 0; i < numKeys; i++) {
			keys.add(keySerializer.deserialize(stream));
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:25,代码来源:InternalWatermarkCallbackService.java

示例2: restoreStateForKeyGroup

import org.apache.flink.core.memory.DataInputViewStreamWrapper; //导入方法依赖的package包/类
public void restoreStateForKeyGroup(DataInputViewStreamWrapper stream, int keyGroupIdx,
									ClassLoader userCodeClassLoader) throws IOException, ClassNotFoundException {

	int noOfTimerServices = stream.readInt();
	for (int i = 0; i < noOfTimerServices; i++) {
		String serviceName = stream.readUTF();

		HeapInternalTimerService<K, N> timerService = timerServices.get(serviceName);
		if (timerService == null) {
			timerService = new HeapInternalTimerService<>(
				totalKeyGroups,
				localKeyGroupRange,
				keyContext,
				processingTimeService);
			timerServices.put(serviceName, timerService);
		}
		timerService.restoreTimersForKeyGroup(stream, keyGroupIdx, userCodeClassLoader);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:20,代码来源:InternalTimeServiceManager.java


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