Package com.amazonaws.xray.strategy
Class DefaultStreamingStrategy
java.lang.Object
com.amazonaws.xray.strategy.DefaultStreamingStrategy
- All Implemented Interfaces:
StreamingStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an instance of DefaultStreamingStrategy using the defaultmaxSegmentSize
of 100.DefaultStreamingStrategy
(int maxSegmentSize) Constructs an instance of DefaultStreamingStrategy using the providedmaxSegmentSize
. -
Method Summary
Modifier and TypeMethodDescriptionint
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 Details
-
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:
IllegalArgumentException
- whenmaxSegmentSize
is a negative integer
-
-
Method Details
-
getMaxSegmentSize
public int getMaxSegmentSize() -
requiresStreaming
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:
-
streamSome
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:
-