Package com.hazelcast.mapreduce.impl

Examples of com.hazelcast.mapreduce.impl.MapReduceService


                registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
                registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
                registerService(CountDownLatchService.SERVICE_NAME, new CountDownLatchService());
                registerService(SemaphoreService.SERVICE_NAME, new SemaphoreService(nodeEngine));
                registerService(IdGeneratorService.SERVICE_NAME, new IdGeneratorService(nodeEngine));
                registerService(MapReduceService.SERVICE_NAME, new MapReduceService(nodeEngine));
            }

            serviceProps = new HashMap<String, Properties>();
            serviceConfigObjects = new HashMap<String, Object>();
            final Collection<ServiceConfig> serviceConfigs = servicesConfig.getServiceConfigs();
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;
        }
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;
        }
View Full Code Here

    }

    private void notifyProcessStats() {
        if (processedRecords > 0) {
            try {
                MapReduceService mapReduceService = supervisor.getMapReduceService();
                String name = supervisor.getConfiguration().getName();
                String jobId = supervisor.getConfiguration().getJobId();
                Address jobOwner = supervisor.getJobOwner();
                mapReduceService.processRequest(jobOwner, new ProcessStatsUpdateOperation(name, jobId, processedRecords), name);
            } catch (Exception ignore) {
                // Don't care if wasn't executed properly
                logger.finest("ProcessedRecords update couldn't be executed", ignore);
            }
        }
View Full Code Here

    }

    @Override
    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        Address jobOwner = getCallerAddress();
        if (jobOwner == null) {
            jobOwner = getNodeEngine().getThisAddress();
        }

        // Inject managed context
        MapReduceUtil.injectManagedContext(getNodeEngine(), mapper, combinerFactory, reducerFactory, keyValueSource);

        // Build immutable configuration
        JobTaskConfiguration config = new JobTaskConfiguration(jobOwner, getNodeEngine(), chunkSize, name, jobId, mapper,
                combinerFactory, reducerFactory, keyValueSource, communicateStats, topologyChangedStrategy);

        JobSupervisor supervisor = mapReduceService.createJobSupervisor(config);

        if (supervisor == null) {
            // 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);
            }
View Full Code Here

    @Override
    public void run()
            throws Exception {

        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
        if (supervisor != null) {
            result = supervisor.getJobResults();

            // This is the final call so cleanup on all nodes that are not job owners
            if (!supervisor.isOwnerNode()) {
                mapReduceService.destroyJobSupervisor(supervisor);
                AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.getJobTracker(getName());
                jobTracker.unregisterTrackableJob(getJobId());
                jobTracker.unregisterMapCombineTask(getJobId());
                jobTracker.unregisterReducerTask(getJobId());
            }
        }
View Full Code Here

    }

    @Override
    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

    }

    @Override
    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
        if (supervisor == null) {
            this.result = new KeysAssignmentResult(NO_SUPERVISOR, null);
            return;
        }
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;
        }
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);
                }
View Full Code Here

TOP

Related Classes of com.hazelcast.mapreduce.impl.MapReduceService

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.