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 defaultmaxSegmentSizeof 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 intgetMaxSegmentSize()booleanrequiresStreaming(Segment segment)Determines whether or not the provided segment requires any subsegment streaming.voidstreamSome(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 defaultmaxSegmentSizeof 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 beforerequiresStreamingwill return true- Throws:
java.lang.IllegalArgumentException- whenmaxSegmentSizeis 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:
requiresStreamingin 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:
streamSomein 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)
-
-