/** * Starts the disruptor. * * @throws StorageException * If buffer size can not be read from configuration. */ @SuppressWarnings("unchecked") private void startDisruptor() throws StorageException { // Specify the size of the ring buffer, must be power of 2. int bufferSize = disruptorStrategy.getDataBufferSize(); // define thread factory and initialize disruptor ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("inspectit-disruptor-thread-%d").setDaemon(true).build(); disruptor = new Disruptor<DefaultDataWrapper>(new DefaultDataFactory(), bufferSize, threadFactory, ProducerType.MULTI, new BlockingWaitStrategy()); // Connect the handler disruptor.handleEventsWith(defaultDataHandler); // Start the Disruptor, starts all threads running disruptor.start(); // Get the ring buffer from the Disruptor to be used for publishing. ringBuffer = disruptor.getRingBuffer(); }