Java源码示例:org.apache.flink.runtime.jobmaster.JobMasterRegistrationSuccess
示例1
@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));
}
示例2
/**
* 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);
}
示例3
@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));
}
示例4
/**
* 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);
}
示例5
/**
* 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);
}
示例6
/**
* 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);
}
示例7
/**
* 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);
}
示例8
/**
* 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);
}
示例9
public JobMasterRegistrationSuccess getJobMasterRegistrationSuccess() {
return new JobMasterRegistrationSuccess(
resourceManagerId,
ownResourceId);
}