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 voidaddPrecursorId(java.lang.String precursorId)voidclose()Implements theAutoCloseableinterface.booleanend()Ends the subsegment.@Nullable java.lang.StringgetNamespace()SegmentgetParentSegment()java.util.Set<java.lang.String>getPrecursorIds()SamplingStrategyOverridegetSamplingStrategyOverride()booleanisRecording()static SubsegmentnoOp(AWSXRayRecorder recorder)static SubsegmentnoOp(AWSXRayRecorder recorder, boolean shouldPropagate)static SubsegmentnoOp(AWSXRayRecorder recorder, boolean shouldPropagate, SamplingStrategyOverride samplingStrategyOverride)Deprecated.static SubsegmentnoOp(Segment parent, AWSXRayRecorder recorder)static SubsegmentnoOp(Segment parent, AWSXRayRecorder recorder, SamplingStrategyOverride samplingStrategyOverride)Deprecated.static SubsegmentnoOp(Segment parent, AWSXRayRecorder recorder, java.lang.String name)java.lang.StringprettyStreamSerialize()Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.voidsetNamespace(java.lang.String namespace)voidsetParentSegment(Segment parentSegment)voidsetPrecursorIds(java.util.Set<java.lang.String> precursorIds)voidsetSampledFalse()booleanshouldPropagate()Determines if this subsegment should propagate its trace context downstreamjava.lang.StringstreamSerialize()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:
getNamespacein interfaceEntity- Returns:
- the namespace
-
setNamespace
void setNamespace(java.lang.String namespace)
- Specified by:
setNamespacein interfaceEntity- Parameters:
namespace- the namespace to set
-
getParentSegment
Segment getParentSegment()
- Specified by:
getParentSegmentin 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 theAutoCloseableinterface. Warning. This method is intended to be private to the xray library and should not be used externally. Instead, useAWSXRay.endSubsegment(Subsegment).- Specified by:
closein interfacejava.lang.AutoCloseable
-
isRecording
boolean isRecording()
-
setSampledFalse
void setSampledFalse()
-
getSamplingStrategyOverride
SamplingStrategyOverride getSamplingStrategyOverride()
-
-