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 default maxSegmentSize of 100.
    DefaultStreamingStrategy​(int maxSegmentSize)
    Constructs an instance of DefaultStreamingStrategy using the provided maxSegmentSize.
  • Method Summary

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultStreamingStrategy

      public DefaultStreamingStrategy()
      Constructs an instance of DefaultStreamingStrategy using the default maxSegmentSize of 100.
    • DefaultStreamingStrategy

      public DefaultStreamingStrategy​(int maxSegmentSize)
      Constructs an instance of DefaultStreamingStrategy using the provided maxSegmentSize.
      Parameters:
      maxSegmentSize - the maximum number of subsegment nodes a segment tree may have before requiresStreaming will return true
      Throws:
      java.lang.IllegalArgumentException - when maxSegmentSize is a negative integer
  • Method Details

    • 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 than maxSegmentSize.
      Specified by:
      requiresStreaming in interface StreamingStrategy
      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 interface StreamingStrategy
      Parameters:
      entity - the segment or subsegment to stream children from
      emitter - the emitter to send the child subsegments to
      See Also:
      StreamingStrategy.streamSome(Entity,Emitter)