Skip to content

Commit

Permalink
Fix all of the Javadoc errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Sep 27, 2017
1 parent 2a66a1d commit eff62d4
Show file tree
Hide file tree
Showing 19 changed files with 154 additions and 87 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/lmax/disruptor/AbstractSequencer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class AbstractSequencer implements Sequencer
* Create with the specified buffer size and wait strategy.
*
* @param bufferSize The total number of entries, must be a positive power of 2.
* @param waitStrategy
* @param waitStrategy The wait strategy used by this sequencer
*/
public AbstractSequencer(int bufferSize, WaitStrategy waitStrategy)
{
Expand Down
56 changes: 46 additions & 10 deletions src/main/java/com/lmax/disruptor/EventSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public interface EventSink<E>
/**
* Allows one user supplied argument.
*
* @param <A> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @see #publishEvent(EventTranslator)
Expand All @@ -37,6 +38,7 @@ public interface EventSink<E>
/**
* Allows one user supplied argument.
*
* @param <A> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @return true if the value was published, false if there was insufficient
Expand All @@ -48,6 +50,8 @@ public interface EventSink<E>
/**
* Allows two user supplied arguments.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @param arg1 A user supplied argument.
Expand All @@ -58,6 +62,8 @@ public interface EventSink<E>
/**
* Allows two user supplied arguments.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @param arg1 A user supplied argument.
Expand All @@ -70,6 +76,9 @@ public interface EventSink<E>
/**
* Allows three user supplied arguments
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param <C> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @param arg1 A user supplied argument.
Expand All @@ -81,6 +90,9 @@ public interface EventSink<E>
/**
* Allows three user supplied arguments
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param <C> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @param arg1 A user supplied argument.
Expand Down Expand Up @@ -112,30 +124,30 @@ public interface EventSink<E>
boolean tryPublishEvent(EventTranslatorVararg<E> translator, Object... args);

/**
* Publishes multiple events to the ring buffer. It handles
* <p>Publishes multiple events to the ring buffer. It handles
* claiming the next sequence, getting the current (uninitialised)
* event from the ring buffer and publishing the claimed sequence
* after translation.
* <p>
* With this call the data that is to be inserted into the ring
* after translation.</p>
*
* <p>With this call the data that is to be inserted into the ring
* buffer will be a field (either explicitly or captured anonymously),
* therefore this call will require an instance of the translator
* for each value that is to be inserted into the ring buffer.
* for each value that is to be inserted into the ring buffer.</p>
*
* @param translators The user specified translation for each event
*/
void publishEvents(EventTranslator<E>[] translators);

/**
* Publishes multiple events to the ring buffer. It handles
* <p>Publishes multiple events to the ring buffer. It handles
* claiming the next sequence, getting the current (uninitialised)
* event from the ring buffer and publishing the claimed sequence
* after translation.
* <p>
* With this call the data that is to be inserted into the ring
* after translation.</p>
*
* <p>With this call the data that is to be inserted into the ring
* buffer will be a field (either explicitly or captured anonymously),
* therefore this call will require an instance of the translator
* for each value that is to be inserted into the ring buffer.
* for each value that is to be inserted into the ring buffer.</p>
*
* @param translators The user specified translation for each event
* @param batchStartsAt The first element of the array which is within the batch.
Expand Down Expand Up @@ -174,6 +186,7 @@ public interface EventSink<E>
/**
* Allows one user supplied argument per event.
*
* @param <A> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 A user supplied argument.
* @see #publishEvents(com.lmax.disruptor.EventTranslator[])
Expand All @@ -183,6 +196,7 @@ public interface EventSink<E>
/**
* Allows one user supplied argument per event.
*
* @param <A> Class of the user supplied argument
* @param translator The user specified translation for each event
* @param batchStartsAt The first element of the array which is within the batch.
* @param batchSize The actual size of the batch
Expand All @@ -194,6 +208,7 @@ public interface EventSink<E>
/**
* Allows one user supplied argument.
*
* @param <A> Class of the user supplied argument
* @param translator The user specified translation for each event
* @param arg0 An array of user supplied arguments, one element per event.
* @return true if the value was published, false if there was insufficient
Expand All @@ -205,6 +220,7 @@ public interface EventSink<E>
/**
* Allows one user supplied argument.
*
* @param <A> Class of the user supplied argument
* @param translator The user specified translation for each event
* @param batchStartsAt The first element of the array which is within the batch.
* @param batchSize The actual size of the batch
Expand All @@ -218,6 +234,8 @@ public interface EventSink<E>
/**
* Allows two user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 An array of user supplied arguments, one element per event.
* @param arg1 An array of user supplied arguments, one element per event.
Expand All @@ -228,6 +246,8 @@ public interface EventSink<E>
/**
* Allows two user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param batchStartsAt The first element of the array which is within the batch.
* @param batchSize The actual size of the batch.
Expand All @@ -242,6 +262,8 @@ <A, B> void publishEvents(
/**
* Allows two user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 An array of user supplied arguments, one element per event.
* @param arg1 An array of user supplied arguments, one element per event.
Expand All @@ -254,6 +276,8 @@ <A, B> void publishEvents(
/**
* Allows two user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param batchStartsAt The first element of the array which is within the batch.
* @param batchSize The actual size of the batch.
Expand All @@ -270,6 +294,9 @@ <A, B> boolean tryPublishEvents(
/**
* Allows three user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param <C> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 An array of user supplied arguments, one element per event.
* @param arg1 An array of user supplied arguments, one element per event.
Expand All @@ -281,6 +308,9 @@ <A, B> boolean tryPublishEvents(
/**
* Allows three user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param <C> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param batchStartsAt The first element of the array which is within the batch.
* @param batchSize The number of elements in the batch.
Expand All @@ -296,6 +326,9 @@ <A, B, C> void publishEvents(
/**
* Allows three user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param <C> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param arg0 An array of user supplied arguments, one element per event.
* @param arg1 An array of user supplied arguments, one element per event.
Expand All @@ -309,6 +342,9 @@ <A, B, C> void publishEvents(
/**
* Allows three user supplied arguments per event.
*
* @param <A> Class of the user supplied argument
* @param <B> Class of the user supplied argument
* @param <C> Class of the user supplied argument
* @param translator The user specified translation for the event
* @param batchStartsAt The first element of the array which is within the batch.
* @param batchSize The actual size of the batch.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/lmax/disruptor/EventTranslator.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* <p>Implementations translate (write) data representations into events claimed from the {@link RingBuffer}.</p>
* <p>
*
* <p>When publishing to the RingBuffer, provide an EventTranslator. The RingBuffer will select the next available
* event by sequence and provide it to the EventTranslator (which should update the event), before publishing
* the sequence update.</p>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/lmax/disruptor/ExceptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface ExceptionHandler<T>
{
/**
* <p>Strategy for handling uncaught exceptions when processing an event.</p>
* <p>
*
* <p>If the strategy wishes to terminate further processing by the {@link BatchEventProcessor}
* then it should throw a {@link RuntimeException}.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
/**
* <p>Exception thrown when it is not possible to insert a value into
* the ring buffer without it wrapping the consuming sequences. Used
* specifically when claiming with the {@link RingBuffer#tryNext()} call.
* <p>
* <p>For efficiency this exception will not have a stack trace.
* specifically when claiming with the {@link RingBuffer#tryNext()} call.</p>
*
* <p>For efficiency this exception will not have a stack trace.</p>
*/
@SuppressWarnings("serial")
public final class InsufficientCapacityException extends Exception
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/lmax/disruptor/MultiProducerSequencer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
/**
* <p>Coordinator for claiming sequences for access to a data structure while tracking dependent {@link Sequence}s.
* Suitable for use for sequencing across multiple publisher threads.</p>
* <p>
* <p> * <p>Note on {@link Sequencer#getCursor()}: With this sequencer the cursor value is updated after the call
*
* <p> * Note on {@link Sequencer#getCursor()}: With this sequencer the cursor value is updated after the call
* to {@link Sequencer#next()}, to determine the highest available sequence that can be read, then
* {@link Sequencer#getHighestPublishedSequence(long, long)} should be used.
* {@link Sequencer#getHighestPublishedSequence(long, long)} should be used.</p>
*/
public final class MultiProducerSequencer extends AbstractSequencer
{
Expand Down
23 changes: 19 additions & 4 deletions src/main/java/com/lmax/disruptor/PhasedBackoffWaitStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
* <p>Phased wait strategy for waiting {@link EventProcessor}s on a barrier.</p>
* <p>
*
* <p>This strategy can be used when throughput and low-latency are not as important as CPU resource.
* Spins, then yields, then waits using the configured fallback WaitStrategy.</p>
*/
Expand All @@ -42,7 +42,12 @@ public PhasedBackoffWaitStrategy(
}

/**
* Block with wait/notifyAll semantics
* Construct {@link PhasedBackoffWaitStrategy} with fallback to {@link BlockingWaitStrategy}
*
* @param spinTimeout The maximum time in to busy spin for.
* @param yieldTimeout The maximum time in to yield for.
* @param units Time units used for the timeout values.
* @return The constructed wait strategy.
*/
public static PhasedBackoffWaitStrategy withLock(
long spinTimeout,
Expand All @@ -55,7 +60,12 @@ public static PhasedBackoffWaitStrategy withLock(
}

/**
* Block with wait/notifyAll semantics
* Construct {@link PhasedBackoffWaitStrategy} with fallback to {@link LiteBlockingWaitStrategy}
*
* @param spinTimeout The maximum time in to busy spin for.
* @param yieldTimeout The maximum time in to yield for.
* @param units Time units used for the timeout values.
* @return The constructed wait strategy.
*/
public static PhasedBackoffWaitStrategy withLiteLock(
long spinTimeout,
Expand All @@ -68,7 +78,12 @@ public static PhasedBackoffWaitStrategy withLiteLock(
}

/**
* Block by sleeping in a loop
* Construct {@link PhasedBackoffWaitStrategy} with fallback to {@link SleepingWaitStrategy}
*
* @param spinTimeout The maximum time in to busy spin for.
* @param yieldTimeout The maximum time in to yield for.
* @param units Time units used for the timeout values.
* @return The constructed wait strategy.
*/
public static PhasedBackoffWaitStrategy withSleep(
long spinTimeout,
Expand Down
Loading

0 comments on commit eff62d4

Please sign in to comment.