packageorg.skywalking.apm.agent.core.datacarrier.performance.comparetest.disruptor;importcom.lmax.disruptor.RingBuffer;/** * Created by wusheng on 2016/11/24. */publicclassDataProducer{privatefinalRingBuffer<Data>ringBuffer;publicDataProducer(RingBuffer<Data>ringBuffer){this.ringBuffer=ringBuffer;}publicvoidonData(Databb){longsequence=ringBuffer.next();// Grab the next sequencetry{Dataevent=ringBuffer.get(sequence);// Get the entry in the Disruptor// for the sequenceevent.setValue1(bb.getValue1());// Fill with data}finally{ringBuffer.publish(sequence);}}}