org.apache.flink.runtime.checkpoint.CheckpointStatsTracker Java Examples
The following examples show how to use
org.apache.flink.runtime.checkpoint.CheckpointStatsTracker.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FailoverRegionTest.java From flink with Apache License 2.0 | 6 votes |
private static void enableCheckpointing(ExecutionGraph eg) { ArrayList<ExecutionJobVertex> jobVertices = new ArrayList<>(eg.getAllVertices().values()); CheckpointCoordinatorConfiguration chkConfig = new CheckpointCoordinatorConfiguration( 1000, 100, 0, 1, CheckpointRetentionPolicy.RETAIN_ON_CANCELLATION, true, false, 0); eg.enableCheckpointing( chkConfig, jobVertices, jobVertices, jobVertices, Collections.emptyList(), new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), new MemoryStateBackend(), new CheckpointStatsTracker( 0, jobVertices, mock(CheckpointCoordinatorConfiguration.class), new UnregisteredMetricsGroup())); }
Example #2
Source File: AdaptedRestartPipelinedRegionStrategyNGAbortPendingCheckpointsTest.java From flink with Apache License 2.0 | 5 votes |
private static void enableCheckpointing(final ExecutionGraph executionGraph) { final List<ExecutionJobVertex> jobVertices = new ArrayList<>(executionGraph.getAllVertices().values()); final CheckpointCoordinatorConfiguration checkpointCoordinatorConfiguration = new CheckpointCoordinatorConfiguration( Long.MAX_VALUE, Long.MAX_VALUE, 0, 1, CheckpointRetentionPolicy.RETAIN_ON_CANCELLATION, true, false, 0); executionGraph.enableCheckpointing( checkpointCoordinatorConfiguration, jobVertices, jobVertices, jobVertices, Collections.emptyList(), new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), new MemoryStateBackend(), new CheckpointStatsTracker( 0, jobVertices, checkpointCoordinatorConfiguration, new UnregisteredMetricsGroup())); }
Example #3
Source File: ArchivedExecutionGraphTest.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@BeforeClass public static void setupExecutionGraph() throws Exception { // ------------------------------------------------------------------------------------------------------------- // Setup // ------------------------------------------------------------------------------------------------------------- JobVertexID v1ID = new JobVertexID(); JobVertexID v2ID = new JobVertexID(); JobVertex v1 = new JobVertex("v1", v1ID); JobVertex v2 = new JobVertex("v2", v2ID); v1.setParallelism(1); v2.setParallelism(2); v1.setInvokableClass(AbstractInvokable.class); v2.setInvokableClass(AbstractInvokable.class); List<JobVertex> vertices = new ArrayList<>(Arrays.asList(v1, v2)); ExecutionConfig config = new ExecutionConfig(); config.setExecutionMode(ExecutionMode.BATCH_FORCED); config.setRestartStrategy(new RestartStrategies.NoRestartStrategyConfiguration()); config.setParallelism(4); config.enableObjectReuse(); config.setGlobalJobParameters(new TestJobParameters()); runtimeGraph = new ExecutionGraph( TestingUtils.defaultExecutor(), TestingUtils.defaultExecutor(), new JobID(), "test job", new Configuration(), new SerializedValue<>(config), AkkaUtils.getDefaultTimeout(), new NoRestartStrategy(), mock(SlotProvider.class)); runtimeGraph.start(TestingComponentMainThreadExecutorServiceAdapter.forMainThread()); runtimeGraph.attachJobGraph(vertices); List<ExecutionJobVertex> jobVertices = new ArrayList<>(); jobVertices.add(runtimeGraph.getJobVertex(v1ID)); jobVertices.add(runtimeGraph.getJobVertex(v2ID)); CheckpointStatsTracker statsTracker = new CheckpointStatsTracker( 0, jobVertices, mock(CheckpointCoordinatorConfiguration.class), new UnregisteredMetricsGroup()); runtimeGraph.enableCheckpointing( 100, 100, 100, 1, CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION, Collections.<ExecutionJobVertex>emptyList(), Collections.<ExecutionJobVertex>emptyList(), Collections.<ExecutionJobVertex>emptyList(), Collections.<MasterTriggerRestoreHook<?>>emptyList(), new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), new MemoryStateBackend(), statsTracker); runtimeGraph.setJsonPlan("{}"); runtimeGraph.getJobVertex(v2ID).getTaskVertices()[0].getCurrentExecutionAttempt().fail(new RuntimeException("This exception was thrown on purpose.")); }
Example #4
Source File: ArchivedExecutionGraphTest.java From flink with Apache License 2.0 | 4 votes |
@BeforeClass public static void setupExecutionGraph() throws Exception { // ------------------------------------------------------------------------------------------------------------- // Setup // ------------------------------------------------------------------------------------------------------------- JobVertexID v1ID = new JobVertexID(); JobVertexID v2ID = new JobVertexID(); JobVertex v1 = new JobVertex("v1", v1ID); JobVertex v2 = new JobVertex("v2", v2ID); v1.setParallelism(1); v2.setParallelism(2); v1.setInvokableClass(AbstractInvokable.class); v2.setInvokableClass(AbstractInvokable.class); List<JobVertex> vertices = new ArrayList<>(Arrays.asList(v1, v2)); ExecutionConfig config = new ExecutionConfig(); config.setExecutionMode(ExecutionMode.BATCH_FORCED); config.setRestartStrategy(new RestartStrategies.NoRestartStrategyConfiguration()); config.setParallelism(4); config.enableObjectReuse(); config.setGlobalJobParameters(new TestJobParameters()); runtimeGraph = new ExecutionGraph( TestingUtils.defaultExecutor(), TestingUtils.defaultExecutor(), new JobID(), "test job", new Configuration(), new SerializedValue<>(config), AkkaUtils.getDefaultTimeout(), new NoRestartStrategy(), mock(SlotProvider.class)); runtimeGraph.start(ComponentMainThreadExecutorServiceAdapter.forMainThread()); runtimeGraph.attachJobGraph(vertices); List<ExecutionJobVertex> jobVertices = new ArrayList<>(); jobVertices.add(runtimeGraph.getJobVertex(v1ID)); jobVertices.add(runtimeGraph.getJobVertex(v2ID)); CheckpointStatsTracker statsTracker = new CheckpointStatsTracker( 0, jobVertices, mock(CheckpointCoordinatorConfiguration.class), new UnregisteredMetricsGroup()); CheckpointCoordinatorConfiguration chkConfig = new CheckpointCoordinatorConfiguration( 100, 100, 100, 1, CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION, true, false, 0); runtimeGraph.enableCheckpointing( chkConfig, Collections.<ExecutionJobVertex>emptyList(), Collections.<ExecutionJobVertex>emptyList(), Collections.<ExecutionJobVertex>emptyList(), Collections.<MasterTriggerRestoreHook<?>>emptyList(), new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), new MemoryStateBackend(), statsTracker); runtimeGraph.setJsonPlan("{}"); runtimeGraph.getJobVertex(v2ID).getTaskVertices()[0].getCurrentExecutionAttempt().fail(new RuntimeException("This exception was thrown on purpose.")); }
Example #5
Source File: ArchivedExecutionGraphTest.java From flink with Apache License 2.0 | 4 votes |
@BeforeClass public static void setupExecutionGraph() throws Exception { // ------------------------------------------------------------------------------------------------------------- // Setup // ------------------------------------------------------------------------------------------------------------- JobVertexID v1ID = new JobVertexID(); JobVertexID v2ID = new JobVertexID(); JobVertex v1 = new JobVertex("v1", v1ID); JobVertex v2 = new JobVertex("v2", v2ID); v1.setParallelism(1); v2.setParallelism(2); v1.setInvokableClass(AbstractInvokable.class); v2.setInvokableClass(AbstractInvokable.class); JobGraph jobGraph = new JobGraph(v1, v2); ExecutionConfig config = new ExecutionConfig(); config.setExecutionMode(ExecutionMode.BATCH_FORCED); config.setRestartStrategy(new RestartStrategies.NoRestartStrategyConfiguration()); config.setParallelism(4); config.enableObjectReuse(); config.setGlobalJobParameters(new TestJobParameters()); jobGraph.setExecutionConfig(config); runtimeGraph = TestingExecutionGraphBuilder .newBuilder() .setJobGraph(jobGraph) .build(); runtimeGraph.start(ComponentMainThreadExecutorServiceAdapter.forMainThread()); List<ExecutionJobVertex> jobVertices = new ArrayList<>(); jobVertices.add(runtimeGraph.getJobVertex(v1ID)); jobVertices.add(runtimeGraph.getJobVertex(v2ID)); CheckpointStatsTracker statsTracker = new CheckpointStatsTracker( 0, jobVertices, mock(CheckpointCoordinatorConfiguration.class), new UnregisteredMetricsGroup()); CheckpointCoordinatorConfiguration chkConfig = new CheckpointCoordinatorConfiguration( 100, 100, 100, 1, CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION, true, false, false, 0); runtimeGraph.enableCheckpointing( chkConfig, Collections.<ExecutionJobVertex>emptyList(), Collections.<ExecutionJobVertex>emptyList(), Collections.<ExecutionJobVertex>emptyList(), Collections.<MasterTriggerRestoreHook<?>>emptyList(), new StandaloneCheckpointIDCounter(), new StandaloneCompletedCheckpointStore(1), new MemoryStateBackend(), statsTracker); runtimeGraph.setJsonPlan("{}"); runtimeGraph.getJobVertex(v2ID).getTaskVertices()[0].getCurrentExecutionAttempt().fail(new RuntimeException("This exception was thrown on purpose.")); }