Package com.hazelcast.mapreduce.impl.task

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


    @Override
    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        mapReduceService.registerJobSupervisorCancellation(getName(), getJobId(), jobOwner);
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
        if (supervisor != null) {
            supervisor.cancel();
        }
    }
View Full Code Here


    @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;
        }

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

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

    @Override
    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
        if (supervisor != null) {
            supervisor.notifyRemoteException(getCallerAddress(), throwable);
        }
    }
View Full Code Here

    @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;
        }

        JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();

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

    @Override
    protected void invoke() {
        final ClientEndpoint endpoint = getEndpoint();

        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);

        JobProcessInformation processInformation = null;
        if (supervisor != null && supervisor.getJobProcessInformation() != null) {
            JobProcessInformation current = supervisor.getJobProcessInformation();
            processInformation = new TransferableJobProcessInformation(current.getPartitionStates(),
                    current.getProcessedRecords());
        }
        endpoint.sendResponse(processInformation, getCallId());
    }
View Full Code Here

        MapReduceService mapReduceService = getService();
        Address jobOwner = mapReduceService.getLocalAddress();
        mapReduceService.registerJobSupervisorCancellation(name, jobId, jobOwner);

        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
        if (supervisor != null && supervisor.isOwnerNode()) {
            Exception exception = new CancellationException("Operation was cancelled by the user");
            supervisor.cancelAndNotify(exception);
        }
        endpoint.sendResponse(Boolean.TRUE, getCallId());
    }
View Full Code Here

    @Override
    protected void invoke() {
        final ClientEndpoint endpoint = getEndpoint();

        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);

        JobProcessInformation processInformation = null;
        if (supervisor != null && supervisor.getJobProcessInformation() != null) {
            JobProcessInformation current = supervisor.getJobProcessInformation();
            processInformation = new TransferableJobProcessInformation(current.getPartitionStates(),
                    current.getProcessedRecords());
        }
        endpoint.sendResponse(processInformation, getCallId());
    }
View Full Code Here

    @Override
    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
        if (supervisor == null) {
            if (mapReduceService.unregisterJobSupervisorCancellation(name, jobId)) {
                // Supervisor was cancelled prior to creation
                AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.getJobTracker(name);
                TrackableJobFuture future = jobTracker.unregisterTrackableJob(jobId);
                if (future != null) {
                    Exception exception = new CancellationException("Operation was cancelled by the user");
                    future.setResult(exception);
                }
            }
            return;
        }

        // Create actual mapping operation
        MappingPhase mappingPhase = new KeyValueSourceMappingPhase(keys, predicate);
        supervisor.startTasks(mappingPhase);
    }
View Full Code Here

        MapReduceService mapReduceService = getService();
        Address jobOwner = mapReduceService.getLocalAddress();
        mapReduceService.registerJobSupervisorCancellation(name, jobId, jobOwner);

        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
        if (supervisor != null && supervisor.isOwnerNode()) {
            Exception exception = new CancellationException("Operation was cancelled by the user");
            supervisor.cancelAndNotify(exception);
        }
        endpoint.sendResponse(Boolean.TRUE, getCallId());
    }
View Full Code Here

TOP

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

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.