Tabnine Logo
ExecutionConfig.setParallelism
Code IndexAdd Tabnine to your IDE (free)

How to use
setParallelism
method
in
org.apache.flink.api.common.ExecutionConfig

Best Java code snippets using org.apache.flink.api.common.ExecutionConfig.setParallelism (Showing top 20 results out of 315)

origin: apache/flink

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with
 * x parallel instances.
 *
 * <p>This method overrides the default parallelism for this environment.
 * The {@link LocalEnvironment} uses by default a value equal to the number of hardware
 * contexts (CPU cores / threads). When executing the program via the command line client
 * from a JAR file, the default parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public void setParallelism(int parallelism) {
  config.setParallelism(parallelism);
}
origin: apache/flink

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as map,
 * batchReduce) to run with x parallel instances. This method overrides the
 * default parallelism for this environment. The
 * {@link LocalStreamEnvironment} uses by default a value equal to the
 * number of hardware contexts (CPU cores / threads). When executing the
 * program via the command line client from a JAR file, the default degree
 * of parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public StreamExecutionEnvironment setParallelism(int parallelism) {
  config.setParallelism(parallelism);
  return this;
}
origin: apache/flink

@Test
public void testConfigurationOfParallelism() {
  ExecutionConfig config = new ExecutionConfig();
  // verify explicit change in parallelism
  int parallelism = 36;
  config.setParallelism(parallelism);
  assertEquals(parallelism, config.getParallelism());
  // verify that parallelism is reset to default flag value
  parallelism = ExecutionConfig.PARALLELISM_DEFAULT;
  config.setParallelism(parallelism);
  assertEquals(parallelism, config.getParallelism());
}
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

@SuppressWarnings("unchecked")
@Test
public void testInternalSingleValueWindowFunction() throws Exception {
  WindowFunctionMock mock = mock(WindowFunctionMock.class);
  InternalSingleValueWindowFunction<Long, String, Long, TimeWindow> windowFunction =
    new InternalSingleValueWindowFunction<>(mock);
  // check setOutputType
  TypeInformation<String> stringType = BasicTypeInfo.STRING_TYPE_INFO;
  ExecutionConfig execConf = new ExecutionConfig();
  execConf.setParallelism(42);
  StreamingFunctionUtils.setOutputType(windowFunction, stringType, execConf);
  verify(mock).setOutputType(stringType, execConf);
  // check open
  Configuration config = new Configuration();
  windowFunction.open(config);
  verify(mock).open(config);
  // check setRuntimeContext
  RuntimeContext rCtx = mock(RuntimeContext.class);
  windowFunction.setRuntimeContext(rCtx);
  verify(mock).setRuntimeContext(rCtx);
  // check apply
  TimeWindow w = mock(TimeWindow.class);
  Collector<String> c = (Collector<String>) mock(Collector.class);
  InternalWindowFunction.InternalWindowContext ctx = mock(InternalWindowFunction.InternalWindowContext.class);
  windowFunction.process(42L, w, ctx, 23L, c);
  verify(mock).apply(eq(42L), eq(w), (Iterable<Long>) argThat(IsIterableContainingInOrder.contains(23L)), eq(c));
  // check close
  windowFunction.close();
  verify(mock).close();
}
origin: apache/flink

@SuppressWarnings("unchecked")
@Test
public void testInternalSingleValueProcessAllWindowFunction() throws Exception {
  ProcessAllWindowFunctionMock mock = mock(ProcessAllWindowFunctionMock.class);
  InternalSingleValueProcessAllWindowFunction<Long, String, TimeWindow> windowFunction =
    new InternalSingleValueProcessAllWindowFunction<>(mock);
  // check setOutputType
  TypeInformation<String> stringType = BasicTypeInfo.STRING_TYPE_INFO;
  ExecutionConfig execConf = new ExecutionConfig();
  execConf.setParallelism(42);
  StreamingFunctionUtils.setOutputType(windowFunction, stringType, execConf);
  verify(mock).setOutputType(stringType, execConf);
  // check open
  Configuration config = new Configuration();
  windowFunction.open(config);
  verify(mock).open(config);
  // check setRuntimeContext
  RuntimeContext rCtx = mock(RuntimeContext.class);
  windowFunction.setRuntimeContext(rCtx);
  verify(mock).setRuntimeContext(rCtx);
  // check apply
  TimeWindow w = mock(TimeWindow.class);
  Collector<String> c = (Collector<String>) mock(Collector.class);
  InternalWindowFunction.InternalWindowContext ctx = mock(InternalWindowFunction.InternalWindowContext.class);
  windowFunction.process(((byte) 0), w, ctx, 23L, c);
  verify(mock).process((ProcessAllWindowFunctionMock.Context) anyObject(), (Iterable<Long>) argThat(IsIterableContainingInOrder.contains(23L)), eq(c));
  // check close
  windowFunction.close();
  verify(mock).close();
}
origin: apache/flink

@SuppressWarnings("unchecked")
@Test
public void testInternalSingleValueAllWindowFunction() throws Exception {
  AllWindowFunctionMock mock = mock(AllWindowFunctionMock.class);
  InternalSingleValueAllWindowFunction<Long, String, TimeWindow> windowFunction =
    new InternalSingleValueAllWindowFunction<>(mock);
  // check setOutputType
  TypeInformation<String> stringType = BasicTypeInfo.STRING_TYPE_INFO;
  ExecutionConfig execConf = new ExecutionConfig();
  execConf.setParallelism(42);
  StreamingFunctionUtils.setOutputType(windowFunction, stringType, execConf);
  verify(mock).setOutputType(stringType, execConf);
  // check open
  Configuration config = new Configuration();
  windowFunction.open(config);
  verify(mock).open(config);
  // check setRuntimeContext
  RuntimeContext rCtx = mock(RuntimeContext.class);
  windowFunction.setRuntimeContext(rCtx);
  verify(mock).setRuntimeContext(rCtx);
  // check apply
  TimeWindow w = mock(TimeWindow.class);
  Collector<String> c = (Collector<String>) mock(Collector.class);
  InternalWindowFunction.InternalWindowContext ctx = mock(InternalWindowFunction.InternalWindowContext.class);
  windowFunction.process(((byte) 0), w, ctx, 23L, c);
  verify(mock).apply(eq(w), (Iterable<Long>) argThat(IsIterableContainingInOrder.contains(23L)), eq(c));
  // check close
  windowFunction.close();
  verify(mock).close();
}
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

execConf.setParallelism(42);
origin: apache/flink

  config.disableSysoutLogging();
config.setParallelism(parallelism);
origin: DTStack/flinkx

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with
 * x parallel instances.
 *
 * <p>This method overrides the default parallelism for this environment.
 * The {@link LocalEnvironment} uses by default a value equal to the number of hardware
 * contexts (CPU cores / threads). When executing the program via the command line client
 * from a JAR file, the default parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public void setParallelism(int parallelism) {
  config.setParallelism(parallelism);
}
origin: DTStack/flinkx

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as map,
 * batchReduce) to run with x parallel instances. This method overrides the
 * default parallelism for this environment. The
 * {@link LocalStreamEnvironment} uses by default a value equal to the
 * number of hardware contexts (CPU cores / threads). When executing the
 * program via the command line client from a JAR file, the default degree
 * of parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public StreamExecutionEnvironment setParallelism(int parallelism) {
  config.setParallelism(parallelism);
  return this;
}
origin: org.apache.flink/flink-java

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with
 * x parallel instances.
 *
 * <p>This method overrides the default parallelism for this environment.
 * The {@link LocalEnvironment} uses by default a value equal to the number of hardware
 * contexts (CPU cores / threads). When executing the program via the command line client
 * from a JAR file, the default parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public void setParallelism(int parallelism) {
  config.setParallelism(parallelism);
}
origin: com.alibaba.blink/flink-java

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with
 * x parallel instances.
 *
 * <p>This method overrides the default parallelism for this environment.
 * The {@link LocalEnvironment} uses by default a value equal to the number of hardware
 * contexts (CPU cores / threads). When executing the program via the command line client
 * from a JAR file, the default parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public void setParallelism(int parallelism) {
  config.setParallelism(parallelism);
}
origin: org.apache.flink/flink-streaming-java_2.11

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as map,
 * batchReduce) to run with x parallel instances. This method overrides the
 * default parallelism for this environment. The
 * {@link LocalStreamEnvironment} uses by default a value equal to the
 * number of hardware contexts (CPU cores / threads). When executing the
 * program via the command line client from a JAR file, the default degree
 * of parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public StreamExecutionEnvironment setParallelism(int parallelism) {
  config.setParallelism(parallelism);
  return this;
}
origin: org.apache.flink/flink-streaming-java

/**
 * Sets the parallelism for operations executed through this environment.
 * Setting a parallelism of x here will cause all operators (such as map,
 * batchReduce) to run with x parallel instances. This method overrides the
 * default parallelism for this environment. The
 * {@link LocalStreamEnvironment} uses by default a value equal to the
 * number of hardware contexts (CPU cores / threads). When executing the
 * program via the command line client from a JAR file, the default degree
 * of parallelism is the one configured for that setup.
 *
 * @param parallelism The parallelism
 */
public StreamExecutionEnvironment setParallelism(int parallelism) {
  config.setParallelism(parallelism);
  return this;
}
org.apache.flink.api.commonExecutionConfigsetParallelism

Javadoc

Sets the parallelism for operations executed through this environment. Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with x parallel instances.

This method overrides the default parallelism for this environment. The local execution environment uses by default a value equal to the number of hardware contexts (CPU cores / threads). When executing the program via the command line client from a JAR file, the default parallelism is the one configured for that setup.

Popular methods of ExecutionConfig

  • <init>
  • isObjectReuseEnabled
    Returns whether object reuse has been enabled or disabled. @see #enableObjectReuse()
  • disableSysoutLogging
    Disables the printing of progress update messages to System.out
  • getAutoWatermarkInterval
    Returns the interval of the automatic watermark emission.
  • setGlobalJobParameters
    Register a custom, serializable user configuration object.
  • enableObjectReuse
    Enables reusing objects that Flink internally uses for deserialization and passing data to user-code
  • setAutoWatermarkInterval
    Sets the interval of the automatic watermark emission. Watermarks are used throughout the streaming
  • disableObjectReuse
    Disables reusing objects that Flink internally uses for deserialization and passing data to user-cod
  • getRestartStrategy
    Returns the restart strategy which has been set for the current job.
  • isSysoutLoggingEnabled
    Gets whether progress update messages should be printed to System.out
  • registerKryoType
    Registers the given type with the serialization stack. If the type is eventually serialized as a POJ
  • registerTypeWithKryoSerializer
    Registers the given Serializer via its class as a serializer for the given type at the KryoSerialize
  • registerKryoType,
  • registerTypeWithKryoSerializer,
  • setRestartStrategy,
  • getParallelism,
  • addDefaultKryoSerializer,
  • getGlobalJobParameters,
  • getNumberOfExecutionRetries,
  • getRegisteredKryoTypes,
  • getDefaultKryoSerializerClasses

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Socket (java.net)
    Provides a client-side TCP socket.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now