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

The following examples show how to use org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices#setResourceManagerLeaderRetriever() . 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: TaskExecutorTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() throws IOException {
	rpc = new TestingRpcService();
	timerService = new TimerService<>(TestingUtils.defaultExecutor(), timeout.toMilliseconds());

	dummyBlobCacheService = new BlobCacheService(
		new Configuration(),
		new VoidBlobStore(),
		null);

	configuration = new Configuration();
	taskManagerConfiguration = TaskManagerConfiguration.fromConfiguration(configuration);

	taskManagerLocation = new LocalTaskManagerLocation();
	jobId = new JobID();

	testingFatalErrorHandler = new TestingFatalErrorHandler();

	haServices = new TestingHighAvailabilityServices();
	resourceManagerLeaderRetriever = new SettableLeaderRetrievalService();
	jobManagerLeaderRetriever = new SettableLeaderRetrievalService();
	haServices.setResourceManagerLeaderRetriever(resourceManagerLeaderRetriever);
	haServices.setJobMasterLeaderRetriever(jobId, jobManagerLeaderRetriever);
}
 
Example 3
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 4
Source File: TaskExecutorTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() throws IOException {
	rpc = new TestingRpcService();
	timerService = new TimerService<>(TestingUtils.defaultExecutor(), timeout.toMilliseconds());

	dummyBlobCacheService = new BlobCacheService(
		new Configuration(),
		new VoidBlobStore(),
		null);

	configuration = new Configuration();
	taskManagerConfiguration = TaskManagerConfiguration.fromConfiguration(configuration);

	taskManagerLocation = new LocalTaskManagerLocation();
	jobId = new JobID();

	testingFatalErrorHandler = new TestingFatalErrorHandler();

	haServices = new TestingHighAvailabilityServices();
	resourceManagerLeaderRetriever = new SettableLeaderRetrievalService();
	jobManagerLeaderRetriever = new SettableLeaderRetrievalService();
	haServices.setResourceManagerLeaderRetriever(resourceManagerLeaderRetriever);
	haServices.setJobMasterLeaderRetriever(jobId, jobManagerLeaderRetriever);

	nettyShuffleEnvironment = new NettyShuffleEnvironmentBuilder().build();
}
 
Example 5
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 6
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 7
Source File: TaskExecutorTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() throws IOException {
	rpc = new TestingRpcService();

	dummyBlobCacheService = new BlobCacheService(
		new Configuration(),
		new VoidBlobStore(),
		null);

	configuration = new Configuration();

	unresolvedTaskManagerLocation = new LocalUnresolvedTaskManagerLocation();
	jobId = new JobID();

	testingFatalErrorHandler = new TestingFatalErrorHandler();

	haServices = new TestingHighAvailabilityServices();
	resourceManagerLeaderRetriever = new SettableLeaderRetrievalService();
	jobManagerLeaderRetriever = new SettableLeaderRetrievalService();
	haServices.setResourceManagerLeaderRetriever(resourceManagerLeaderRetriever);
	haServices.setJobMasterLeaderRetriever(jobId, jobManagerLeaderRetriever);

	nettyShuffleEnvironment = new NettyShuffleEnvironmentBuilder().build();
}
 
Example 8
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 9
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 10
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 11
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 12
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 13
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;
}