int threadCount) {
this.store = store;
this.threadsCount = threadCount;
completionSemaphore = new Semaphore(1 - threadsCount);
queues = new BlockingQueue[threadsCount];
partition2Queue = new Int2IntArrayMap();
LOG.info("AsyncMessageStoreWrapper enabled. Threads= " + threadsCount);
for (int i = 0; i < threadsCount; i++) {
queues[i] = new LinkedBlockingQueue<>();
EXECUTOR_SERVICE.submit(new MessageStoreQueueWorker(queues[i]));