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 Modifier and Type Method Description void
addPrecursorId(java.lang.String precursorId)
void
close()
boolean
end()
Ends the subsegment.@Nullable java.lang.String
getNamespace()
Segment
getParentSegment()
java.util.Set<java.lang.String>
getPrecursorIds()
static Subsegment
noOp(AWSXRayRecorder recorder, boolean shouldPropagate)
static Subsegment
noOp(Segment parent, AWSXRayRecorder recorder)
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)
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, 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, boolean shouldPropagate)
-
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 enouogh 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 enouogh information for it to be streamed
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-