本文整理汇总了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));
}
}
}
示例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);
}
}