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,java.lang.AutoCloseable
public class SubsegmentImpl extends EntityImpl implements Subsegment
-
-
Field Summary
-
Fields inherited from class com.amazonaws.xray.entities.EntityImpl
lock, mapper, referenceCount, totalSize
-
-
Constructor Summary
Constructors Constructor Description SubsegmentImpl(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPrecursorId(java.lang.String precursorId)voidclose()booleanend()Ends the subsegment.@Nullable java.lang.StringgetNamespace()SegmentgetParentSegment()java.util.Set<java.lang.String>getPrecursorIds()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)java.lang.StringstreamSerialize()Serializes 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, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsLock, getTotalSize, getTraceId, 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, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, 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
-
-
-
-
Constructor Detail
-
SubsegmentImpl
public SubsegmentImpl(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment)
-
-
Method Detail
-
end
public boolean end()
Description copied from interface:SubsegmentEnds the subsegment. Sets the end time to the current time. Sets inProgress to false. Decrements its parent segment's segment-reference counter.- Specified by:
endin interfaceSubsegment- Returns:
- true if 1) the parent segment now has a ref. count of zero and 2) the parent segment is sampled
-
getNamespace
public @Nullable java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceEntity- Specified by:
getNamespacein interfaceSubsegment- Overrides:
getNamespacein classEntityImpl- Returns:
- the namespace
-
setNamespace
public void setNamespace(java.lang.String namespace)
- Specified by:
setNamespacein interfaceEntity- Specified by:
setNamespacein interfaceSubsegment- Overrides:
setNamespacein classEntityImpl- Parameters:
namespace- the namespace to set
-
getParentSegment
public Segment getParentSegment()
- Specified by:
getParentSegmentin interfaceEntity- Specified by:
getParentSegmentin interfaceSubsegment- Specified by:
getParentSegmentin classEntityImpl- Returns:
- the parentSegment
-
setParentSegment
public void setParentSegment(Segment parentSegment)
- Specified by:
setParentSegmentin interfaceSubsegment- Parameters:
parentSegment- the parentSegment to set
-
addPrecursorId
public void addPrecursorId(java.lang.String precursorId)
- Specified by:
addPrecursorIdin interfaceSubsegment- Parameters:
precursorId- the precursor ID to add to the set
-
getPrecursorIds
public java.util.Set<java.lang.String> getPrecursorIds()
- Specified by:
getPrecursorIdsin interfaceSubsegment- Returns:
- the precursorIds
-
setPrecursorIds
public void setPrecursorIds(java.util.Set<java.lang.String> precursorIds)
- Specified by:
setPrecursorIdsin interfaceSubsegment- Parameters:
precursorIds- the precursorIds to set
-
streamSerialize
public java.lang.String streamSerialize()
Description copied from interface:SubsegmentSerializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.- Specified by:
streamSerializein interfaceSubsegment- Returns:
- the string representation of the subsegment with enouogh information for it to be streamed
-
prettyStreamSerialize
public java.lang.String prettyStreamSerialize()
Description copied from interface:SubsegmentPretty-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:
prettyStreamSerializein interfaceSubsegment- Returns:
- the pretty string representation of the subsegment with enouogh information for it to be streamed
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceSubsegment
-
-