All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.flink.runtime.io.network.partition.ResultPartitionType Maven / Gradle / Ivy

There is a newer version: 1.13.6
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.flink.runtime.io.network.partition;

/**
 * Type of a result partition.
 */
public enum ResultPartitionType {

	/**
	 * Blocking partitions represent blocking data exchanges, where the data stream is first
	 * fully produced and then consumed. This is an option that is only applicable to bounded
	 * streams and can be used in bounded stream runtime and recovery.
	 *
	 * 

Blocking partitions can be consumed multiple times and concurrently. * *

The partition is not automatically released after being consumed (like for example the * {@link #PIPELINED} partitions), but only released through the scheduler, when it determines * that the partition is no longer needed. */ BLOCKING(false, false, false, false), /** * BLOCKING_PERSISTENT partitions are similar to {@link #BLOCKING} partitions, but have * a user-specified life cycle. * *

BLOCKING_PERSISTENT partitions are dropped upon explicit API calls to the * JobManager or ResourceManager, rather than by the scheduler. * *

Otherwise, the partition may only be dropped by safety-nets during failure handling * scenarios, like when the TaskManager exits or when the TaskManager looses connection * to JobManager / ResourceManager for too long. */ BLOCKING_PERSISTENT(false, false, false, true), /** * A pipelined streaming data exchange. This is applicable to both bounded and unbounded streams. * *

Pipelined results can be consumed only once by a single consumer and are automatically * disposed when the stream has been consumed. * *

This result partition type may keep an arbitrary amount of data in-flight, in contrast to * the {@link #PIPELINED_BOUNDED} variant. */ PIPELINED(true, true, false, false), /** * Pipelined partitions with a bounded (local) buffer pool. * *

For streaming jobs, a fixed limit on the buffer pool size should help avoid that too much * data is being buffered and checkpoint barriers are delayed. In contrast to limiting the * overall network buffer pool size, this, however, still allows to be flexible with regards * to the total number of partitions by selecting an appropriately big network buffer pool size. * *

For batch jobs, it will be best to keep this unlimited ({@link #PIPELINED}) since there are * no checkpoint barriers. */ PIPELINED_BOUNDED(true, true, true, false); /** Can the partition be consumed while being produced? */ private final boolean isPipelined; /** Does the partition produce back pressure when not consumed? */ private final boolean hasBackPressure; /** Does this partition use a limited number of (network) buffers? */ private final boolean isBounded; /** This partition will not be released after consuming if 'isPersistent' is true. */ private final boolean isPersistent; /** * Specifies the behaviour of an intermediate result partition at runtime. */ ResultPartitionType(boolean isPipelined, boolean hasBackPressure, boolean isBounded, boolean isPersistent) { this.isPipelined = isPipelined; this.hasBackPressure = hasBackPressure; this.isBounded = isBounded; this.isPersistent = isPersistent; } public boolean hasBackPressure() { return hasBackPressure; } public boolean isBlocking() { return !isPipelined; } public boolean isPipelined() { return isPipelined; } /** * Whether this partition uses a limited number of (network) buffers or not. * * @return true if the number of buffers should be bound to some limit */ public boolean isBounded() { return isBounded; } public boolean isPersistent() { return isPersistent; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy