Package com.hazelcast.mapreduce.impl.task

Examples of com.hazelcast.mapreduce.impl.task.JobProcessInformationImpl


    public static JobProcessInformationImpl createJobProcessInformation(JobTaskConfiguration configuration,
                                                                        JobSupervisor supervisor) {
        NodeEngine nodeEngine = configuration.getNodeEngine();
        if (configuration.getKeyValueSource() instanceof PartitionIdAware) {
            int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
            return new JobProcessInformationImpl(partitionCount, supervisor);
        } else {
            int partitionCount = nodeEngine.getClusterService().getMemberList().size();
            return new MemberAssigningJobProcessInformationImpl(partitionCount, supervisor);
        }
    }
View Full Code Here


            return;
        }

        InternalPartitionService ps = getNodeEngine().getPartitionService();
        List<Integer> memberPartitions = ps.getMemberPartitions(getCallerAddress());
        JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();

        while (true) {
            int selectedPartition = searchMemberPartitionToProcess(processInformation, memberPartitions);
            if (selectedPartition == -1) {
                // All partitions seem to be assigned so give up
View Full Code Here

        if (supervisor == null) {
            result = new RequestPartitionResult(NO_SUPERVISOR, -1);
            return;
        }

        JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();
        JobPartitionState.State nextState = stateChange(getCallerAddress(), partitionId, MAPPING, processInformation,
                supervisor.getConfiguration());

        if (nextState != null) {
            result = new RequestPartitionResult(SUCCESSFUL, partitionId);
View Full Code Here

    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
        if (supervisor != null) {
            JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();
            processInformation.addProcessedRecords(processedRecords);
        }
    }
View Full Code Here

        if (supervisor == null) {
            result = new RequestPartitionResult(NO_SUPERVISOR, -1);
            return;
        }

        JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();
        JobPartitionState.State nextState = stateChange(getCallerAddress(), partitionId, currentState, processInformation,
                supervisor.getConfiguration());

        if (nextState == PROCESSED) {
            result = new RequestPartitionResult(SUCCESSFUL, partitionId);
View Full Code Here

        if (supervisor == null) {
            result = new RequestPartitionResult(NO_SUPERVISOR, -1);
            return;
        }

        JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();

        while (true) {
            JobPartitionState[] partitionStates = processInformation.getPartitionStates();
            JobPartitionState oldPartitionState = partitionStates[partitionId];

            if (oldPartitionState == null || !getCallerAddress().equals(oldPartitionState.getOwner())) {
                result = new RequestPartitionResult(CHECK_STATE_FAILED, partitionId);
                return;
            }

            if (processInformation.updatePartitionState(partitionId, oldPartitionState, null)) {
                result = new RequestPartitionResult(SUCCESSFUL, partitionId);
                return;
            }
        }
    }
View Full Code Here

    public static JobProcessInformationImpl createJobProcessInformation(JobTaskConfiguration configuration,
                                                                        JobSupervisor supervisor) {
        NodeEngine nodeEngine = configuration.getNodeEngine();
        if (configuration.getKeyValueSource() instanceof PartitionIdAware) {
            int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
            return new JobProcessInformationImpl(partitionCount, supervisor);
        } else {
            int partitionCount = nodeEngine.getClusterService().getMemberList().size();
            return new MemberAssigningJobProcessInformationImpl(partitionCount, supervisor);
        }
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.mapreduce.impl.task.JobProcessInformationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.