Java Code Examples for org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices#setCheckpointRecoveryFactory()

The following examples show how to use org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices#setCheckpointRecoveryFactory() . 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: JobMasterTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() throws IOException {
	configuration = new Configuration();
	haServices = new TestingHighAvailabilityServices();
	jobMasterId = JobMasterId.generate();
	jmResourceId = ResourceID.generate();

	testingFatalErrorHandler = new TestingFatalErrorHandler();

	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	rmLeaderRetrievalService = new SettableLeaderRetrievalService(
		null,
		null);
	haServices.setResourceManagerLeaderRetriever(rmLeaderRetrievalService);

	configuration.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
}
 
Example 2
Source File: JobMasterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() throws IOException {
	configuration = new Configuration();
	haServices = new TestingHighAvailabilityServices();
	jobMasterId = JobMasterId.generate();
	jmResourceId = ResourceID.generate();

	testingFatalErrorHandler = new TestingFatalErrorHandler();

	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	rmLeaderRetrievalService = new SettableLeaderRetrievalService(
		null,
		null);
	haServices.setResourceManagerLeaderRetriever(rmLeaderRetrievalService);

	configuration.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
}
 
Example 3
Source File: DispatcherTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
	final JobVertex testVertex = new JobVertex("testVertex");
	testVertex.setInvokableClass(NoOpInvokable.class);
	jobGraph = new JobGraph(TEST_JOB_ID, "testJob", testVertex);

	heartbeatServices = new HeartbeatServices(1000L, 10000L);

	jobMasterLeaderElectionService = new TestingLeaderElectionService();

	haServices = new TestingHighAvailabilityServices();
	haServices.setJobMasterLeaderElectionService(TEST_JOB_ID, jobMasterLeaderElectionService);
	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());
	haServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService());

	configuration = new Configuration();

	configuration.setString(
		BlobServerOptions.STORAGE_DIRECTORY,
		temporaryFolder.newFolder().getAbsolutePath());

	createdJobManagerRunnerLatch = new CountDownLatch(2);
	blobServer = new BlobServer(configuration, new VoidBlobStore());
}
 
Example 4
Source File: JobMasterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() throws IOException {
	configuration = new Configuration();
	haServices = new TestingHighAvailabilityServices();
	jobMasterId = JobMasterId.generate();
	jmResourceId = ResourceID.generate();

	testingFatalErrorHandler = new TestingFatalErrorHandler();

	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	rmLeaderRetrievalService = new SettableLeaderRetrievalService(
		null,
		null);
	haServices.setResourceManagerLeaderRetriever(rmLeaderRetrievalService);

	configuration.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
}
 
Example 5
Source File: DispatcherTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	final JobVertex testVertex = new JobVertex("testVertex");
	testVertex.setInvokableClass(NoOpInvokable.class);
	jobGraph = new JobGraph(TEST_JOB_ID, "testJob", testVertex);
	jobGraph.setAllowQueuedScheduling(true);

	fatalErrorHandler = new TestingFatalErrorHandler();
	heartbeatServices = new HeartbeatServices(1000L, 10000L);
	submittedJobGraphStore = new FaultySubmittedJobGraphStore();

	dispatcherLeaderElectionService = new TestingLeaderElectionService();
	jobMasterLeaderElectionService = new TestingLeaderElectionService();

	haServices = new TestingHighAvailabilityServices();
	haServices.setDispatcherLeaderElectionService(dispatcherLeaderElectionService);
	haServices.setSubmittedJobGraphStore(submittedJobGraphStore);
	haServices.setJobMasterLeaderElectionService(TEST_JOB_ID, jobMasterLeaderElectionService);
	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());
	haServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService());
	runningJobsRegistry = haServices.getRunningJobsRegistry();

	configuration = new Configuration();

	configuration.setString(
		BlobServerOptions.STORAGE_DIRECTORY,
		temporaryFolder.newFolder().getAbsolutePath());

	createdJobManagerRunnerLatch = new CountDownLatch(2);
	blobServer = new BlobServer(configuration, new VoidBlobStore());
}
 
Example 6
Source File: JobManagerRunnerTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
	leaderElectionService = new TestingLeaderElectionService();
	haServices = new TestingHighAvailabilityServices();
	haServices.setJobMasterLeaderElectionService(jobGraph.getJobID(), leaderElectionService);
	haServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService());
	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	fatalErrorHandler = new TestingFatalErrorHandler();
}
 
Example 7
Source File: DispatcherTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	final JobVertex testVertex = new JobVertex("testVertex");
	testVertex.setInvokableClass(NoOpInvokable.class);
	jobGraph = new JobGraph(TEST_JOB_ID, "testJob", testVertex);
	jobGraph.setAllowQueuedScheduling(true);

	fatalErrorHandler = new TestingFatalErrorHandler();
	heartbeatServices = new HeartbeatServices(1000L, 10000L);
	submittedJobGraphStore = new FaultySubmittedJobGraphStore();

	dispatcherLeaderElectionService = new TestingLeaderElectionService();
	jobMasterLeaderElectionService = new TestingLeaderElectionService();

	haServices = new TestingHighAvailabilityServices();
	haServices.setDispatcherLeaderElectionService(dispatcherLeaderElectionService);
	haServices.setSubmittedJobGraphStore(submittedJobGraphStore);
	haServices.setJobMasterLeaderElectionService(TEST_JOB_ID, jobMasterLeaderElectionService);
	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());
	haServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService());
	runningJobsRegistry = haServices.getRunningJobsRegistry();

	configuration = new Configuration();

	configuration.setString(
		BlobServerOptions.STORAGE_DIRECTORY,
		temporaryFolder.newFolder().getAbsolutePath());

	createdJobManagerRunnerLatch = new CountDownLatch(2);
	blobServer = new BlobServer(configuration, new VoidBlobStore());
}
 
Example 8
Source File: JobManagerRunnerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
	leaderElectionService = new TestingLeaderElectionService();
	haServices = new TestingHighAvailabilityServices();
	haServices.setJobMasterLeaderElectionService(jobGraph.getJobID(), leaderElectionService);
	haServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService());
	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	fatalErrorHandler = new TestingFatalErrorHandler();
}
 
Example 9
Source File: JobManagerRunnerImplTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
	leaderElectionService = new TestingLeaderElectionService();
	haServices = new TestingHighAvailabilityServices();
	haServices.setJobMasterLeaderElectionService(jobGraph.getJobID(), leaderElectionService);
	haServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService());
	haServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	fatalErrorHandler = new TestingFatalErrorHandler();
}
 
Example 10
Source File: JobMasterBuilder.java    From flink with Apache License 2.0 5 votes vote down vote up
public JobMasterBuilder(JobGraph jobGraph, RpcService rpcService) {
	TestingHighAvailabilityServices testingHighAvailabilityServices = new TestingHighAvailabilityServices();
	testingHighAvailabilityServices.setCheckpointRecoveryFactory(new StandaloneCheckpointRecoveryFactory());

	SettableLeaderRetrievalService rmLeaderRetrievalService = new SettableLeaderRetrievalService(
		null,
		null);
	testingHighAvailabilityServices.setResourceManagerLeaderRetriever(rmLeaderRetrievalService);

	this.highAvailabilityServices = testingHighAvailabilityServices;
	this.jobGraph = jobGraph;
	this.rpcService = rpcService;
}