Search in sources :

Example 1 with MemberAssigningJobProcessInformationImpl

use of com.hazelcast.mapreduce.impl.task.MemberAssigningJobProcessInformationImpl in project hazelcast by hazelcast.

the class RequestMemberIdAssignment method run.

@Override
public void run() throws Exception {
    MapReduceService mapReduceService = getService();
    JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
    if (supervisor == null) {
        result = new RequestPartitionResult(NO_SUPERVISOR, -1);
        return;
    }
    MemberAssigningJobProcessInformationImpl processInformation = getProcessInformation(supervisor);
    int memberId = processInformation.assignMemberId(getCallerAddress(), getCallerUuid(), supervisor.getConfiguration());
    if (memberId == -1) {
        result = new RequestPartitionResult(NO_MORE_PARTITIONS, -1);
        return;
    }
    result = new RequestPartitionResult(SUCCESSFUL, memberId);
}
Also used : MemberAssigningJobProcessInformationImpl(com.hazelcast.mapreduce.impl.task.MemberAssigningJobProcessInformationImpl) MapReduceService(com.hazelcast.mapreduce.impl.MapReduceService) JobSupervisor(com.hazelcast.mapreduce.impl.task.JobSupervisor)

Aggregations

MapReduceService (com.hazelcast.mapreduce.impl.MapReduceService)1 JobSupervisor (com.hazelcast.mapreduce.impl.task.JobSupervisor)1 MemberAssigningJobProcessInformationImpl (com.hazelcast.mapreduce.impl.task.MemberAssigningJobProcessInformationImpl)1