@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); // Create thread pool for processing requests. this.executor = Executors.newFixedThreadPool(getNumThreads()); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); if (getInboundProcessorsExecutor() != null) { getInboundProcessorsExecutor().shutdownNow(); } this.inboundProcessorsExecutor = Executors.newFixedThreadPool( getDecodedEventsConsumer().getInboundProcessingConfiguration().getProcessingThreadCount()); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); // Start device event decoder. startNestedComponent(getDeviceEventDecoder(), monitor, true); // Start device event deduplicator if provided. if (getDeviceEventDeduplicator() != null) { startNestedComponent(getDeviceEventDeduplicator(), monitor, true); } // Start event receivers. for (IInboundEventReceiver<T> receiver : getInboundEventReceivers()) { startNestedComponent(receiver, monitor, true); } }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); // Verify that contact points were specified. String[] contactPoints = getContactPoints().getValue().split(","); if (contactPoints.length == 0) { throw new SiteWhereException("No contact points specified for Cassandra cluster."); } Cluster.Builder builder = Cluster.builder(); for (String contactPoint : contactPoints) { builder.addContactPoint(contactPoint.trim()); } PoolingOptions pooling = new PoolingOptions(); pooling.setMaxRequestsPerConnection(HostDistance.LOCAL, 32768); pooling.setMaxRequestsPerConnection(HostDistance.REMOTE, 32768); pooling.setMaxQueueSize(32768); builder.withPoolingOptions(pooling); this.cluster = builder.build(); this.session = getCluster().connect(); }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); String connectionUrl = "http://" + getHostname().getValue() + ":" + getConfiguration().getPort(); this.influx = InfluxDBFactory.connect(connectionUrl, getConfiguration().getUsername(), getConfiguration().getPassword()); influx.createDatabase(getDatabase().getValue()); if (getConfiguration().isEnableBatch()) { influx.enableBatch(getConfiguration().getBatchChunkSize(), getConfiguration().getBatchIntervalMs(), TimeUnit.MILLISECONDS); } influx.setLogLevel(convertLogLevel(getConfiguration().getLogLevel())); }