org.apache.flink.runtime.jobmaster.JobMasterRegistrationSuccess Java Examples

The following examples show how to use org.apache.flink.runtime.jobmaster.JobMasterRegistrationSuccess. 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: TestingResourceManagerGateway.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<RegistrationResponse> registerJobManager(JobMasterId jobMasterId, ResourceID jobMasterResourceId, String jobMasterAddress, JobID jobId, Time timeout) {
	final Consumer<Tuple4<JobMasterId, ResourceID, String, JobID>> currentConsumer = registerJobManagerConsumer;

	if (currentConsumer != null) {
		currentConsumer.accept(Tuple4.of(jobMasterId, jobMasterResourceId, jobMasterAddress, jobId));
	}

	return CompletableFuture.completedFuture(
		new JobMasterRegistrationSuccess(
			resourceManagerId,
			ownResourceId));
}
 
Example #2
Source File: ResourceManagerJobMasterTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Test receive normal registration from job master and receive duplicate
 * registration from job master.
 */
@Test
public void testRegisterJobMaster() throws Exception {
	// test response successful
	CompletableFuture<RegistrationResponse> successfulFuture = resourceManagerGateway.registerJobManager(
		jobMasterGateway.getFencingToken(),
		jobMasterResourceId,
		jobMasterGateway.getAddress(),
		jobId,
		TIMEOUT);
	RegistrationResponse response = successfulFuture.get(TIMEOUT.toMilliseconds(), TimeUnit.MILLISECONDS);
	assertTrue(response instanceof JobMasterRegistrationSuccess);
}
 
Example #3
Source File: TestingResourceManagerGateway.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CompletableFuture<RegistrationResponse> registerJobManager(JobMasterId jobMasterId, ResourceID jobMasterResourceId, String jobMasterAddress, JobID jobId, Time timeout) {
	final Consumer<Tuple4<JobMasterId, ResourceID, String, JobID>> currentConsumer = registerJobManagerConsumer;

	if (currentConsumer != null) {
		currentConsumer.accept(Tuple4.of(jobMasterId, jobMasterResourceId, jobMasterAddress, jobId));
	}

	return CompletableFuture.completedFuture(
		new JobMasterRegistrationSuccess(
			resourceManagerId,
			ownResourceId));
}
 
Example #4
Source File: ResourceManagerJobMasterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Test receive normal registration from job master and receive duplicate
 * registration from job master.
 */
@Test
public void testRegisterJobMaster() throws Exception {
	// test response successful
	CompletableFuture<RegistrationResponse> successfulFuture = resourceManagerGateway.registerJobManager(
		jobMasterGateway.getFencingToken(),
		jobMasterResourceId,
		jobMasterGateway.getAddress(),
		jobId,
		TIMEOUT);
	RegistrationResponse response = successfulFuture.get(TIMEOUT.toMilliseconds(), TimeUnit.MILLISECONDS);
	assertTrue(response instanceof JobMasterRegistrationSuccess);
}
 
Example #5
Source File: ResourceManagerJobMasterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Test receive normal registration from job master and receive duplicate
 * registration from job master.
 */
@Test
public void testRegisterJobMaster() throws Exception {
	// test response successful
	CompletableFuture<RegistrationResponse> successfulFuture = resourceManagerGateway.registerJobManager(
		jobMasterGateway.getFencingToken(),
		jobMasterResourceId,
		jobMasterGateway.getAddress(),
		jobId,
		TIMEOUT);
	RegistrationResponse response = successfulFuture.get(TIMEOUT.toMilliseconds(), TimeUnit.MILLISECONDS);
	assertTrue(response instanceof JobMasterRegistrationSuccess);
}
 
Example #6
Source File: MesosResourceManagerTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
/**
 * Register a job master with the RM.
 */
public void registerJobMaster(MockJobMaster jobMaster) throws Exception  {
	CompletableFuture<RegistrationResponse> registration = resourceManager.registerJobManager(
		jobMaster.jobMasterId, jobMaster.resourceID, jobMaster.address, jobMaster.jobID, timeout);
	assertTrue(registration.get() instanceof JobMasterRegistrationSuccess);
}
 
Example #7
Source File: MesosResourceManagerTest.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Register a job master with the RM.
 */
public void registerJobMaster(MockJobMaster jobMaster) throws Exception  {
	CompletableFuture<RegistrationResponse> registration = resourceManager.registerJobManager(
		jobMaster.jobMasterId, jobMaster.resourceID, jobMaster.address, jobMaster.jobID, timeout);
	assertTrue(registration.get() instanceof JobMasterRegistrationSuccess);
}
 
Example #8
Source File: MesosResourceManagerTest.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Register a job master with the RM.
 */
public void registerJobMaster(MockJobMaster jobMaster) throws Exception  {
	CompletableFuture<RegistrationResponse> registration = resourceManager.registerJobManager(
		jobMaster.jobMasterId, jobMaster.resourceID, jobMaster.address, jobMaster.jobID, timeout);
	assertTrue(registration.get() instanceof JobMasterRegistrationSuccess);
}
 
Example #9
Source File: TestingResourceManagerGateway.java    From flink with Apache License 2.0 4 votes vote down vote up
public JobMasterRegistrationSuccess getJobMasterRegistrationSuccess() {
	return new JobMasterRegistrationSuccess(
		resourceManagerId,
		ownResourceId);
}