congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
org.apache.flink.streaming.api.environment
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.flink.streaming.api.environment

Best Java code snippets using org.apache.flink.streaming.api.environment (Showing top 20 results out of 918)

origin: apache/flink

/**
 * A thin wrapper layer over {@link StreamExecutionEnvironment#enableCheckpointing(long)}.
 *
 * @param interval Time interval between state checkpoints in milliseconds.
 * @return The same {@code PythonStreamExecutionEnvironment} instance of the caller
 */
public PythonStreamExecutionEnvironment enable_checkpointing(long interval) {
  this.env.enableCheckpointing(interval);
  return this;
}
origin: apache/flink

public int getParallelism() {
  if (parallelism == ExecutionConfig.PARALLELISM_DEFAULT) {
    return env.getParallelism();
  } else {
    return parallelism;
  }
}
origin: apache/flink

/**
 * Returns the checkpointing interval or -1 if checkpointing is disabled.
 *
 * <p>Shorthand for {@code getCheckpointConfig().getCheckpointInterval()}.
 *
 * @return The checkpointing interval or -1
 */
public long getCheckpointInterval() {
  return checkpointCfg.getCheckpointInterval();
}
origin: apache/flink

/**
 * Triggers the program execution. The environment will execute all parts of
 * the program that have resulted in a "sink" operation. Sink operations are
 * for example printing results or forwarding them to a message queue.
 *
 * <p>The program execution will be logged and displayed with a generated
 * default name.
 *
 * @return The result of the job execution, containing elapsed time and accumulators.
 * @throws Exception which occurs during job execution.
 */
public JobExecutionResult execute() throws Exception {
  return execute(DEFAULT_JOB_NAME);
}
origin: apache/flink

@Test
public void testCheckpointConfigDefault() throws Exception {
  StreamExecutionEnvironment streamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment();
  Assert.assertTrue(streamExecutionEnvironment.getCheckpointConfig().isFailOnCheckpointingErrors());
}
origin: apache/flink

@Override
public <OUT> DataStreamSource<OUT> addSource(SourceFunction<OUT> sourceFunction) {
  this.sourceFunction = sourceFunction;
  return super.addSource(sourceFunction);
}
origin: apache/flink

public StreamGraph(StreamExecutionEnvironment environment) {
  this.environment = environment;
  this.executionConfig = environment.getConfig();
  this.checkpointConfig = environment.getCheckpointConfig();
  // create an empty new stream graph.
  clear();
}
origin: apache/flink

public ExecutionConfig getExecutionConfig() {
  return environment.getConfig();
}
origin: apache/flink

/**
 * A thin wrapper layer over {@link StreamExecutionEnvironment#setParallelism(int)}.
 *
 * @param parallelism The parallelism
 * @return The same {@code PythonStreamExecutionEnvironment} instance of the caller
 */
public PythonStreamExecutionEnvironment set_parallelism(int parallelism) {
  this.env.setParallelism(parallelism);
  return this;
}
origin: apache/flink

/**
 * Creates a {@link LocalStreamEnvironment}. The local execution environment
 * will run the program in a multi-threaded fashion in the same JVM as the
 * environment was created in. The default parallelism of the local
 * environment is the number of hardware contexts (CPU cores / threads),
 * unless it was specified differently by {@link #setParallelism(int)}.
 *
 * @return A local execution environment.
 */
public static LocalStreamEnvironment createLocalEnvironment() {
  return createLocalEnvironment(defaultLocalParallelism);
}
origin: apache/flink

public <F> F clean(F f) {
  return environment.clean(f);
}
origin: apache/flink

/**
 * Test test verifies that the execution environment can be used to execute a
 * single job with multiple slots.
 */
@Test
public void testRunIsolatedJob() throws Exception {
  LocalStreamEnvironment env = new LocalStreamEnvironment();
  assertEquals(1, env.getParallelism());
  addSmallBoundedJob(env, 3);
  env.execute();
}
origin: apache/flink

/**
 * Test test verifies that the execution environment can be used to execute multiple
 * bounded streaming jobs after one another.
 */
@Test
public void testMultipleJobsAfterAnother() throws Exception {
  LocalStreamEnvironment env = new LocalStreamEnvironment();
  addSmallBoundedJob(env, 3);
  env.execute();
  addSmallBoundedJob(env, 5);
  env.execute();
}
origin: apache/flink

/**
 * Returns the checkpointing mode (exactly-once vs. at-least-once).
 *
 * <p>Shorthand for {@code getCheckpointConfig().getCheckpointingMode()}.
 *
 * @return The checkpoint mode
 */
public CheckpointingMode getCheckpointingMode() {
  return checkpointCfg.getCheckpointingMode();
}
origin: apache/flink

private static void registerJythonSerializers(StreamExecutionEnvironment env) {
  env.registerTypeWithKryoSerializer(PyBoolean.class, PyBooleanSerializer.class);
  env.registerTypeWithKryoSerializer(PyFloat.class, PyFloatSerializer.class);
  env.registerTypeWithKryoSerializer(PyInteger.class, PyIntegerSerializer.class);
  env.registerTypeWithKryoSerializer(PyLong.class, PyLongSerializer.class);
  env.registerTypeWithKryoSerializer(PyString.class, PyStringSerializer.class);
  env.registerTypeWithKryoSerializer(PyUnicode.class, PyObjectSerializer.class);
  env.registerTypeWithKryoSerializer(PyTuple.class, PyObjectSerializer.class);
  env.registerTypeWithKryoSerializer(PyObjectDerived.class, PyObjectSerializer.class);
  env.registerTypeWithKryoSerializer(PyInstance.class, PyObjectSerializer.class);
}
origin: apache/flink

@Override
public String toString() {
  return "Remote Environment (" + this.host + ":" + this.port + " - parallelism = "
      + (getParallelism() == -1 ? "default" : getParallelism()) + ")";
}
origin: apache/flink

@Override
public JobExecutionResult execute() throws Exception {
  return execute("");
}
origin: apache/flink

  public static void resetContextEnvironments() {
    StreamExecutionEnvironment.resetContextEnvironment();
  }
}
origin: apache/flink

public Long getBufferTimeout() {
  return bufferTimeout != null ? bufferTimeout : env.getBufferTimeout();
}
origin: apache/flink

/**
 * A thin wrapper layer over {@link StreamExecutionEnvironment#enableCheckpointing(long, CheckpointingMode)}.
 *
 * @param interval Time interval between state checkpoints in milliseconds.
 * @param mode The checkpointing mode, selecting between "exactly once" and "at least once" guaranteed.
 * @return The same {@code PythonStreamExecutionEnvironment} instance of the caller
 */
public PythonStreamExecutionEnvironment enable_checkpointing(long interval, CheckpointingMode mode) {
  this.env.enableCheckpointing(interval, mode);
  return this;
}
org.apache.flink.streaming.api.environment

Most used classes

  • StreamExecutionEnvironment
    The StreamExecutionEnvironment is the context in which a streaming program is executed. A LocalStrea
  • CheckpointConfig
    Configuration that captures all checkpointing related settings.
  • LocalStreamEnvironment
    The LocalStreamEnvironment is a StreamExecutionEnvironment that runs the program locally, multi-thre
  • RemoteStreamEnvironment
    A StreamExecutionEnvironment for executing on a cluster.
  • StreamContextEnvironment
    Special StreamExecutionEnvironment that will be used in cases where the CLI client or testing utilit
  • StreamPlanEnvironment,
  • CheckpointConfig$ExternalizedCheckpointCleanup,
  • Flip6LocalStreamEnvironment,
  • LegacyLocalStreamEnvironment,
  • LocalStreamEnvironmentITCase
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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