Package com.amazonaws.xray.entities
Interface Subsegment
-
- All Superinterfaces:
java.lang.AutoCloseable
,Entity
- All Known Implementing Classes:
DummySubsegment
,SubsegmentImpl
public interface Subsegment extends Entity
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addPrecursorId(java.lang.String precursorId)
void
close()
Implements theAutoCloseable
interface.boolean
end()
Ends the subsegment.@Nullable java.lang.String
getNamespace()
Segment
getParentSegment()
java.util.Set<java.lang.String>
getPrecursorIds()
SamplingStrategyOverride
getSamplingStrategyOverride()
boolean
isRecording()
static Subsegment
noOp(AWSXRayRecorder recorder)
static Subsegment
noOp(AWSXRayRecorder recorder, boolean shouldPropagate)
static Subsegment
noOp(AWSXRayRecorder recorder, boolean shouldPropagate, SamplingStrategyOverride samplingStrategyOverride)
Deprecated.static Subsegment
noOp(Segment parent, AWSXRayRecorder recorder)
static Subsegment
noOp(Segment parent, AWSXRayRecorder recorder, SamplingStrategyOverride samplingStrategyOverride)
Deprecated.static Subsegment
noOp(Segment parent, AWSXRayRecorder recorder, java.lang.String name)
java.lang.String
prettyStreamSerialize()
Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.void
setNamespace(java.lang.String namespace)
void
setParentSegment(Segment parentSegment)
void
setPrecursorIds(java.util.Set<java.lang.String> precursorIds)
void
setSampledFalse()
boolean
shouldPropagate()
Determines if this subsegment should propagate its trace context downstreamjava.lang.String
streamSerialize()
Serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.-
Methods inherited from interface com.amazonaws.xray.entities.Entity
addException, addSubsegment, compareAndSetEmitted, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsCopy, getSubsegmentsLock, getTotalSize, getTraceId, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, isSampled, isThrottle, prettySerialize, putAllAws, putAllHttp, putAllSql, putAnnotation, putAnnotation, putAnnotation, putAws, putHttp, putMetadata, putMetadata, putSql, removeSubsegment, run, run, serialize, setAnnotations, setAws, setCreator, setEmitted, setEndTime, setError, setFault, setHttp, setId, setInProgress, setMetadata, setParent, setParentId, setSql, setStartTime, setSubsegmentsLock, setThrottle, setTraceId
-
-
-
-
Method Detail
-
noOp
static Subsegment noOp(AWSXRayRecorder recorder)
-
noOp
@Deprecated static Subsegment noOp(AWSXRayRecorder recorder, boolean shouldPropagate, SamplingStrategyOverride samplingStrategyOverride)
Deprecated.
-
noOp
@Deprecated static Subsegment noOp(Segment parent, AWSXRayRecorder recorder, SamplingStrategyOverride samplingStrategyOverride)
Deprecated.
-
noOp
static Subsegment noOp(AWSXRayRecorder recorder, boolean shouldPropagate)
-
noOp
static Subsegment noOp(Segment parent, AWSXRayRecorder recorder, java.lang.String name)
-
noOp
static Subsegment noOp(Segment parent, AWSXRayRecorder recorder)
-
end
boolean end()
Ends the subsegment. Sets the end time to the current time. Sets inProgress to false. Decrements its parent segment's segment-reference counter.- Returns:
- true if 1) the parent segment now has a ref. count of zero and 2) the parent segment is sampled
-
getNamespace
@Nullable java.lang.String getNamespace()
- Specified by:
getNamespace
in interfaceEntity
- Returns:
- the namespace
-
setNamespace
void setNamespace(java.lang.String namespace)
- Specified by:
setNamespace
in interfaceEntity
- Parameters:
namespace
- the namespace to set
-
getParentSegment
Segment getParentSegment()
- Specified by:
getParentSegment
in interfaceEntity
- Returns:
- the parentSegment
-
setParentSegment
void setParentSegment(Segment parentSegment)
- Parameters:
parentSegment
- the parentSegment to set
-
getPrecursorIds
java.util.Set<java.lang.String> getPrecursorIds()
- Returns:
- the precursorIds
-
setPrecursorIds
void setPrecursorIds(java.util.Set<java.lang.String> precursorIds)
- Parameters:
precursorIds
- the precursorIds to set
-
addPrecursorId
void addPrecursorId(java.lang.String precursorId)
- Parameters:
precursorId
- the precursor ID to add to the set
-
shouldPropagate
boolean shouldPropagate()
Determines if this subsegment should propagate its trace context downstream- Returns:
- true if its trace context should be propagated downstream, false otherwise
-
streamSerialize
java.lang.String streamSerialize()
Serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.- Returns:
- the string representation of the subsegment with enough information for it to be streamed
-
prettyStreamSerialize
java.lang.String prettyStreamSerialize()
Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own. Only used for debugging.- Returns:
- the pretty string representation of the subsegment with enough information for it to be streamed
-
close
void close()
Implements theAutoCloseable
interface. Warning. This method is intended to be private to the xray library and should not be used externally. Instead, useAWSXRay.endSubsegment(Subsegment)
.- Specified by:
close
in interfacejava.lang.AutoCloseable
-
isRecording
boolean isRecording()
-
setSampledFalse
void setSampledFalse()
-
getSamplingStrategyOverride
SamplingStrategyOverride getSamplingStrategyOverride()
-
-