-
- All Implemented Interfaces:
-
com.datadog.trace.common.writer.Writer,java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,java.util.RandomAccess,java.util.SequencedCollection
public class ListWriter extends CopyOnWriteArrayList<List<DDSpan>> implements Writer
List writer used by tests mostly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceListWriter.FilterInterface for filtering out select traces from being written.
-
Field Summary
Fields Modifier and Type Field Description public final static ListWriter.FilterACCEPT_ALLprivate final AtomicIntegertraceCountprivate ListWriter.Filterfilter
-
Method Summary
Modifier and Type Method Description AtomicIntegergetTraceCount()voidsetFilter(ListWriter.Filter filter)Set a filter to be applied to all incoming traces to determine whether they should be writtenor not. List<DDSpan>firstTrace()List<DDSpan>secondTrace()voidwrite(List<DDSpan> trace)Write a trace represented by the entire list of all the finished spans booleanwaitForTracesMax(int number, int seconds)voidwaitForTraces(int number)voidwaitUntilReported(DDSpan span)voidwaitUntilReported(DDSpan span, int timeout, TimeUnit unit)voidincrementDropCounts(int spanCount)Count that a trace was captured for stats, but without reporting it. voidstart()Start the writer booleanflush()Requests the writer to send all finished traces and block until complete. voidclose()Indicates to the writer that no future writing will come and it should terminates allconnections and tasks StringtoString()-
Methods inherited from class java.util.concurrent.CopyOnWriteArrayList
add, add, addAll, addAllAbsent, addFirst, addIfAbsent, addLast, clear, clone, contains, containsAll, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray, toString -
Methods inherited from class java.util.List
copyOf, of -
Methods inherited from class java.util.SequencedCollection
reversed -
Methods inherited from class java.util.Collection
parallelStream, stream -
Methods inherited from class java.lang.Iterable
iterator, spliterator -
Methods inherited from class java.io.Closeable
close -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getTraceCount
AtomicInteger getTraceCount()
-
setFilter
void setFilter(ListWriter.Filter filter)
Set a filter to be applied to all incoming traces to determine whether they should be writtenor not.
-
firstTrace
List<DDSpan> firstTrace()
-
secondTrace
List<DDSpan> secondTrace()
-
write
void write(List<DDSpan> trace)
Write a trace represented by the entire list of all the finished spans
- Parameters:
trace- the list of spans to write
-
waitForTracesMax
boolean waitForTracesMax(int number, int seconds)
-
waitForTraces
void waitForTraces(int number)
-
waitUntilReported
void waitUntilReported(DDSpan span)
-
waitUntilReported
void waitUntilReported(DDSpan span, int timeout, TimeUnit unit)
-
incrementDropCounts
void incrementDropCounts(int spanCount)
Count that a trace was captured for stats, but without reporting it.
-
start
void start()
Start the writer
-
flush
boolean flush()
Requests the writer to send all finished traces and block until complete.
-
close
void close()
Indicates to the writer that no future writing will come and it should terminates allconnections and tasks
-
-
-
-