Class SegmentObject.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderType>
com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
org.apache.skywalking.apm.network.language.agent.v3.SegmentObject.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable, SegmentObjectOrBuilder
Enclosing class:
SegmentObject

public static final class SegmentObject.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder> implements SegmentObjectOrBuilder
 The segment is a collection of spans. It includes all collected spans in a simple one request context, such as a HTTP request process.
 We recommend the agent/SDK report all tracked data of one request once for all.
 Typically, such as in Java, one segment represent all tracked operations(spans) of one request context in the same thread.
 At the same time, in some language there is not a clear `thread` concept like golang.
 Then, it could represent all tracked operations of one request context cross threads/goroutines.
 
Protobuf type skywalking.v3.SegmentObject
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • clear

      public SegmentObject.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • getDefaultInstanceForType

      public SegmentObject getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public SegmentObject build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public SegmentObject buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public SegmentObject.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • setField

      public SegmentObject.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • clearField

      public SegmentObject.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • clearOneof

      public SegmentObject.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • setRepeatedField

      public SegmentObject.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • addRepeatedField

      public SegmentObject.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • mergeFrom

      public SegmentObject.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SegmentObject.Builder>
    • mergeFrom

      public SegmentObject.Builder mergeFrom(SegmentObject other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • mergeFrom

      public SegmentObject.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SegmentObject.Builder>
      Throws:
      IOException
    • getTraceId

      public String getTraceId()
       A string id represents the whole trace.
       
      string traceId = 1;
      Specified by:
      getTraceId in interface SegmentObjectOrBuilder
      Returns:
      The traceId.
    • getTraceIdBytes

      public com.google.protobuf.ByteString getTraceIdBytes()
       A string id represents the whole trace.
       
      string traceId = 1;
      Specified by:
      getTraceIdBytes in interface SegmentObjectOrBuilder
      Returns:
      The bytes for traceId.
    • setTraceId

      public SegmentObject.Builder setTraceId(String value)
       A string id represents the whole trace.
       
      string traceId = 1;
      Parameters:
      value - The traceId to set.
      Returns:
      This builder for chaining.
    • clearTraceId

      public SegmentObject.Builder clearTraceId()
       A string id represents the whole trace.
       
      string traceId = 1;
      Returns:
      This builder for chaining.
    • setTraceIdBytes

      public SegmentObject.Builder setTraceIdBytes(com.google.protobuf.ByteString value)
       A string id represents the whole trace.
       
      string traceId = 1;
      Parameters:
      value - The bytes for traceId to set.
      Returns:
      This builder for chaining.
    • getTraceSegmentId

      public String getTraceSegmentId()
       A unique id represents this segment. Other segments could use this id to reference as a child segment.
       
      string traceSegmentId = 2;
      Specified by:
      getTraceSegmentId in interface SegmentObjectOrBuilder
      Returns:
      The traceSegmentId.
    • getTraceSegmentIdBytes

      public com.google.protobuf.ByteString getTraceSegmentIdBytes()
       A unique id represents this segment. Other segments could use this id to reference as a child segment.
       
      string traceSegmentId = 2;
      Specified by:
      getTraceSegmentIdBytes in interface SegmentObjectOrBuilder
      Returns:
      The bytes for traceSegmentId.
    • setTraceSegmentId

      public SegmentObject.Builder setTraceSegmentId(String value)
       A unique id represents this segment. Other segments could use this id to reference as a child segment.
       
      string traceSegmentId = 2;
      Parameters:
      value - The traceSegmentId to set.
      Returns:
      This builder for chaining.
    • clearTraceSegmentId

      public SegmentObject.Builder clearTraceSegmentId()
       A unique id represents this segment. Other segments could use this id to reference as a child segment.
       
      string traceSegmentId = 2;
      Returns:
      This builder for chaining.
    • setTraceSegmentIdBytes

      public SegmentObject.Builder setTraceSegmentIdBytes(com.google.protobuf.ByteString value)
       A unique id represents this segment. Other segments could use this id to reference as a child segment.
       
      string traceSegmentId = 2;
      Parameters:
      value - The bytes for traceSegmentId to set.
      Returns:
      This builder for chaining.
    • getSpansList

      public List<SpanObject> getSpansList()
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
      Specified by:
      getSpansList in interface SegmentObjectOrBuilder
    • getSpansCount

      public int getSpansCount()
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
      Specified by:
      getSpansCount in interface SegmentObjectOrBuilder
    • getSpans

      public SpanObject getSpans(int index)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
      Specified by:
      getSpans in interface SegmentObjectOrBuilder
    • setSpans

      public SegmentObject.Builder setSpans(int index, SpanObject value)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • setSpans

      public SegmentObject.Builder setSpans(int index, SpanObject.Builder builderForValue)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • addSpans

      public SegmentObject.Builder addSpans(SpanObject value)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • addSpans

      public SegmentObject.Builder addSpans(int index, SpanObject value)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • addSpans

      public SegmentObject.Builder addSpans(SpanObject.Builder builderForValue)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • addSpans

      public SegmentObject.Builder addSpans(int index, SpanObject.Builder builderForValue)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • addAllSpans

      public SegmentObject.Builder addAllSpans(Iterable<? extends SpanObject> values)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • clearSpans

      public SegmentObject.Builder clearSpans()
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • removeSpans

      public SegmentObject.Builder removeSpans(int index)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • getSpansBuilder

      public SpanObject.Builder getSpansBuilder(int index)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • getSpansOrBuilder

      public SpanObjectOrBuilder getSpansOrBuilder(int index)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
      Specified by:
      getSpansOrBuilder in interface SegmentObjectOrBuilder
    • getSpansOrBuilderList

      public List<? extends SpanObjectOrBuilder> getSpansOrBuilderList()
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
      Specified by:
      getSpansOrBuilderList in interface SegmentObjectOrBuilder
    • addSpansBuilder

      public SpanObject.Builder addSpansBuilder()
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • addSpansBuilder

      public SpanObject.Builder addSpansBuilder(int index)
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • getSpansBuilderList

      public List<SpanObject.Builder> getSpansBuilderList()
       Span collections included in this segment.
       
      repeated .skywalking.v3.SpanObject spans = 3;
    • getService

      public String getService()
       **Service**. Represents a set/group of workloads which provide the same behaviours for incoming requests.
       The logic name represents the service. This would show as a separate node in the topology.
       The metrics analyzed from the spans, would be aggregated for this entity as the service level.
       
      string service = 4;
      Specified by:
      getService in interface SegmentObjectOrBuilder
      Returns:
      The service.
    • getServiceBytes

      public com.google.protobuf.ByteString getServiceBytes()
       **Service**. Represents a set/group of workloads which provide the same behaviours for incoming requests.
       The logic name represents the service. This would show as a separate node in the topology.
       The metrics analyzed from the spans, would be aggregated for this entity as the service level.
       
      string service = 4;
      Specified by:
      getServiceBytes in interface SegmentObjectOrBuilder
      Returns:
      The bytes for service.
    • setService

      public SegmentObject.Builder setService(String value)
       **Service**. Represents a set/group of workloads which provide the same behaviours for incoming requests.
       The logic name represents the service. This would show as a separate node in the topology.
       The metrics analyzed from the spans, would be aggregated for this entity as the service level.
       
      string service = 4;
      Parameters:
      value - The service to set.
      Returns:
      This builder for chaining.
    • clearService

      public SegmentObject.Builder clearService()
       **Service**. Represents a set/group of workloads which provide the same behaviours for incoming requests.
       The logic name represents the service. This would show as a separate node in the topology.
       The metrics analyzed from the spans, would be aggregated for this entity as the service level.
       
      string service = 4;
      Returns:
      This builder for chaining.
    • setServiceBytes

      public SegmentObject.Builder setServiceBytes(com.google.protobuf.ByteString value)
       **Service**. Represents a set/group of workloads which provide the same behaviours for incoming requests.
       The logic name represents the service. This would show as a separate node in the topology.
       The metrics analyzed from the spans, would be aggregated for this entity as the service level.
       
      string service = 4;
      Parameters:
      value - The bytes for service to set.
      Returns:
      This builder for chaining.
    • getServiceInstance

      public String getServiceInstance()
       **Service Instance**. Each individual workload in the Service group is known as an instance. Like `pods` in Kubernetes, it
       doesn't need to be a single OS process, however, if you are using instrument agents, an instance is actually a real OS process.
       The logic name represents the service instance. This would show as a separate node in the instance relationship.
       The metrics analyzed from the spans, would be aggregated for this entity as the service instance level.
       
      string serviceInstance = 5;
      Specified by:
      getServiceInstance in interface SegmentObjectOrBuilder
      Returns:
      The serviceInstance.
    • getServiceInstanceBytes

      public com.google.protobuf.ByteString getServiceInstanceBytes()
       **Service Instance**. Each individual workload in the Service group is known as an instance. Like `pods` in Kubernetes, it
       doesn't need to be a single OS process, however, if you are using instrument agents, an instance is actually a real OS process.
       The logic name represents the service instance. This would show as a separate node in the instance relationship.
       The metrics analyzed from the spans, would be aggregated for this entity as the service instance level.
       
      string serviceInstance = 5;
      Specified by:
      getServiceInstanceBytes in interface SegmentObjectOrBuilder
      Returns:
      The bytes for serviceInstance.
    • setServiceInstance

      public SegmentObject.Builder setServiceInstance(String value)
       **Service Instance**. Each individual workload in the Service group is known as an instance. Like `pods` in Kubernetes, it
       doesn't need to be a single OS process, however, if you are using instrument agents, an instance is actually a real OS process.
       The logic name represents the service instance. This would show as a separate node in the instance relationship.
       The metrics analyzed from the spans, would be aggregated for this entity as the service instance level.
       
      string serviceInstance = 5;
      Parameters:
      value - The serviceInstance to set.
      Returns:
      This builder for chaining.
    • clearServiceInstance

      public SegmentObject.Builder clearServiceInstance()
       **Service Instance**. Each individual workload in the Service group is known as an instance. Like `pods` in Kubernetes, it
       doesn't need to be a single OS process, however, if you are using instrument agents, an instance is actually a real OS process.
       The logic name represents the service instance. This would show as a separate node in the instance relationship.
       The metrics analyzed from the spans, would be aggregated for this entity as the service instance level.
       
      string serviceInstance = 5;
      Returns:
      This builder for chaining.
    • setServiceInstanceBytes

      public SegmentObject.Builder setServiceInstanceBytes(com.google.protobuf.ByteString value)
       **Service Instance**. Each individual workload in the Service group is known as an instance. Like `pods` in Kubernetes, it
       doesn't need to be a single OS process, however, if you are using instrument agents, an instance is actually a real OS process.
       The logic name represents the service instance. This would show as a separate node in the instance relationship.
       The metrics analyzed from the spans, would be aggregated for this entity as the service instance level.
       
      string serviceInstance = 5;
      Parameters:
      value - The bytes for serviceInstance to set.
      Returns:
      This builder for chaining.
    • getIsSizeLimited

      public boolean getIsSizeLimited()
       Whether the segment includes all tracked spans.
       In the production environment tracked, some tasks could include too many spans for one request context, such as a batch update for a cache, or an async job.
       The agent/SDK could optimize or ignore some tracked spans for better performance.
       In this case, the value should be flagged as TRUE.
       
      bool isSizeLimited = 6;
      Specified by:
      getIsSizeLimited in interface SegmentObjectOrBuilder
      Returns:
      The isSizeLimited.
    • setIsSizeLimited

      public SegmentObject.Builder setIsSizeLimited(boolean value)
       Whether the segment includes all tracked spans.
       In the production environment tracked, some tasks could include too many spans for one request context, such as a batch update for a cache, or an async job.
       The agent/SDK could optimize or ignore some tracked spans for better performance.
       In this case, the value should be flagged as TRUE.
       
      bool isSizeLimited = 6;
      Parameters:
      value - The isSizeLimited to set.
      Returns:
      This builder for chaining.
    • clearIsSizeLimited

      public SegmentObject.Builder clearIsSizeLimited()
       Whether the segment includes all tracked spans.
       In the production environment tracked, some tasks could include too many spans for one request context, such as a batch update for a cache, or an async job.
       The agent/SDK could optimize or ignore some tracked spans for better performance.
       In this case, the value should be flagged as TRUE.
       
      bool isSizeLimited = 6;
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final SegmentObject.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>
    • mergeUnknownFields

      public final SegmentObject.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SegmentObject.Builder>