org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory Java Examples

The following examples show how to use org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory. 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: SchedulerNGFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
SchedulerNG createInstance(
Logger log,
JobGraph jobGraph,
BackPressureStatsTracker backPressureStatsTracker,
Executor ioExecutor,
Configuration jobMasterConfiguration,
SlotProvider slotProvider,
ScheduledExecutorService futureExecutor,
ClassLoader userCodeLoader,
CheckpointRecoveryFactory checkpointRecoveryFactory,
Time rpcTimeout,
BlobWriter blobWriter,
JobManagerJobMetricGroup jobManagerJobMetricGroup,
Time slotRequestTimeout,
ShuffleMaster<?> shuffleMaster,
PartitionTracker partitionTracker) throws Exception;
 
Example #2
Source File: SchedulerNGFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
SchedulerNG createInstance(
Logger log,
JobGraph jobGraph,
BackPressureStatsTracker backPressureStatsTracker,
Executor ioExecutor,
Configuration jobMasterConfiguration,
SlotProvider slotProvider,
ScheduledExecutorService futureExecutor,
ClassLoader userCodeLoader,
CheckpointRecoveryFactory checkpointRecoveryFactory,
Time rpcTimeout,
BlobWriter blobWriter,
JobManagerJobMetricGroup jobManagerJobMetricGroup,
Time slotRequestTimeout,
ShuffleMaster<?> shuffleMaster,
JobMasterPartitionTracker partitionTracker) throws Exception;
 
Example #3
Source File: ExecutionGraphBuilder.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Builds the ExecutionGraph from the JobGraph.
 * If a prior execution graph exists, the JobGraph will be attached. If no prior execution
 * graph exists, then the JobGraph will become attach to a new empty execution graph.
 */
public static ExecutionGraph buildGraph(
		@Nullable ExecutionGraph prior,
		JobGraph jobGraph,
		Configuration jobManagerConfig,
		ScheduledExecutorService futureExecutor,
		Executor ioExecutor,
		SlotProvider slotProvider,
		ClassLoader classLoader,
		CheckpointRecoveryFactory recoveryFactory,
		Time rpcTimeout,
		RestartStrategy restartStrategy,
		MetricGroup metrics,
		BlobWriter blobWriter,
		Time allocationTimeout,
		Logger log)
	throws JobExecutionException, JobException {

	return buildGraph(
		prior,
		jobGraph,
		jobManagerConfig,
		futureExecutor,
		ioExecutor,
		slotProvider,
		classLoader,
		recoveryFactory,
		rpcTimeout,
		restartStrategy,
		metrics,
		-1,
		blobWriter,
		allocationTimeout,
		log);
}
 
Example #4
Source File: AbstractNonHaServices.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	synchronized (lock) {
		checkNotShutdown();

		return new StandaloneCheckpointRecoveryFactory();
	}
}
 
Example #5
Source File: AbstractNonHaServices.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	synchronized (lock) {
		checkNotShutdown();

		return new StandaloneCheckpointRecoveryFactory();
	}
}
 
Example #6
Source File: DefaultSchedulerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public SchedulerNG createInstance(
		final Logger log,
		final JobGraph jobGraph,
		final BackPressureStatsTracker backPressureStatsTracker,
		final Executor ioExecutor,
		final Configuration jobMasterConfiguration,
		final SlotProvider slotProvider,
		final ScheduledExecutorService futureExecutor,
		final ClassLoader userCodeLoader,
		final CheckpointRecoveryFactory checkpointRecoveryFactory,
		final Time rpcTimeout,
		final BlobWriter blobWriter,
		final JobManagerJobMetricGroup jobManagerJobMetricGroup,
		final Time slotRequestTimeout,
		final ShuffleMaster<?> shuffleMaster,
		final PartitionTracker partitionTracker) throws Exception {

	return new DefaultScheduler(
		log,
		jobGraph,
		backPressureStatsTracker,
		ioExecutor,
		jobMasterConfiguration,
		slotProvider,
		futureExecutor,
		userCodeLoader,
		checkpointRecoveryFactory,
		rpcTimeout,
		blobWriter,
		jobManagerJobMetricGroup,
		slotRequestTimeout,
		shuffleMaster,
		partitionTracker);
}
 
Example #7
Source File: TestingHighAvailabilityServices.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	CheckpointRecoveryFactory factory = checkpointRecoveryFactory;

	if (factory != null) {
		return factory;
	} else {
		throw new IllegalStateException("CheckpointRecoveryFactory has not been set");
	}
}
 
Example #8
Source File: DefaultScheduler.java    From flink with Apache License 2.0 5 votes vote down vote up
public DefaultScheduler(
		final Logger log,
		final JobGraph jobGraph,
		final BackPressureStatsTracker backPressureStatsTracker,
		final Executor ioExecutor,
		final Configuration jobMasterConfiguration,
		final SlotProvider slotProvider,
		final ScheduledExecutorService futureExecutor,
		final ClassLoader userCodeLoader,
		final CheckpointRecoveryFactory checkpointRecoveryFactory,
		final Time rpcTimeout,
		final BlobWriter blobWriter,
		final JobManagerJobMetricGroup jobManagerJobMetricGroup,
		final Time slotRequestTimeout,
		final ShuffleMaster<?> shuffleMaster,
		final PartitionTracker partitionTracker) throws Exception {

	super(
		log,
		jobGraph,
		backPressureStatsTracker,
		ioExecutor,
		jobMasterConfiguration,
		slotProvider,
		futureExecutor,
		userCodeLoader,
		checkpointRecoveryFactory,
		rpcTimeout,
		new ThrowingRestartStrategy.ThrowingRestartStrategyFactory(),
		blobWriter,
		jobManagerJobMetricGroup,
		slotRequestTimeout,
		shuffleMaster,
		partitionTracker);
}
 
Example #9
Source File: LegacySchedulerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public SchedulerNG createInstance(
		final Logger log,
		final JobGraph jobGraph,
		final BackPressureStatsTracker backPressureStatsTracker,
		final Executor ioExecutor,
		final Configuration jobMasterConfiguration,
		final SlotProvider slotProvider,
		final ScheduledExecutorService futureExecutor,
		final ClassLoader userCodeLoader,
		final CheckpointRecoveryFactory checkpointRecoveryFactory,
		final Time rpcTimeout,
		final BlobWriter blobWriter,
		final JobManagerJobMetricGroup jobManagerJobMetricGroup,
		final Time slotRequestTimeout,
		final ShuffleMaster<?> shuffleMaster,
		final PartitionTracker partitionTracker) throws Exception {

	return new LegacyScheduler(
		log,
		jobGraph,
		backPressureStatsTracker,
		ioExecutor,
		jobMasterConfiguration,
		slotProvider,
		futureExecutor,
		userCodeLoader,
		checkpointRecoveryFactory,
		rpcTimeout,
		restartStrategyFactory,
		blobWriter,
		jobManagerJobMetricGroup,
		slotRequestTimeout,
		shuffleMaster,
		partitionTracker);
}
 
Example #10
Source File: AbstractYarnNonHaServices.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	enter();
	try {
		return new StandaloneCheckpointRecoveryFactory();
	}
	finally {
		exit();
	}
}
 
Example #11
Source File: TestingHighAvailabilityServices.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	CheckpointRecoveryFactory factory = checkpointRecoveryFactory;

	if (factory != null) {
		return factory;
	} else {
		throw new IllegalStateException("CheckpointRecoveryFactory has not been set");
	}
}
 
Example #12
Source File: TestingHighAvailabilityServices.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	CheckpointRecoveryFactory factory = checkpointRecoveryFactory;

	if (factory != null) {
		return factory;
	} else {
		throw new IllegalStateException("CheckpointRecoveryFactory has not been set");
	}
}
 
Example #13
Source File: AbstractNonHaServices.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	synchronized (lock) {
		checkNotShutdown();

		return new StandaloneCheckpointRecoveryFactory();
	}
}
 
Example #14
Source File: AbstractYarnNonHaServices.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	enter();
	try {
		return new StandaloneCheckpointRecoveryFactory();
	}
	finally {
		exit();
	}
}
 
Example #15
Source File: RegionFailoverITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	return checkpointRecoveryFactory;
}
 
Example #16
Source File: TestingHighAvailabilityServicesBuilder.java    From flink with Apache License 2.0 4 votes vote down vote up
public TestingHighAvailabilityServicesBuilder setCheckpointRecoveryFactory(CheckpointRecoveryFactory checkpointRecoveryFactory) {
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
	return this;
}
 
Example #17
Source File: DefaultScheduler.java    From flink with Apache License 2.0 4 votes vote down vote up
DefaultScheduler(
	final Logger log,
	final JobGraph jobGraph,
	final BackPressureStatsTracker backPressureStatsTracker,
	final Executor ioExecutor,
	final Configuration jobMasterConfiguration,
	final ScheduledExecutorService futureExecutor,
	final ScheduledExecutor delayExecutor,
	final ClassLoader userCodeLoader,
	final CheckpointRecoveryFactory checkpointRecoveryFactory,
	final Time rpcTimeout,
	final BlobWriter blobWriter,
	final JobManagerJobMetricGroup jobManagerJobMetricGroup,
	final ShuffleMaster<?> shuffleMaster,
	final JobMasterPartitionTracker partitionTracker,
	final SchedulingStrategyFactory schedulingStrategyFactory,
	final FailoverStrategy.Factory failoverStrategyFactory,
	final RestartBackoffTimeStrategy restartBackoffTimeStrategy,
	final ExecutionVertexOperations executionVertexOperations,
	final ExecutionVertexVersioner executionVertexVersioner,
	final ExecutionSlotAllocatorFactory executionSlotAllocatorFactory) throws Exception {

	super(
		log,
		jobGraph,
		backPressureStatsTracker,
		ioExecutor,
		jobMasterConfiguration,
		new ThrowingSlotProvider(), // this is not used any more in the new scheduler
		futureExecutor,
		userCodeLoader,
		checkpointRecoveryFactory,
		rpcTimeout,
		new ThrowingRestartStrategy.ThrowingRestartStrategyFactory(),
		blobWriter,
		jobManagerJobMetricGroup,
		Time.seconds(0), // this is not used any more in the new scheduler
		shuffleMaster,
		partitionTracker,
		executionVertexVersioner,
		false);

	this.log = log;

	this.delayExecutor = checkNotNull(delayExecutor);
	this.userCodeLoader = checkNotNull(userCodeLoader);
	this.executionVertexOperations = checkNotNull(executionVertexOperations);

	final FailoverStrategy failoverStrategy = failoverStrategyFactory.create(
		getSchedulingTopology(),
		getResultPartitionAvailabilityChecker());
	log.info("Using failover strategy {} for {} ({}).", failoverStrategy, jobGraph.getName(), jobGraph.getJobID());

	this.executionFailureHandler = new ExecutionFailureHandler(
		getSchedulingTopology(),
		failoverStrategy,
		restartBackoffTimeStrategy);
	this.schedulingStrategy = schedulingStrategyFactory.createInstance(this, getSchedulingTopology());
	this.executionSlotAllocator = checkNotNull(executionSlotAllocatorFactory).createInstance(getPreferredLocationsRetriever());

	this.verticesWaitingForRestart = new HashSet<>();
}
 
Example #18
Source File: RegionFailoverITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
TestingHaServices(CheckpointRecoveryFactory checkpointRecoveryFactory, Executor executor) {
	super(executor);
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
}
 
Example #19
Source File: SchedulerBase.java    From flink with Apache License 2.0 4 votes vote down vote up
public SchedulerBase(
	final Logger log,
	final JobGraph jobGraph,
	final BackPressureStatsTracker backPressureStatsTracker,
	final Executor ioExecutor,
	final Configuration jobMasterConfiguration,
	final SlotProvider slotProvider,
	final ScheduledExecutorService futureExecutor,
	final ClassLoader userCodeLoader,
	final CheckpointRecoveryFactory checkpointRecoveryFactory,
	final Time rpcTimeout,
	final RestartStrategyFactory restartStrategyFactory,
	final BlobWriter blobWriter,
	final JobManagerJobMetricGroup jobManagerJobMetricGroup,
	final Time slotRequestTimeout,
	final ShuffleMaster<?> shuffleMaster,
	final JobMasterPartitionTracker partitionTracker,
	final ExecutionVertexVersioner executionVertexVersioner,
	final boolean legacyScheduling) throws Exception {

	this.log = checkNotNull(log);
	this.jobGraph = checkNotNull(jobGraph);
	this.backPressureStatsTracker = checkNotNull(backPressureStatsTracker);
	this.ioExecutor = checkNotNull(ioExecutor);
	this.jobMasterConfiguration = checkNotNull(jobMasterConfiguration);
	this.slotProvider = checkNotNull(slotProvider);
	this.futureExecutor = checkNotNull(futureExecutor);
	this.userCodeLoader = checkNotNull(userCodeLoader);
	this.checkpointRecoveryFactory = checkNotNull(checkpointRecoveryFactory);
	this.rpcTimeout = checkNotNull(rpcTimeout);

	final RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration =
		jobGraph.getSerializedExecutionConfig()
			.deserializeValue(userCodeLoader)
			.getRestartStrategy();

	this.restartStrategy = RestartStrategyResolving.resolve(restartStrategyConfiguration,
		restartStrategyFactory,
		jobGraph.isCheckpointingEnabled());

	if (legacyScheduling) {
		log.info("Using restart strategy {} for {} ({}).", this.restartStrategy, jobGraph.getName(), jobGraph.getJobID());
	}

	this.blobWriter = checkNotNull(blobWriter);
	this.jobManagerJobMetricGroup = checkNotNull(jobManagerJobMetricGroup);
	this.slotRequestTimeout = checkNotNull(slotRequestTimeout);
	this.executionVertexVersioner = checkNotNull(executionVertexVersioner);
	this.legacyScheduling = legacyScheduling;

	this.executionGraph = createAndRestoreExecutionGraph(jobManagerJobMetricGroup, checkNotNull(shuffleMaster), checkNotNull(partitionTracker));
	this.schedulingTopology = executionGraph.getSchedulingTopology();

	final StateLocationRetriever stateLocationRetriever =
		executionVertexId -> getExecutionVertex(executionVertexId).getPreferredLocationBasedOnState();
	final InputsLocationsRetriever inputsLocationsRetriever = new ExecutionGraphToInputsLocationsRetrieverAdapter(executionGraph);
	this.preferredLocationsRetriever = new DefaultPreferredLocationsRetriever(stateLocationRetriever, inputsLocationsRetriever);

	this.coordinatorMap = createCoordinatorMap();
}
 
Example #20
Source File: DefaultSchedulerFactory.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public SchedulerNG createInstance(
		final Logger log,
		final JobGraph jobGraph,
		final BackPressureStatsTracker backPressureStatsTracker,
		final Executor ioExecutor,
		final Configuration jobMasterConfiguration,
		final SlotProvider slotProvider,
		final ScheduledExecutorService futureExecutor,
		final ClassLoader userCodeLoader,
		final CheckpointRecoveryFactory checkpointRecoveryFactory,
		final Time rpcTimeout,
		final BlobWriter blobWriter,
		final JobManagerJobMetricGroup jobManagerJobMetricGroup,
		final Time slotRequestTimeout,
		final ShuffleMaster<?> shuffleMaster,
		final JobMasterPartitionTracker partitionTracker) throws Exception {

	final SchedulingStrategyFactory schedulingStrategyFactory = createSchedulingStrategyFactory(jobGraph.getScheduleMode());
	final RestartBackoffTimeStrategy restartBackoffTimeStrategy = RestartBackoffTimeStrategyFactoryLoader
		.createRestartBackoffTimeStrategyFactory(
			jobGraph
				.getSerializedExecutionConfig()
				.deserializeValue(userCodeLoader)
				.getRestartStrategy(),
			jobMasterConfiguration,
			jobGraph.isCheckpointingEnabled())
		.create();
	log.info("Using restart back off time strategy {} for {} ({}).", restartBackoffTimeStrategy, jobGraph.getName(), jobGraph.getJobID());

	final ExecutionSlotAllocatorFactory slotAllocatorFactory =
		createExecutionSlotAllocatorFactory(
			jobGraph.getScheduleMode(),
			slotProvider,
			slotRequestTimeout,
			schedulingStrategyFactory);

	return new DefaultScheduler(
		log,
		jobGraph,
		backPressureStatsTracker,
		ioExecutor,
		jobMasterConfiguration,
		futureExecutor,
		new ScheduledExecutorServiceAdapter(futureExecutor),
		userCodeLoader,
		checkpointRecoveryFactory,
		rpcTimeout,
		blobWriter,
		jobManagerJobMetricGroup,
		shuffleMaster,
		partitionTracker,
		schedulingStrategyFactory,
		FailoverStrategyFactoryLoader.loadFailoverStrategyFactory(jobMasterConfiguration),
		restartBackoffTimeStrategy,
		new DefaultExecutionVertexOperations(),
		new ExecutionVertexVersioner(),
		slotAllocatorFactory);
}
 
Example #21
Source File: ExecutionGraphBuilder.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Builds the ExecutionGraph from the JobGraph.
 * If a prior execution graph exists, the JobGraph will be attached. If no prior execution
 * graph exists, then the JobGraph will become attach to a new empty execution graph.
 */
public static ExecutionGraph buildGraph(
		@Nullable ExecutionGraph prior,
		JobGraph jobGraph,
		Configuration jobManagerConfig,
		ScheduledExecutorService futureExecutor,
		Executor ioExecutor,
		SlotProvider slotProvider,
		ClassLoader classLoader,
		CheckpointRecoveryFactory recoveryFactory,
		Time rpcTimeout,
		RestartStrategy restartStrategy,
		MetricGroup metrics,
		BlobWriter blobWriter,
		Time allocationTimeout,
		Logger log,
		ShuffleMaster<?> shuffleMaster,
		JobMasterPartitionTracker partitionTracker) throws JobExecutionException, JobException {

	final FailoverStrategy.Factory failoverStrategy =
		FailoverStrategyLoader.loadFailoverStrategy(jobManagerConfig, log);

	return buildGraph(
		prior,
		jobGraph,
		jobManagerConfig,
		futureExecutor,
		ioExecutor,
		slotProvider,
		classLoader,
		recoveryFactory,
		rpcTimeout,
		restartStrategy,
		metrics,
		blobWriter,
		allocationTimeout,
		log,
		shuffleMaster,
		partitionTracker,
		failoverStrategy);
}
 
Example #22
Source File: ZooKeeperHaServices.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	return new ZooKeeperCheckpointRecoveryFactory(client, configuration, executor);
}
 
Example #23
Source File: SchedulerTestingUtils.java    From flink with Apache License 2.0 4 votes vote down vote up
public DefaultSchedulerBuilder setCheckpointRecoveryFactory(final CheckpointRecoveryFactory checkpointRecoveryFactory) {
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
	return this;
}
 
Example #24
Source File: TestingExecutionGraphBuilder.java    From flink with Apache License 2.0 4 votes vote down vote up
public TestingExecutionGraphBuilder setCheckpointRecoveryFactory(CheckpointRecoveryFactory checkpointRecoveryFactory) {
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
	return this;
}
 
Example #25
Source File: TestingManualHighAvailabilityServices.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	return new StandaloneCheckpointRecoveryFactory();
}
 
Example #26
Source File: TestingHighAvailabilityServices.java    From flink with Apache License 2.0 4 votes vote down vote up
public void setCheckpointRecoveryFactory(CheckpointRecoveryFactory checkpointRecoveryFactory) {
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
}
 
Example #27
Source File: NotifyCheckpointAbortedITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public CheckpointRecoveryFactory getCheckpointRecoveryFactory() {
	return checkpointRecoveryFactory;
}
 
Example #28
Source File: NotifyCheckpointAbortedITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
TestingHaServices(CheckpointRecoveryFactory checkpointRecoveryFactory, Executor executor) {
	super(executor);
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
}
 
Example #29
Source File: TestingHighAvailabilityServicesBuilder.java    From flink with Apache License 2.0 4 votes vote down vote up
public TestingHighAvailabilityServicesBuilder setCheckpointRecoveryFactory(CheckpointRecoveryFactory checkpointRecoveryFactory) {
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
	return this;
}
 
Example #30
Source File: TestingHighAvailabilityServices.java    From flink with Apache License 2.0 4 votes vote down vote up
public void setCheckpointRecoveryFactory(CheckpointRecoveryFactory checkpointRecoveryFactory) {
	this.checkpointRecoveryFactory = checkpointRecoveryFactory;
}