Package com.amazonaws.xray.strategy
Class DefaultStreamingStrategy
- java.lang.Object
-
- com.amazonaws.xray.strategy.DefaultStreamingStrategy
-
- All Implemented Interfaces:
StreamingStrategy
public class DefaultStreamingStrategy extends java.lang.Object implements StreamingStrategy
-
-
Constructor Summary
Constructors Constructor Description DefaultStreamingStrategy()
Constructs an instance of DefaultStreamingStrategy using the defaultmaxSegmentSize
of 100.DefaultStreamingStrategy(int maxSegmentSize)
Constructs an instance of DefaultStreamingStrategy using the providedmaxSegmentSize
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaxSegmentSize()
boolean
requiresStreaming(Segment segment)
Determines whether or not the provided segment requires any subsegment streaming.void
streamSome(Entity entity, Emitter emitter)
Streams (and removes) some subsegment children from the provided segment or subsegment.
-
-
-
Constructor Detail
-
DefaultStreamingStrategy
public DefaultStreamingStrategy()
Constructs an instance of DefaultStreamingStrategy using the defaultmaxSegmentSize
of 100.
-
DefaultStreamingStrategy
public DefaultStreamingStrategy(int maxSegmentSize)
Constructs an instance of DefaultStreamingStrategy using the providedmaxSegmentSize
.- Parameters:
maxSegmentSize
- the maximum number of subsegment nodes a segment tree may have beforerequiresStreaming
will return true- Throws:
java.lang.IllegalArgumentException
- whenmaxSegmentSize
is a negative integer
-
-
Method Detail
-
getMaxSegmentSize
public int getMaxSegmentSize()
-
requiresStreaming
public boolean requiresStreaming(Segment segment)
Determines whether or not the provided segment requires any subsegment streaming. Indicates that the provided segment requires streaming when it has been marked for sampling and its tree of subsegments reaches a size greater thanmaxSegmentSize
.- Specified by:
requiresStreaming
in interfaceStreamingStrategy
- Parameters:
segment
- the segment to inspect- Returns:
- true if the segment should be streaming.
- See Also:
StreamingStrategy.requiresStreaming(Segment)
-
streamSome
public void streamSome(Entity entity, Emitter emitter)
Streams (and removes) some subsegment children from the provided segment or subsegment. Performs Subtree Subsegment Streaming to stream completed subsegment subtrees. Serializes these subtrees of subsegments, streams them to the daemon, and removes them from their parents.- Specified by:
streamSome
in interfaceStreamingStrategy
- Parameters:
entity
- the segment or subsegment to stream children fromemitter
- the emitter to send the child subsegments to- See Also:
StreamingStrategy.streamSome(Entity,Emitter)
-
-