Examples of ExecutionService


Examples of com.dtolabs.rundeck.core.execution.ExecutionService

    )
        throws NodeStepException
    {

        final ScriptFileCommand script = (ScriptFileCommand) item;
        final ExecutionService executionService = framework.getExecutionService();
        final String filename;

        if (null != script.getScript()) {
            filename = "dispatch-script.tmp";
        } else if (null != script.getServerScriptFilePath()) {
            filename = new File(script.getServerScriptFilePath()).getName();
        } else {
            filename = "dispatch-script.tmp";
        }
        String filepath = BaseFileCopier.generateRemoteFilepathForNode(
                node,
                filename,
                script.getFileExtension()
        );
        final File temp;
        try {
            if (null != script.getScript()) {
                //expand tokens in the script
                temp = BaseFileCopier.writeScriptTempFile(
                        context,
                        null,
                        null,
                        script.getScript(),
                        node
                );
            } else if (null != script.getServerScriptFilePath()) {
                //DON'T expand tokens in the script
                //TODO: make token expansion optional for local file sources
                temp = new File(script.getServerScriptFilePath());
            } else {
                //expand tokens in the script
                temp = BaseFileCopier.writeScriptTempFile(
                        context,
                        null,
                        script.getScriptAsStream(),
                        null,
                        node
                );
            }
            filepath = executionService.fileCopyFile(
                    context,
                    temp,
                    node,
                    filepath
            );
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

    NodeJobTracker(String name, JobTrackerConfig jobTrackerConfig, NodeEngine nodeEngine, MapReduceService mapReduceService) {

        super(name, jobTrackerConfig, nodeEngine, mapReduceService);

        ExecutionService es = nodeEngine.getExecutionService();
        InternalPartitionService ps = nodeEngine.getPartitionService();
        int maxThreadSize = jobTrackerConfig.getMaxThreadSize();
        if (maxThreadSize <= 0) {
            maxThreadSize = Runtime.getRuntime().availableProcessors();
        }
        int queueSize = jobTrackerConfig.getQueueSize();
        if (queueSize <= 0) {
            queueSize = ps.getPartitionCount() * 2;
        }

        try {
            String executorName = MapReduceUtil.buildExecutorName(name);
            es.register(executorName, maxThreadSize, queueSize, ExecutorType.CACHED);
        } catch (Exception ignore) {
            // After destroying the proxy and recreating it the executor
            // might already be registered, so we can ignore this exception.
            ILogger logger = nodeEngine.getLogger(NodeJobTracker.class);
            logger.finest("This is likely happened due to a previously cancelled job", ignore);
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

        config = hazelcastInstance.getConfig();
        cluster = hazelcastInstance.getCluster();

        Node node = hazelcastInstance.node;
        ExecutionService executionService = node.nodeEngine.getExecutionService();

        nodeMBean = new NodeMBean(hazelcastInstance, node, managementService);
        register(nodeMBean);

        connectionManagerMBean = new ConnectionManagerMBean(hazelcastInstance, node.connectionManager, service);
        register(connectionManagerMBean);

        eventServiceMBean = new EventServiceMBean(hazelcastInstance, node.nodeEngine.getEventService(), service);
        register(eventServiceMBean);

        OperationService operationService = node.nodeEngine.getOperationService();
        operationServiceMBean = new OperationServiceMBean(hazelcastInstance, operationService, service);
        register(operationServiceMBean);

        proxyServiceMBean = new ProxyServiceMBean(hazelcastInstance, node.nodeEngine.getProxyService(), service);
        register(proxyServiceMBean);

        partitionServiceMBean = new PartitionServiceMBean(hazelcastInstance, node.partitionService,service);
        register(partitionServiceMBean);

        clientEngineMBean = new ClientEngineMBean(hazelcastInstance, node.clientEngine, service);
        register(clientEngineMBean);

        systemExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.SYSTEM_EXECUTOR), service);
        register(systemExecutorMBean);

        operationExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.OPERATION_EXECUTOR), service);
        register(operationExecutorMBean);

        asyncExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.ASYNC_EXECUTOR), service);
        register(asyncExecutorMBean);

        scheduledExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.SCHEDULED_EXECUTOR), service);
        register(scheduledExecutorMBean);

        clientExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.CLIENT_EXECUTOR), service);
        register(clientExecutorMBean);

        queryExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.QUERY_EXECUTOR), service);
        register(queryExecutorMBean);

        ioExecutorMBean = new ManagedExecutorServiceMBean(
                hazelcastInstance, executionService.getExecutor(ExecutionService.IO_EXECUTOR), service);
        register(ioExecutorMBean);
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

    @Override
    public void init(final NodeEngine nodeEngine, Properties properties) {
        long mergeFirstRunDelay = node.getGroupProperties().MERGE_FIRST_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeFirstRunDelay = mergeFirstRunDelay <= 0 ? 100 : mergeFirstRunDelay; // milliseconds

        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.register(EXECUTOR_NAME, 2, 1000, ExecutorType.CACHED);

        long mergeNextRunDelay = node.getGroupProperties().MERGE_NEXT_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeNextRunDelay = mergeNextRunDelay <= 0 ? 100 : mergeNextRunDelay; // milliseconds
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new SplitBrainHandler(node),
                mergeFirstRunDelay, mergeNextRunDelay, TimeUnit.MILLISECONDS);

        long heartbeatInterval = node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger();
        heartbeatInterval = heartbeatInterval <= 0 ? 1 : heartbeatInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                heartBeater();
            }
        }, heartbeatInterval, heartbeatInterval, TimeUnit.SECONDS);

        long masterConfirmationInterval = node.groupProperties.MASTER_CONFIRMATION_INTERVAL_SECONDS.getInteger();
        masterConfirmationInterval = masterConfirmationInterval <= 0 ? 1 : masterConfirmationInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMasterConfirmation();
            }
        }, masterConfirmationInterval, masterConfirmationInterval, TimeUnit.SECONDS);

        long memberListPublishInterval = node.groupProperties.MEMBER_LIST_PUBLISH_INTERVAL_SECONDS.getInteger();
        memberListPublishInterval = memberListPublishInterval <= 0 ? 1 : memberListPublishInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMemberListToOthers();
            }
        }, memberListPublishInterval, memberListPublishInterval, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

                        mapStoreConfig.getProperties(), name);
            }
            loadInitialKeys();

            if (mapStoreConfig.getWriteDelaySeconds() > 0) {
                final ExecutionService executionService = nodeEngine.getExecutionService();
                executionService.register(mapStoreScheduledExecutorName, 1, 100000, ExecutorType.CACHED);
                ScheduledExecutorService scheduledExecutor = executionService
                        .getScheduledExecutor(mapStoreScheduledExecutorName);
                mapStoreScheduler = EntryTaskSchedulerFactory.newScheduler(scheduledExecutor,
                        new MapStoreProcessor(this, mapService),
                        ScheduleType.FOR_EACH);
            } else {
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

        if (response == RETRY_RESPONSE) {
            if (invocationFuture.interrupted) {
                invocationFuture.set(INTERRUPTED_RESPONSE);
            } else {
                invocationFuture.set(WAIT_RESPONSE);
                final ExecutionService ex = nodeEngine.getExecutionService();
                // fast retry for the first few reinvocations
                if (invokeCount < 5) {
                    getAsyncExecutor().execute(new ReInvocationTask());
                } else {
                    ex.schedule(ExecutionService.ASYNC_EXECUTOR, new ReInvocationTask(),
                            tryPauseMillis, TimeUnit.MILLISECONDS);
                }
            }
            return;
        }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

        int partitionTableSendInterval = node.groupProperties.PARTITION_TABLE_SEND_INTERVAL.getInteger();
        if (partitionTableSendInterval <= 0) {
            partitionTableSendInterval = 1;
        }
        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.scheduleAtFixedRate(new SendClusterStateTask(),
                partitionTableSendInterval, partitionTableSendInterval, TimeUnit.SECONDS);


        int backupSyncCheckInterval = node.groupProperties.PARTITION_BACKUP_SYNC_INTERVAL.getInteger();
        if (backupSyncCheckInterval <= 0) {
            backupSyncCheckInterval = 1;
        }
        executionService.scheduleWithFixedDelay(new SyncReplicaVersionTask(),
                backupSyncCheckInterval, backupSyncCheckInterval, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

    @Override
    public void init(final NodeEngine nodeEngine, Properties properties) {
        long mergeFirstRunDelay = node.getGroupProperties().MERGE_FIRST_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeFirstRunDelay = mergeFirstRunDelay <= 0 ? 100 : mergeFirstRunDelay; // milliseconds

        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.register(EXECUTOR_NAME, 2, 1000, ExecutorType.CACHED);

        long mergeNextRunDelay = node.getGroupProperties().MERGE_NEXT_RUN_DELAY_SECONDS.getLong() * 1000;
        mergeNextRunDelay = mergeNextRunDelay <= 0 ? 100 : mergeNextRunDelay; // milliseconds
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new SplitBrainHandler(node),
                mergeFirstRunDelay, mergeNextRunDelay, TimeUnit.MILLISECONDS);

        long heartbeatInterval = node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger();
        heartbeatInterval = heartbeatInterval <= 0 ? 1 : heartbeatInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                heartBeater();
            }
        }, heartbeatInterval, heartbeatInterval, TimeUnit.SECONDS);

        long masterConfirmationInterval = node.groupProperties.MASTER_CONFIRMATION_INTERVAL_SECONDS.getInteger();
        masterConfirmationInterval = masterConfirmationInterval <= 0 ? 1 : masterConfirmationInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMasterConfirmation();
            }
        }, masterConfirmationInterval, masterConfirmationInterval, TimeUnit.SECONDS);

        long memberListPublishInterval = node.groupProperties.MEMBER_LIST_PUBLISH_INTERVAL_SECONDS.getInteger();
        memberListPublishInterval = memberListPublishInterval <= 0 ? 1 : memberListPublishInterval;
        executionService.scheduleWithFixedDelay(EXECUTOR_NAME, new Runnable() {
            public void run() {
                sendMemberListToOthers();
            }
        }, memberListPublishInterval, memberListPublishInterval, TimeUnit.SECONDS);
    }
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

        final EventService es = instance.node.nodeEngine.getEventService();
        final OperationService os = instance.node.nodeEngine.getOperationService();
        final ConnectionManager cm = instance.node.connectionManager;
        final InternalPartitionService ps = instance.node.partitionService;
        final ProxyService proxyService = instance.node.nodeEngine.getProxyService();
        final ExecutionService executionService = instance.node.nodeEngine.getExecutionService();

        final SerializableMXBeans beans = new SerializableMXBeans();
        final SerializableEventServiceBean esBean = new SerializableEventServiceBean(es);
        beans.setEventServiceBean(esBean);
        final SerializableOperationServiceBean osBean = new SerializableOperationServiceBean(os);
        beans.setOperationServiceBean(osBean);
        final SerializableConnectionManagerBean cmBean = new SerializableConnectionManagerBean(cm);
        beans.setConnectionManagerBean(cmBean);
        final SerializablePartitionServiceBean psBean = new SerializablePartitionServiceBean(ps, instance);
        beans.setPartitionServiceBean(psBean);
        final SerializableProxyServiceBean proxyServiceBean = new SerializableProxyServiceBean(proxyService);
        beans.setProxyServiceBean(proxyServiceBean);

        final ManagedExecutorService systemExecutor = executionService.getExecutor(ExecutionService.SYSTEM_EXECUTOR);
        final ManagedExecutorService asyncExecutor = executionService.getExecutor(ExecutionService.ASYNC_EXECUTOR);
        final ManagedExecutorService scheduledExecutor = executionService.getExecutor(ExecutionService.SCHEDULED_EXECUTOR);
        final ManagedExecutorService clientExecutor = executionService.getExecutor(ExecutionService.CLIENT_EXECUTOR);
        final ManagedExecutorService queryExecutor = executionService.getExecutor(ExecutionService.QUERY_EXECUTOR);
        final ManagedExecutorService ioExecutor = executionService.getExecutor(ExecutionService.IO_EXECUTOR);

        final SerializableManagedExecutorBean systemExecutorBean = new SerializableManagedExecutorBean(systemExecutor);
        final SerializableManagedExecutorBean asyncExecutorBean = new SerializableManagedExecutorBean(asyncExecutor);
        final SerializableManagedExecutorBean scheduledExecutorBean = new SerializableManagedExecutorBean(scheduledExecutor);
        final SerializableManagedExecutorBean clientExecutorBean = new SerializableManagedExecutorBean(clientExecutor);
View Full Code Here

Examples of com.hazelcast.spi.ExecutionService

        this.logger = node.getLogger(ClientEngine.class);
        long heartbeatNoHeartBeatsSeconds = node.groupProperties.CLIENT_MAX_NO_HEARTBEAT_SECONDS.getInteger();

        ClientHeartbeatMonitor heartBeatMonitor =
                new ClientHeartbeatMonitor(heartbeatNoHeartBeatsSeconds, endpointManager, this);
        final ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.scheduleWithFixedDelay(heartBeatMonitor, HEART_BEAT_CHECK_INTERVAL_SECONDS,
                HEART_BEAT_CHECK_INTERVAL_SECONDS, TimeUnit.SECONDS);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.