public DisruptorQueue(ClaimStrategy claim, WaitStrategy wait) { _buffer = new RingBuffer<MutableObject>(new ObjectEventFactory(), claim, wait); _consumer = new Sequence(); _barrier = _buffer.newBarrier(); _buffer.setGatingSequences(_consumer); if(claim instanceof SingleThreadedClaimStrategy) { consumerStartedFlag = true; } }
public TracedDisruptorQueue(ClaimStrategy claim, WaitStrategy wait, Map<String, Object> conf) { super(claim, wait); float sampleRate = 0.05f; if (conf.containsKey("topology.queue.sample.rate")) { sampleRate = ((Number) conf.get("topology.queue.sample.rate")).floatValue(); } this.sampleInterval = Math.max((int) (1 / sampleRate), 2); }