Package com.amazonaws.xray.entities
Class SubsegmentImpl
java.lang.Object
com.amazonaws.xray.entities.EntityImpl
com.amazonaws.xray.entities.SubsegmentImpl
- All Implemented Interfaces:
Entity
,Subsegment
,AutoCloseable
-
Field Summary
Fields inherited from class com.amazonaws.xray.entities.EntityImpl
mapper, referenceCount, totalSize
-
Constructor Summary
ConstructorsConstructorDescriptionSubsegmentImpl
(AWSXRayRecorder creator, String name, Segment parentSegment) SubsegmentImpl
(AWSXRayRecorder creator, String name, Segment parentSegment, SamplingStrategyOverride samplingStrategyOverride) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPrecursorId
(String precursorId) void
close()
Implements theAutoCloseable
interface.boolean
end()
Ends the subsegment.@Nullable String
Deprecated.boolean
boolean
Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.void
setNamespace
(String namespace) void
setParentSegment
(Segment parentSegment) void
setPrecursorIds
(Set<String> precursorIds) void
boolean
Determines if this subsegment should propagate its trace context downstreamSerializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.Methods inherited from class com.amazonaws.xray.entities.EntityImpl
addException, addSubsegment, checkAlreadyEmitted, compareAndSetEmitted, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsCopy, getSubsegmentsLock, getTotalSize, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, isThrottle, prettySerialize, putAllAws, putAllHttp, putAllSql, putAnnotation, putAnnotation, putAnnotation, putAws, putHttp, putMetadata, putMetadata, putSql, removeSubsegment, serialize, setAnnotations, setAws, setCreator, setEmitted, setEndTime, setError, setFault, setHttp, setId, setInProgress, setMetadata, setParent, setParentId, setSql, setStartTime, setSubsegmentsLock, setThrottle, setTraceId, validateNotNull
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, 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
-
Constructor Details
-
SubsegmentImpl
-
SubsegmentImpl
@Deprecated public SubsegmentImpl(AWSXRayRecorder creator, String name, Segment parentSegment, SamplingStrategyOverride samplingStrategyOverride) Deprecated.
-
-
Method Details
-
end
public boolean end()Description copied from interface:Subsegment
Ends the subsegment. Sets the end time to the current time. Sets inProgress to false. Decrements its parent segment's segment-reference counter.- Specified by:
end
in interfaceSubsegment
- Returns:
- true if 1) the parent segment now has a ref. count of zero and 2) the parent segment is sampled
-
getTraceId
- Specified by:
getTraceId
in interfaceEntity
- Overrides:
getTraceId
in classEntityImpl
- Returns:
- the traceId
-
getNamespace
- Specified by:
getNamespace
in interfaceEntity
- Specified by:
getNamespace
in interfaceSubsegment
- Overrides:
getNamespace
in classEntityImpl
- Returns:
- the namespace
-
setNamespace
- Specified by:
setNamespace
in interfaceEntity
- Specified by:
setNamespace
in interfaceSubsegment
- Overrides:
setNamespace
in classEntityImpl
- Parameters:
namespace
- the namespace to set
-
getParentSegment
- Specified by:
getParentSegment
in interfaceEntity
- Specified by:
getParentSegment
in interfaceSubsegment
- Specified by:
getParentSegment
in classEntityImpl
- Returns:
- the parentSegment
-
setParentSegment
- Specified by:
setParentSegment
in interfaceSubsegment
- Parameters:
parentSegment
- the parentSegment to set
-
addPrecursorId
- Specified by:
addPrecursorId
in interfaceSubsegment
- Parameters:
precursorId
- the precursor ID to add to the set
-
getPrecursorIds
- Specified by:
getPrecursorIds
in interfaceSubsegment
- Returns:
- the precursorIds
-
setPrecursorIds
- Specified by:
setPrecursorIds
in interfaceSubsegment
- Parameters:
precursorIds
- the precursorIds to set
-
shouldPropagate
public boolean shouldPropagate()Description copied from interface:Subsegment
Determines if this subsegment should propagate its trace context downstream- Specified by:
shouldPropagate
in interfaceSubsegment
- Returns:
- true if its trace context should be propagated downstream, false otherwise
-
streamSerialize
Description copied from interface:Subsegment
Serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.- Specified by:
streamSerialize
in interfaceSubsegment
- Returns:
- the string representation of the subsegment with enough information for it to be streamed
-
prettyStreamSerialize
Description copied from interface:Subsegment
Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own. Only used for debugging.- Specified by:
prettyStreamSerialize
in interfaceSubsegment
- Returns:
- the pretty string representation of the subsegment with enough information for it to be streamed
-
close
public void close()Description copied from interface:Subsegment
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 interfaceAutoCloseable
- Specified by:
close
in interfaceSubsegment
-
isSampled
public boolean isSampled() -
isRecording
public boolean isRecording()- Specified by:
isRecording
in interfaceSubsegment
-
setSampledFalse
public void setSampledFalse()- Specified by:
setSampledFalse
in interfaceSubsegment
-
getSamplingStrategyOverride
Deprecated.- Specified by:
getSamplingStrategyOverride
in interfaceSubsegment
-