Skip to content

Commit

Permalink
Add some javadoc to the new ExecutorServiceSpanProcessor & builder. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwatson authored Apr 23, 2021
1 parent ccb03c8 commit 005b8c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
import java.util.logging.Logger;
import org.jctools.queues.MpscArrayQueue;

/**
* A Batch {@link SpanProcessor} that uses a user-provided {@link
* java.util.concurrent.ScheduledExecutorService} to run background tasks.
*/
@SuppressWarnings("FutureReturnValueIgnored")
public final class ExecutorServiceSpanProcessor implements SpanProcessor {

Expand All @@ -46,6 +50,15 @@ public final class ExecutorServiceSpanProcessor implements SpanProcessor {
private final boolean ownsExecutorService;
private final ScheduledExecutorService executorService;

/**
* Create a new {@link ExecutorServiceSpanProcessorBuilder} with the required components.
*
* @param spanExporter The {@link SpanExporter} to be used for exports.
* @param executorService The {@link ScheduledExecutorService} for running background tasks.
* @param ownsExecutorService Whether this component can be considered the "owner" of the provided
* {@link ScheduledExecutorService}. If true, the {@link ScheduledExecutorService} will be
* shut down when this SpanProcessor is shut down.
*/
public static ExecutorServiceSpanProcessorBuilder builder(
SpanExporter spanExporter,
ScheduledExecutorService executorService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
* Builder class for the {@link ExecutorServiceSpanProcessor}.
*
* @see ExecutorServiceSpanProcessor#builder(SpanExporter, ScheduledExecutorService, boolean)
*/
public class ExecutorServiceSpanProcessorBuilder {

// Visible for testing
Expand Down

0 comments on commit 005b8c9

Please sign in to comment.