public InboundResponseHandler getBackupHandler() { return inboundResponseHandlerSupplier.backupHandler(); }
@Override public int getResponseQueueSize() { return inboundResponseHandlerSupplier.responseQueueSize(); }
private ResponseThread(String hzName, int threadIndex) { super(createThreadName(hzName, "response-" + threadIndex)); this.inboundResponseHandler = new InboundResponseHandler(invocationRegistry, nodeEngine); this.responseQueue = new MPSCQueue<Packet>(this, getIdleStrategy(properties, IDLE_STRATEGY)); }
public void start() { logger.finest("Starting OperationService"); initInvocationContext(); invocationMonitor.start(); operationExecutor.start(); inboundResponseHandlerSupplier.start(); slowOperationDetector.start(); }
/** * Shuts down invocation infrastructure. * New invocation requests will be rejected after shutdown and all pending invocations * will be notified with a failure response. */ public void shutdownInvocations() { logger.finest("Shutting down invocations"); invocationRegistry.shutdown(); invocationMonitor.shutdown(); inboundResponseHandlerSupplier.shutdown(); try { invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS); } catch (InterruptedException e) { // TODO: we need a better mechanism for dealing with interruption and waiting for termination Thread.currentThread().interrupt(); } }
this.inboundResponseHandlerSupplier = new InboundResponseHandlerSupplier( configClassLoader, invocationRegistry, hzName, nodeEngine);
logger, operationService.getOperationExecutor(), operationService.getInboundResponseHandlerSupplier().get(), operationService.getInvocationMonitor(), eventService,
private ResponseThread(String hzName, int threadIndex) { super(createThreadName(hzName, "response-" + threadIndex)); this.inboundResponseHandler = new InboundResponseHandler(invocationRegistry, nodeEngine); this.responseQueue = new MPSCQueue<Packet>(this, getIdleStrategy(properties, IDLE_STRATEGY)); }
public void start() { logger.finest("Starting OperationService"); initInvocationContext(); invocationMonitor.start(); operationExecutor.start(); inboundResponseHandlerSupplier.start(); slowOperationDetector.start(); }
/** * Shuts down invocation infrastructure. * New invocation requests will be rejected after shutdown and all pending invocations * will be notified with a failure response. */ public void shutdownInvocations() { logger.finest("Shutting down invocations"); invocationRegistry.shutdown(); invocationMonitor.shutdown(); inboundResponseHandlerSupplier.shutdown(); try { invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS); } catch (InterruptedException e) { // TODO: we need a better mechanism for dealing with interruption and waiting for termination Thread.currentThread().interrupt(); } }
this.inboundResponseHandlerSupplier = new InboundResponseHandlerSupplier( configClassLoader, invocationRegistry, hzName, nodeEngine);
logger, operationService.getOperationExecutor(), operationService.getInboundResponseHandlerSupplier().get(), operationService.getInvocationMonitor(), eventService,
ResponseThread(String name) { super(name); setContextClassLoader(client.getClientConfig().getClassLoader()); this.responseQueue = new MPSCQueue<ClientMessage>(this, getIdleStrategy(client.getProperties(), IDLE_STRATEGY)); }
@Override public int getResponseQueueSize() { return inboundResponseHandlerSupplier.responseQueueSize(); }
public InboundResponseHandler getBackupHandler() { return inboundResponseHandlerSupplier.backupHandler(); }
ResponseThread(String name) { super(name); setContextClassLoader(client.getClientConfig().getClassLoader()); this.responseQueue = new MPSCQueue<ClientMessage>(this, getIdleStrategy(client.getProperties(), IDLE_STRATEGY)); }
private PartitionOperationThread[] initPartitionThreads(HazelcastProperties properties, String hzName, NodeExtension nodeExtension, ClassLoader configClassLoader) { int threadCount = properties.getInteger(PARTITION_OPERATION_THREAD_COUNT); if (threadCount <= 0) { // default partition operation thread count int coreSize = RuntimeAvailableProcessors.get(); threadCount = Math.max(2, coreSize); } IdleStrategy idleStrategy = getIdleStrategy(properties, IDLE_STRATEGY); PartitionOperationThread[] threads = new PartitionOperationThread[threadCount]; for (int threadId = 0; threadId < threads.length; threadId++) { String threadName = createThreadPoolName(hzName, "partition-operation") + threadId; // the normalQueue will be a blocking queue. We don't want to idle, because there are many operation threads. MPSCQueue<Object> normalQueue = new MPSCQueue<Object>(idleStrategy); OperationQueue operationQueue = new OperationQueueImpl(normalQueue, new ConcurrentLinkedQueue<Object>()); PartitionOperationThread partitionThread = new PartitionOperationThread(threadName, threadId, operationQueue, logger, nodeExtension, partitionOperationRunners, configClassLoader); threads[threadId] = partitionThread; normalQueue.setConsumerThread(partitionThread); } // we need to assign the PartitionOperationThreads to all OperationRunners they own for (int partitionId = 0; partitionId < partitionOperationRunners.length; partitionId++) { int threadId = getPartitionThreadId(partitionId, threadCount); Thread thread = threads[threadId]; OperationRunner runner = partitionOperationRunners[partitionId]; runner.setCurrentThread(thread); } return threads; }
private PartitionOperationThread[] initPartitionThreads(HazelcastProperties properties, String hzName, NodeExtension nodeExtension, ClassLoader configClassLoader) { int threadCount = properties.getInteger(PARTITION_OPERATION_THREAD_COUNT); if (threadCount <= 0) { // default partition operation thread count int coreSize = RuntimeAvailableProcessors.get(); threadCount = Math.max(2, coreSize); } IdleStrategy idleStrategy = getIdleStrategy(properties, IDLE_STRATEGY); PartitionOperationThread[] threads = new PartitionOperationThread[threadCount]; for (int threadId = 0; threadId < threads.length; threadId++) { String threadName = createThreadPoolName(hzName, "partition-operation") + threadId; // the normalQueue will be a blocking queue. We don't want to idle, because there are many operation threads. MPSCQueue<Object> normalQueue = new MPSCQueue<Object>(idleStrategy); OperationQueue operationQueue = new OperationQueueImpl(normalQueue, new ConcurrentLinkedQueue<Object>()); PartitionOperationThread partitionThread = new PartitionOperationThread(threadName, threadId, operationQueue, logger, nodeExtension, partitionOperationRunners, configClassLoader); threads[threadId] = partitionThread; normalQueue.setConsumerThread(partitionThread); } // we need to assign the PartitionOperationThreads to all OperationRunners they own for (int partitionId = 0; partitionId < partitionOperationRunners.length; partitionId++) { int threadId = getPartitionThreadId(partitionId, threadCount); Thread thread = threads[threadId]; OperationRunner runner = partitionOperationRunners[partitionId]; runner.setCurrentThread(thread); } return threads; }