use of org.apache.flink.runtime.checkpoint.RescaleMappings in project flink by apache.
the class ResultSubpartitionRecoveredStateHandler method calculateMapping.
private List<RecoveredInputChannel> calculateMapping(InputChannelInfo info) {
final RescaleMappings oldToNewMapping = oldToNewMappings.computeIfAbsent(info.getGateIdx(), idx -> channelMapping.getChannelMapping(idx).invert());
final List<RecoveredInputChannel> channels = Arrays.stream(oldToNewMapping.getMappedIndexes(info.getInputChannelIdx())).mapToObj(newChannelIndex -> getChannel(info.getGateIdx(), newChannelIndex)).collect(Collectors.toList());
if (channels.isEmpty()) {
throw new IllegalStateException("Recovered a buffer from old " + info + " that has no mapping in " + channelMapping.getChannelMapping(info.getGateIdx()));
}
return channels;
}
use of org.apache.flink.runtime.checkpoint.RescaleMappings in project flink by apache.
the class ResultSubpartitionRecoveredStateHandler method calculateMapping.
private List<CheckpointedResultSubpartition> calculateMapping(ResultSubpartitionInfo info) {
final RescaleMappings oldToNewMapping = oldToNewMappings.computeIfAbsent(info.getPartitionIdx(), idx -> channelMapping.getChannelMapping(idx).invert());
final List<CheckpointedResultSubpartition> subpartitions = Arrays.stream(oldToNewMapping.getMappedIndexes(info.getSubPartitionIdx())).mapToObj(newIndexes -> getSubpartition(info.getPartitionIdx(), newIndexes)).collect(Collectors.toList());
if (subpartitions.isEmpty()) {
throw new IllegalStateException("Recovered a buffer from old " + info + " that has no mapping in " + channelMapping.getChannelMapping(info.getPartitionIdx()));
}
return subpartitions;
}
Aggregations