Class AbstractSequencer

    • Constructor Detail

      • AbstractSequencer

        public AbstractSequencer​(int bufferSize,
                                 WaitStrategy waitStrategy)
        Create with the specified buffer size and wait strategy.
        Parameters:
        bufferSize - The total number of entries, must be a positive power of 2.
        waitStrategy - The wait strategy used by this sequencer
    • Method Detail

      • getCursor

        public final long getCursor()
        Description copied from interface: Cursored
        Get the current cursor value.
        Specified by:
        getCursor in interface Cursored
        Returns:
        current cursor value
        See Also:
        Cursored.getCursor()
      • addGatingSequences

        public final void addGatingSequences​(Sequence... gatingSequences)
        Description copied from interface: Sequencer
        Add the specified gating sequences to this instance of the Disruptor. They will safely and atomically added to the list of gating sequences.
        Specified by:
        addGatingSequences in interface Sequencer
        Parameters:
        gatingSequences - The sequences to add.
        See Also:
        Sequencer.addGatingSequences(Sequence...)
      • getMinimumSequence

        public long getMinimumSequence()
        Description copied from interface: Sequencer
        Get the minimum sequence value from all of the gating sequences added to this ringBuffer.
        Specified by:
        getMinimumSequence in interface Sequencer
        Returns:
        The minimum gating sequence or the cursor sequence if no sequences have been added.
        See Also:
        Sequencer.getMinimumSequence()
      • newBarrier

        public SequenceBarrier newBarrier​(Sequence... sequencesToTrack)
        Description copied from interface: Sequencer
        Create a new SequenceBarrier to be used by an EventProcessor to track which messages are available to be read from the ring buffer given a list of sequences to track.
        Specified by:
        newBarrier in interface Sequencer
        Parameters:
        sequencesToTrack - All of the sequences that the newly constructed barrier will wait on.
        Returns:
        A sequence barrier that will track the specified sequences.
        See Also:
        Sequencer.newBarrier(Sequence...)
      • newPoller

        public <T> EventPoller<T> newPoller​(DataProvider<T> dataProvider,
                                            Sequence... gatingSequences)
        Creates an event poller for this sequence that will use the supplied data provider and gating sequences.
        Specified by:
        newPoller in interface Sequencer
        Type Parameters:
        T - the type of the event
        Parameters:
        dataProvider - The data source for users of this event poller
        gatingSequences - Sequence to be gated on.
        Returns:
        A poller that will gate on this ring buffer and the supplied sequences.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object