Search in sources :

Example 1 with InflightDataGateOrPartitionRescalingDescriptor

use of org.apache.flink.runtime.checkpoint.InflightDataRescalingDescriptor.InflightDataGateOrPartitionRescalingDescriptor in project flink by apache.

the class TaskStateAssignment method getInflightDataGateOrPartitionRescalingDescriptor.

private InflightDataGateOrPartitionRescalingDescriptor getInflightDataGateOrPartitionRescalingDescriptor(OperatorInstanceID instanceID, int partition, SubtasksRescaleMapping rescaleMapping, SubtasksRescaleMapping subtaskMapping) {
    int[] oldSubtaskInstances = subtaskMapping.rescaleMappings.getMappedIndexes(instanceID.getSubtaskId());
    // no scaling or simple scale-up without the need of virtual
    // channels.
    boolean isIdentity = (subtaskMapping.rescaleMappings.isIdentity() && rescaleMapping.getRescaleMappings().isIdentity()) || oldSubtaskInstances.length == 0;
    final Set<Integer> ambiguousSubtasks = subtaskMapping.mayHaveAmbiguousSubtasks ? subtaskMapping.rescaleMappings.getAmbiguousTargets() : emptySet();
    return log(new InflightDataGateOrPartitionRescalingDescriptor(oldSubtaskInstances, rescaleMapping.getRescaleMappings(), ambiguousSubtasks, isIdentity ? MappingType.IDENTITY : MappingType.RESCALING), instanceID.getSubtaskId(), partition);
}
Also used : InflightDataGateOrPartitionRescalingDescriptor(org.apache.flink.runtime.checkpoint.InflightDataRescalingDescriptor.InflightDataGateOrPartitionRescalingDescriptor)

Aggregations

InflightDataGateOrPartitionRescalingDescriptor (org.apache.flink.runtime.checkpoint.InflightDataRescalingDescriptor.InflightDataGateOrPartitionRescalingDescriptor)1