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;
}
Aggregations