Search in sources :

Example 1 with DataCollectionJobSerializer

use of com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobSerializer in project coprhd-controller by CoprHD.

the class ControllerServiceImpl method start.

@Override
public void start() throws Exception {
    _log.info("Starting controller service");
    _dbClient.start();
    // Without this delay, my testing for Workflow functionality indicated
    // that when a Bourne node is restarted with operations that have not
    // completed in the dispatcher, Zookeeper will often come up first,
    // and the Dispatcher will start running tasks (from before the restart)
    // before Cassandra has come up. Those tasks then generally fail again
    // because the first thing they often do is try to retrieve some record(s)
    // from Cassandra, and since it is not up yet, they take a Connection Exception.
    // Watson
    // wait 30 seconds for database to connect
    Thread.sleep(30000);
    _log.info("Waiting done");
    initDriverInfo();
    _drQueueCleanupHandler.run();
    _dispatcher.start();
    _jobTracker.setJobContext(new JobContext(_dbClient, _cimConnectionFactory, _vplexApiFactory, hdsApiFactory, cinderApiFactory, _vnxeApiClientFactory, _helper, _xivSmisCommandHelper, isilonApiFactory));
    // Set system-wide default timeout for QueueJobTracker. Can be overridden by specific jobs.
    _jobTracker.setTrackingTimeout(ControllerUtils.MINUTE_TO_MILLISECONDS * Long.valueOf(ControllerUtils.getPropertyValueFromCoordinator(_coordinator, CONTROLLER_JOB_QUEUE_EXECUTION_TIMEOUT_MINUTES)));
    _jobTracker.start();
    _jobQueue = _coordinator.getQueue(JOB_QUEUE_NAME, _jobTracker, new QueueJobSerializer(), DEFAULT_MAX_THREADS);
    Long wbemClientHTTPTimeoutInMilliSeconds = ControllerUtils.MINUTE_TO_MILLISECONDS * Long.valueOf(ControllerUtils.getPropertyValueFromCoordinator(_coordinator, WBEM_CLIENT_HTTP_TIMEOUT_MINUTES));
    _log.info("Setting value of {} to {} ms as system property. This will be used by WBEM Client.", WBEM_CLIENT_HTTP_TIMEOUT_PROPERTY_NAME, wbemClientHTTPTimeoutInMilliSeconds);
    System.setProperty(WBEM_CLIENT_HTTP_TIMEOUT_PROPERTY_NAME, String.valueOf(wbemClientHTTPTimeoutInMilliSeconds));
    _workflowService.start();
    _distributedOwnerLockService.start();
    /**
     * Lock used in making Scanning/Discovery mutually exclusive.
     */
    for (Lock lock : Lock.values()) {
        lock.setLock(_coordinator.getLock(lock.toString()));
    }
    /**
     * Discovery Queue, an instance of DistributedQueueImpl in
     * CoordinatorService,which holds Discovery Jobs. On starting
     * discoveryConsumer, a new ScheduledExecutorService is instantiated,
     * which schedules Loading Devices from DB every X minutes.
     */
    _discoverJobConsumer.start();
    _arrayAffinityDiscoverJobConsumer.start();
    _computeDiscoverJobConsumer.start();
    _scanJobConsumer.start();
    _meteringJobConsumer.start();
    _discoverJobQueue = _coordinator.getQueue(DISCOVER_JOB_QUEUE_NAME, _discoverJobConsumer, new DataCollectionJobSerializer(), Integer.parseInt(_configInfo.get(DISCOVERY_COREPOOLSIZE)), 200);
    _arrayAffinityDiscoverJobQueue = _coordinator.getQueue(ARRAYAFFINITY_DISCOVER_JOB_QUEUE_NAME, _arrayAffinityDiscoverJobConsumer, new DataCollectionJobSerializer(), ARRAYAFFINITY_DISCOVERY_COREPOOLSIZE, 200);
    _computeDiscoverJobQueue = _coordinator.getQueue(COMPUTE_DISCOVER_JOB_QUEUE_NAME, _computeDiscoverJobConsumer, new DataCollectionJobSerializer(), Integer.parseInt(_configInfo.get(COMPUTE_DISCOVERY_COREPOOLSIZE)), 50000);
    _meteringJobQueue = _coordinator.getQueue(METERING_JOB_QUEUE_NAME, _meteringJobConsumer, new DataCollectionJobSerializer(), Integer.parseInt(_configInfo.get(METERING_COREPOOLSIZE)), 200);
    _scanJobQueue = _coordinator.getQueue(SCAN_JOB_QUEUE_NAME, _scanJobConsumer, new DataCollectionJobSerializer(), 1, 50);
    /**
     * Monitoring use cases starts here
     */
    _monitoringJobQueue = _coordinator.getQueue(MONITORING_JOB_QUEUE_NAME, _monitoringJobConsumer, new DataCollectionJobSerializer(), DEFAULT_MAX_THREADS);
    /**
     * Adds listener class for zk connection state change.
     * This listener will release local CACHE while zk connection RECONNECT.
     */
    _coordinator.setConnectionListener(zkConnectionStateListenerForMonitoring);
    /**
     * Starts Monitoring scheduled thread
     */
    _monitoringJobConsumer.start();
    startLockQueueService();
    _drWorkflowCleanupHandler.run();
    _jobScheduler.start();
    _svcBeacon.start();
    startCapacityService();
    loadCustomConfigDefaults();
}
Also used : QueueJobSerializer(com.emc.storageos.volumecontroller.impl.job.QueueJobSerializer) DataCollectionJobSerializer(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobSerializer) JobContext(com.emc.storageos.volumecontroller.JobContext) InterProcessLock(org.apache.curator.framework.recipes.locks.InterProcessLock)

Aggregations

JobContext (com.emc.storageos.volumecontroller.JobContext)1 QueueJobSerializer (com.emc.storageos.volumecontroller.impl.job.QueueJobSerializer)1 DataCollectionJobSerializer (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJobSerializer)1 InterProcessLock (org.apache.curator.framework.recipes.locks.InterProcessLock)1