private GenericOperationThread[] initGenericThreads(String hzName, NodeExtension nodeExtension, ClassLoader configClassLoader) { // we created as many generic operation handlers, as there are generic threads int threadCount = genericOperationRunners.length; GenericOperationThread[] threads = new GenericOperationThread[threadCount]; int threadId = 0; for (int threadIndex = 0; threadIndex < threads.length; threadIndex++) { boolean priority = threadIndex < priorityThreadCount; String baseName = priority ? "priority-generic-operation" : "generic-operation"; String threadName = createThreadPoolName(hzName, baseName) + threadId; OperationRunner operationRunner = genericOperationRunners[threadIndex]; GenericOperationThread operationThread = new GenericOperationThread( threadName, threadIndex, genericQueue, logger, nodeExtension, operationRunner, priority, configClassLoader); threads[threadIndex] = operationThread; operationRunner.setCurrentThread(operationThread); if (threadIndex == priorityThreadCount - 1) { threadId = 0; } else { threadId++; } } return threads; }
private GenericOperationThread[] initGenericThreads(String hzName, NodeExtension nodeExtension, ClassLoader configClassLoader) { // we created as many generic operation handlers, as there are generic threads int threadCount = genericOperationRunners.length; GenericOperationThread[] threads = new GenericOperationThread[threadCount]; int threadId = 0; for (int threadIndex = 0; threadIndex < threads.length; threadIndex++) { boolean priority = threadIndex < priorityThreadCount; String baseName = priority ? "priority-generic-operation" : "generic-operation"; String threadName = createThreadPoolName(hzName, baseName) + threadId; OperationRunner operationRunner = genericOperationRunners[threadIndex]; GenericOperationThread operationThread = new GenericOperationThread( threadName, threadIndex, genericQueue, logger, nodeExtension, operationRunner, priority, configClassLoader); threads[threadIndex] = operationThread; operationRunner.setCurrentThread(operationThread); if (threadIndex == priorityThreadCount - 1) { threadId = 0; } else { threadId++; } } return threads; }