Search in sources :

Example 1 with InputChannelMetrics

use of org.apache.flink.runtime.io.network.metrics.InputChannelMetrics in project flink by apache.

the class SingleInputGateFactory method create.

/**
 * Creates an input gate and all of its input channels.
 */
public SingleInputGate create(@Nonnull ShuffleIOOwnerContext owner, int gateIndex, @Nonnull InputGateDeploymentDescriptor igdd, @Nonnull PartitionProducerStateProvider partitionProducerStateProvider) {
    SupplierWithException<BufferPool, IOException> bufferPoolFactory = createBufferPoolFactory(networkBufferPool, floatingNetworkBuffersPerGate);
    BufferDecompressor bufferDecompressor = null;
    if (igdd.getConsumedPartitionType().isBlocking() && blockingShuffleCompressionEnabled) {
        bufferDecompressor = new BufferDecompressor(networkBufferSize, compressionCodec);
    }
    final String owningTaskName = owner.getOwnerName();
    final MetricGroup networkInputGroup = owner.getInputGroup();
    SubpartitionIndexRange subpartitionIndexRange = igdd.getConsumedSubpartitionIndexRange();
    SingleInputGate inputGate = new SingleInputGate(owningTaskName, gateIndex, igdd.getConsumedResultId(), igdd.getConsumedPartitionType(), subpartitionIndexRange, calculateNumChannels(igdd.getShuffleDescriptors().length, subpartitionIndexRange), partitionProducerStateProvider, bufferPoolFactory, bufferDecompressor, networkBufferPool, networkBufferSize, new ThroughputCalculator(SystemClock.getInstance()), maybeCreateBufferDebloater(gateIndex, networkInputGroup.addGroup(gateIndex)));
    InputChannelMetrics metrics = new InputChannelMetrics(networkInputGroup, owner.getParentGroup());
    createInputChannels(owningTaskName, igdd, inputGate, subpartitionIndexRange, metrics);
    return inputGate;
}
Also used : NetworkBufferPool(org.apache.flink.runtime.io.network.buffer.NetworkBufferPool) BufferPool(org.apache.flink.runtime.io.network.buffer.BufferPool) MetricGroup(org.apache.flink.metrics.MetricGroup) ThroughputCalculator(org.apache.flink.runtime.throughput.ThroughputCalculator) IOException(java.io.IOException) InputChannelMetrics(org.apache.flink.runtime.io.network.metrics.InputChannelMetrics) SubpartitionIndexRange(org.apache.flink.runtime.deployment.SubpartitionIndexRange) BufferDecompressor(org.apache.flink.runtime.io.network.buffer.BufferDecompressor)

Aggregations

IOException (java.io.IOException)1 MetricGroup (org.apache.flink.metrics.MetricGroup)1 SubpartitionIndexRange (org.apache.flink.runtime.deployment.SubpartitionIndexRange)1 BufferDecompressor (org.apache.flink.runtime.io.network.buffer.BufferDecompressor)1 BufferPool (org.apache.flink.runtime.io.network.buffer.BufferPool)1 NetworkBufferPool (org.apache.flink.runtime.io.network.buffer.NetworkBufferPool)1 InputChannelMetrics (org.apache.flink.runtime.io.network.metrics.InputChannelMetrics)1 ThroughputCalculator (org.apache.flink.runtime.throughput.ThroughputCalculator)1