Skip to content
Snippets Groups Projects
Commit 337d0cf8 authored by Florian Fittkau's avatar Florian Fittkau
Browse files

some disruptor improvements

parent ce54b104
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,11 @@ package explorviz.live_trace_processing.filter;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.lmax.disruptor.BlockingWaitStrategy;
import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.RingBuffer;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.dsl.ProducerType;
import explorviz.live_trace_processing.filter.counting.CountingThroughputFilter;
import explorviz.live_trace_processing.record.IRecord;
......@@ -21,7 +23,7 @@ public abstract class AbstractFilter implements IPipeReceiver {
private IRecord[] outputBuffer;
private int outputBufferIndex;
public final static ExecutorService cachedThreadPool = Executors
public final ExecutorService cachedThreadPool = Executors
.newCachedThreadPool();
public AbstractFilter(final IPipeReceiver receiver,
......@@ -38,7 +40,8 @@ public abstract class AbstractFilter implements IPipeReceiver {
final Disruptor<RecordArrayEvent> disruptor = new Disruptor<RecordArrayEvent>(
new RecordArrayEventFactory(OUTPUT_MESSAGE_BUFFER_SIZE),
RINGBUFFER_LENGTH, cachedThreadPool);
RINGBUFFER_LENGTH, cachedThreadPool, ProducerType.SINGLE,
new BlockingWaitStrategy());
@SuppressWarnings("unchecked")
final EventHandler<RecordArrayEvent>[] eventHandlers = new EventHandler[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment