org.apache.avro.ipc.trace
Class InMemorySpanStorage

java.lang.Object
  extended by org.apache.avro.ipc.trace.InMemorySpanStorage
All Implemented Interfaces:
SpanStorage

public class InMemorySpanStorage
extends Object
implements SpanStorage

Example implementation of SpanStorage which keeps spans in memory. This is designed as a prototype for demonstration and testing. It should not be used in production settings.


Field Summary
protected  LinkedList<Span> spans
           
 
Fields inherited from interface org.apache.avro.ipc.trace.SpanStorage
MILLIS_PER_SECOND, NANOS_PER_SECOND
 
Constructor Summary
InMemorySpanStorage()
           
 
Method Summary
 void addSpan(Span s)
          Add a span.
 List<Span> getAllSpans()
          Return a list of all spans currently stored.
 List<Span> getSpansInRange(long start, long end)
          Return a list of all spans that fall within the time given range.
 void setMaxSpans(long maxSpans)
          Set the maximum number of spans to have in storage at any given time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spans

protected LinkedList<Span> spans
Constructor Detail

InMemorySpanStorage

public InMemorySpanStorage()
Method Detail

addSpan

public void addSpan(Span s)
Description copied from interface: SpanStorage
Add a span.

Specified by:
addSpan in interface SpanStorage

setMaxSpans

public void setMaxSpans(long maxSpans)
Description copied from interface: SpanStorage
Set the maximum number of spans to have in storage at any given time.

Specified by:
setMaxSpans in interface SpanStorage

getAllSpans

public List<Span> getAllSpans()
Description copied from interface: SpanStorage
Return a list of all spans currently stored. For testing.

Specified by:
getAllSpans in interface SpanStorage

getSpansInRange

public List<Span> getSpansInRange(long start,
                                  long end)
Description copied from interface: SpanStorage
Return a list of all spans that fall within the time given range.

Specified by:
getSpansInRange in interface SpanStorage
Parameters:
start - UNIX time (in nanoseconds) as a long
end - UNIX time (in nanoseconds) as a long


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.