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

  • Start an intent from android
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top plugins for WebStorm
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