private ExecutorService createSerialExecutor(final Integer id) { OverflowQueueWithDMStats<Runnable> poolQueue; if (SERIAL_QUEUE_BYTE_LIMIT == 0 || this.throttlingDisabled) { poolQueue = new OverflowQueueWithDMStats<>(stats.getSerialQueueHelper()); } else { poolQueue = new ThrottlingMemLinkedQueueWithDMStats<>(SERIAL_QUEUE_BYTE_LIMIT, SERIAL_QUEUE_THROTTLE, SERIAL_QUEUE_SIZE_LIMIT, SERIAL_QUEUE_SIZE_THROTTLE, this.stats.getSerialQueueHelper()); } serialQueuedMap.put(id, poolQueue); return LoggingExecutors.newSerialThreadPool("Pooled Serial Message Processor" + id + "-", thread -> stats.incSerialPooledThreadStarts(), this::doSerialPooledThread, this.stats.getSerialPooledProcessorHelper(), threadMonitoring, poolQueue); }
this.stats.getSerialQueueHelper().incThrottleCount(); } while (stats.getSerialQueueBytes() >= TOTAL_SERIAL_QUEUE_BYTE_LIMIT);
poolQueue = new OverflowQueueWithDMStats(this.stats.getSerialQueueHelper()); } else { this.serialQueue = new ThrottlingMemLinkedQueueWithDMStats<>(TOTAL_SERIAL_QUEUE_BYTE_LIMIT, TOTAL_SERIAL_QUEUE_THROTTLE, SERIAL_QUEUE_SIZE_LIMIT, SERIAL_QUEUE_SIZE_THROTTLE, this.stats.getSerialQueueHelper()); poolQueue = this.serialQueue;