congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ExecutionConfig.setRestartStrategy
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/flink

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: apache/flink

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: apache/flink

public static StreamExecutionEnvironment prepareExecutionEnv(ParameterTool parameterTool)
  throws Exception {
  if (parameterTool.getNumberOfParameters() < 5) {
    System.out.println("Missing parameters!\n" +
      "Usage: Kafka --input-topic <topic> --output-topic <topic> " +
      "--bootstrap.servers <kafka brokers> " +
      "--zookeeper.connect <zk quorum> --group.id <some id>");
    throw new Exception("Missing parameters!\n" +
      "Usage: Kafka --input-topic <topic> --output-topic <topic> " +
      "--bootstrap.servers <kafka brokers> " +
      "--zookeeper.connect <zk quorum> --group.id <some id>");
  }
  StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
  env.getConfig().disableSysoutLogging();
  env.getConfig().setRestartStrategy(RestartStrategies.fixedDelayRestart(4, 10000));
  env.enableCheckpointing(5000); // create a checkpoint every 5 seconds
  env.getConfig().setGlobalJobParameters(parameterTool); // make parameters available in the web interface
  env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
  return env;
}
origin: apache/flink

env1.getConfig().setRestartStrategy(RestartStrategies.noRestart());
env1.getConfig().disableSysoutLogging();
origin: apache/flink

/**
 * Test that ensures that DeserializationSchema.isEndOfStream() is properly evaluated.
 *
 * @throws Exception
 */
public void runEndOfStreamTest() throws Exception {
  final int elementCount = 300;
  final String topic = writeSequence("testEndOfStream", elementCount, 1, 1);
  // read using custom schema
  final StreamExecutionEnvironment env1 = StreamExecutionEnvironment.getExecutionEnvironment();
  env1.setParallelism(1);
  env1.getConfig().setRestartStrategy(RestartStrategies.noRestart());
  env1.getConfig().disableSysoutLogging();
  Properties props = new Properties();
  props.putAll(standardProps);
  props.putAll(secureProps);
  DataStream<Tuple2<Integer, Integer>> fromKafka = env1.addSource(kafkaServer.getConsumer(topic, new FixedNumberDeserializationSchema(elementCount), props));
  fromKafka.flatMap(new FlatMapFunction<Tuple2<Integer, Integer>, Void>() {
    @Override
    public void flatMap(Tuple2<Integer, Integer> value, Collector<Void> out) throws Exception {
      // noop ;)
    }
  });
  tryExecute(env1, "Consume " + elementCount + " elements from Kafka");
  deleteTestTopic(topic);
}
origin: apache/flink

writeEnv.getConfig().setRestartStrategy(RestartStrategies.noRestart());
writeEnv.getConfig().disableSysoutLogging();
origin: apache/flink

env.getConfig().setRestartStrategy(RestartStrategies.noRestart());
env.getConfig().disableSysoutLogging();
env.getConfig().setRestartStrategy(RestartStrategies.noRestart());
env.getConfig().disableSysoutLogging();
origin: apache/flink

@Nonnull
private JobGraph createJobGraph(long delay, int parallelism) throws IOException {
  SlotSharingGroup slotSharingGroup = new SlotSharingGroup();
  final JobVertex source = new JobVertex("source");
  source.setInvokableClass(OneTimeFailingInvokable.class);
  source.setParallelism(parallelism);
  source.setSlotSharingGroup(slotSharingGroup);
  final JobVertex sink = new JobVertex("sink");
  sink.setInvokableClass(NoOpInvokable.class);
  sink.setParallelism(parallelism);
  sink.setSlotSharingGroup(slotSharingGroup);
  sink.connectNewDataSetAsInput(source, DistributionPattern.POINTWISE, ResultPartitionType.PIPELINED);
  JobGraph jobGraph = new JobGraph(source, sink);
  jobGraph.setScheduleMode(ScheduleMode.EAGER);
  ExecutionConfig executionConfig = new ExecutionConfig();
  executionConfig.setRestartStrategy(RestartStrategies.fixedDelayRestart(1, delay));
  jobGraph.setExecutionConfig(executionConfig);
  return jobGraph;
}
origin: apache/flink

writeEnv.getConfig().setRestartStrategy(RestartStrategies.noRestart());
writeEnv.getConfig().disableSysoutLogging();
origin: apache/flink

env.setParallelism(parallelism);
env.enableCheckpointing(1000);
env.getConfig().setRestartStrategy(RestartStrategies.fixedDelayRestart(210, 0));
origin: apache/flink

see.setParallelism(1);
see.getConfig().setRestartStrategy(RestartStrategies.noRestart());
see.setStateBackend(new FailingStateBackend());
origin: apache/flink

@Override
public void testProgram(StreamExecutionEnvironment env) {
  // set the restart strategy.
  env.getConfig().setRestartStrategy(RestartStrategies.fixedDelayRestart(NO_OF_RETRIES, 0));
  env.enableCheckpointing(10);
  // create and start the file creating thread.
  fc = new FileCreator();
  fc.start();
  // create the monitoring source along with the necessary readers.
  TextInputFormat format = new TextInputFormat(new org.apache.flink.core.fs.Path(localFsURI));
  format.setFilesFilter(FilePathFilter.createDefaultFilter());
  DataStream<String> inputStream = env.readFile(format, localFsURI,
    FileProcessingMode.PROCESS_CONTINUOUSLY, INTERVAL);
  TestingSinkFunction sink = new TestingSinkFunction();
  inputStream.flatMap(new FlatMapFunction<String, String>() {
    @Override
    public void flatMap(String value, Collector<String> out) throws Exception {
      out.collect(value);
    }
  }).addSink(sink).setParallelism(1);
}
origin: apache/flink

/**
 * Creates a streaming JobGraph from the StreamEnvironment.
 */
private JobGraph createJobGraph(
  int parallelism,
  int numberOfRetries,
  long restartDelay) {
  StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
  env.setParallelism(parallelism);
  env.disableOperatorChaining();
  env.getConfig().setRestartStrategy(RestartStrategies.fixedDelayRestart(numberOfRetries, restartDelay));
  env.getConfig().disableSysoutLogging();
  DataStream<Integer> stream = env
    .addSource(new InfiniteTestSource())
    .shuffle()
    .map(new StatefulCounter());
  stream.addSink(new DiscardingSink<>());
  return env.getStreamGraph().getJobGraph();
}
origin: org.apache.flink/flink-java

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: com.alibaba.blink/flink-java

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: DTStack/flinkx

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: org.apache.flink/flink-streaming-java_2.10

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: org.apache.flink/flink-streaming-java

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: org.apache.flink/flink-streaming-java_2.11

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
origin: DTStack/flinkx

/**
 * Sets the restart strategy configuration. The configuration specifies which restart strategy
 * will be used for the execution graph in case of a restart.
 *
 * @param restartStrategyConfiguration Restart strategy configuration to be set
 */
@PublicEvolving
public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
  config.setRestartStrategy(restartStrategyConfiguration);
}
org.apache.flink.api.commonExecutionConfigsetRestartStrategy

Javadoc

Sets the restart strategy to be used for recovery.
 
ExecutionConfig config = env.getConfig();

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,
  • getParallelism,
  • addDefaultKryoSerializer,
  • getGlobalJobParameters,
  • getNumberOfExecutionRetries,
  • getRegisteredKryoTypes,
  • setParallelism,
  • getDefaultKryoSerializerClasses

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JPanel (javax.swing)
  • Top 12 Jupyter Notebook Extensions
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