Search in sources :

Example 1 with InputGateID

use of org.apache.flink.runtime.io.network.partition.consumer.InputGateID in project flink by apache.

the class NettyShuffleEnvironment method createInputGates.

@Override
public List<SingleInputGate> createInputGates(ShuffleIOOwnerContext ownerContext, PartitionProducerStateProvider partitionProducerStateProvider, List<InputGateDeploymentDescriptor> inputGateDeploymentDescriptors) {
    synchronized (lock) {
        Preconditions.checkState(!isClosed, "The NettyShuffleEnvironment has already been shut down.");
        MetricGroup networkInputGroup = ownerContext.getInputGroup();
        SingleInputGate[] inputGates = new SingleInputGate[inputGateDeploymentDescriptors.size()];
        for (int gateIndex = 0; gateIndex < inputGates.length; gateIndex++) {
            final InputGateDeploymentDescriptor igdd = inputGateDeploymentDescriptors.get(gateIndex);
            SingleInputGate inputGate = singleInputGateFactory.create(ownerContext, gateIndex, igdd, partitionProducerStateProvider);
            InputGateID id = new InputGateID(igdd.getConsumedResultId(), ownerContext.getExecutionAttemptID());
            inputGatesById.put(id, inputGate);
            inputGate.getCloseFuture().thenRun(() -> inputGatesById.remove(id));
            inputGates[gateIndex] = inputGate;
        }
        if (config.getDebloatConfiguration().isEnabled()) {
            registerDebloatingTaskMetrics(inputGates, ownerContext.getParentGroup());
        }
        registerInputMetrics(config.isNetworkDetailedMetrics(), networkInputGroup, inputGates);
        return Arrays.asList(inputGates);
    }
}
Also used : InputGateID(org.apache.flink.runtime.io.network.partition.consumer.InputGateID) NettyShuffleMetricFactory.createShuffleIOOwnerMetricGroup(org.apache.flink.runtime.io.network.metrics.NettyShuffleMetricFactory.createShuffleIOOwnerMetricGroup) MetricGroup(org.apache.flink.metrics.MetricGroup) InputGateDeploymentDescriptor(org.apache.flink.runtime.deployment.InputGateDeploymentDescriptor) SingleInputGate(org.apache.flink.runtime.io.network.partition.consumer.SingleInputGate)

Example 2 with InputGateID

use of org.apache.flink.runtime.io.network.partition.consumer.InputGateID in project flink by apache.

the class NettyShuffleEnvironment method updatePartitionInfo.

@Override
public boolean updatePartitionInfo(ExecutionAttemptID consumerID, PartitionInfo partitionInfo) throws IOException, InterruptedException {
    IntermediateDataSetID intermediateResultPartitionID = partitionInfo.getIntermediateDataSetID();
    InputGateID id = new InputGateID(intermediateResultPartitionID, consumerID);
    SingleInputGate inputGate = inputGatesById.get(id);
    if (inputGate == null) {
        return false;
    }
    ShuffleDescriptor shuffleDescriptor = partitionInfo.getShuffleDescriptor();
    checkArgument(shuffleDescriptor instanceof NettyShuffleDescriptor, "Tried to update unknown channel with unknown ShuffleDescriptor %s.", shuffleDescriptor.getClass().getName());
    inputGate.updateInputChannel(taskExecutorResourceId, (NettyShuffleDescriptor) shuffleDescriptor);
    return true;
}
Also used : NettyShuffleDescriptor(org.apache.flink.runtime.shuffle.NettyShuffleDescriptor) InputGateID(org.apache.flink.runtime.io.network.partition.consumer.InputGateID) IntermediateDataSetID(org.apache.flink.runtime.jobgraph.IntermediateDataSetID) ShuffleDescriptor(org.apache.flink.runtime.shuffle.ShuffleDescriptor) NettyShuffleDescriptor(org.apache.flink.runtime.shuffle.NettyShuffleDescriptor) SingleInputGate(org.apache.flink.runtime.io.network.partition.consumer.SingleInputGate)

Aggregations

InputGateID (org.apache.flink.runtime.io.network.partition.consumer.InputGateID)2 SingleInputGate (org.apache.flink.runtime.io.network.partition.consumer.SingleInputGate)2 MetricGroup (org.apache.flink.metrics.MetricGroup)1 InputGateDeploymentDescriptor (org.apache.flink.runtime.deployment.InputGateDeploymentDescriptor)1 NettyShuffleMetricFactory.createShuffleIOOwnerMetricGroup (org.apache.flink.runtime.io.network.metrics.NettyShuffleMetricFactory.createShuffleIOOwnerMetricGroup)1 IntermediateDataSetID (org.apache.flink.runtime.jobgraph.IntermediateDataSetID)1 NettyShuffleDescriptor (org.apache.flink.runtime.shuffle.NettyShuffleDescriptor)1 ShuffleDescriptor (org.apache.flink.runtime.shuffle.ShuffleDescriptor)1