Class Sample.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Sample.Builder>
io.opentelemetry.proto.profiles.v1development.Sample.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, SampleOrBuilder, Cloneable
Enclosing class:
Sample

public static final class Sample.Builder extends com.google.protobuf.GeneratedMessage.Builder<Sample.Builder> implements SampleOrBuilder
 Each Sample records values encountered in some program context. The program
 context is typically a stack trace, perhaps augmented with auxiliary
 information like the thread-id, some indicator of a higher level request
 being handled etc.

 A Sample MUST have have at least one values or timestamps_unix_nano entry. If
 both fields are populated, they MUST contain the same number of elements, and
 the elements at the same index MUST refer to the same event.

 Examples of different ways of representing a sample with the total value of 10:

 Report of a stacktrace at 10 timestamps (consumers must assume the value is 1 for each point):
 values: []
 timestamps_unix_nano: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

 Report of a stacktrace with an aggregated value without timestamps:
 values: [10]
 timestamps_unix_nano: []

 Report of a stacktrace at 4 timestamps where each point records a specific value:
 values: [2, 2, 3, 3]
 timestamps_unix_nano: [1, 2, 3, 4]
 
Protobuf type opentelemetry.proto.profiles.v1development.Sample
  • Method Summary

    Modifier and Type
    Method
    Description
    References to attributes in ProfilesDictionary.attribute_table.
    Timestamps associated with Sample represented in nanoseconds.
    addAllValues(Iterable<? extends Long> values)
    The type and unit of each value is defined by Profile.sample_type.
    References to attributes in ProfilesDictionary.attribute_table.
    Timestamps associated with Sample represented in nanoseconds.
    addValues(long value)
    The type and unit of each value is defined by Profile.sample_type.
     
     
     
    References to attributes in ProfilesDictionary.attribute_table.
    Reference to link in ProfilesDictionary.link_table.
    Reference to stack in ProfilesDictionary.stack_table.
    Timestamps associated with Sample represented in nanoseconds.
    The type and unit of each value is defined by Profile.sample_type.
    int
    References to attributes in ProfilesDictionary.attribute_table.
    int
    References to attributes in ProfilesDictionary.attribute_table.
    References to attributes in ProfilesDictionary.attribute_table.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    int
    Reference to link in ProfilesDictionary.link_table.
    int
    Reference to stack in ProfilesDictionary.stack_table.
    long
    Timestamps associated with Sample represented in nanoseconds.
    int
    Timestamps associated with Sample represented in nanoseconds.
    Timestamps associated with Sample represented in nanoseconds.
    long
    getValues(int index)
    The type and unit of each value is defined by Profile.sample_type.
    int
    The type and unit of each value is defined by Profile.sample_type.
    The type and unit of each value is defined by Profile.sample_type.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
     
    setAttributeIndices(int index, int value)
    References to attributes in ProfilesDictionary.attribute_table.
    setLinkIndex(int value)
    Reference to link in ProfilesDictionary.link_table.
    setStackIndex(int value)
    Reference to stack in ProfilesDictionary.stack_table.
    setTimestampsUnixNano(int index, long value)
    Timestamps associated with Sample represented in nanoseconds.
    setValues(int index, long value)
    The type and unit of each value is defined by Profile.sample_type.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • getDescriptor

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

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

      public Sample.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.GeneratedMessage.Builder<Sample.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.GeneratedMessage.Builder<Sample.Builder>
    • getDefaultInstanceForType

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

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

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

      public Sample.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<Sample.Builder>
    • mergeFrom

      public Sample.Builder mergeFrom(Sample other)
    • isInitialized

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

      public Sample.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<Sample.Builder>
      Throws:
      IOException
    • getStackIndex

      public int getStackIndex()
       Reference to stack in ProfilesDictionary.stack_table.
       
      int32 stack_index = 1;
      Specified by:
      getStackIndex in interface SampleOrBuilder
      Returns:
      The stackIndex.
    • setStackIndex

      public Sample.Builder setStackIndex(int value)
       Reference to stack in ProfilesDictionary.stack_table.
       
      int32 stack_index = 1;
      Parameters:
      value - The stackIndex to set.
      Returns:
      This builder for chaining.
    • clearStackIndex

      public Sample.Builder clearStackIndex()
       Reference to stack in ProfilesDictionary.stack_table.
       
      int32 stack_index = 1;
      Returns:
      This builder for chaining.
    • getValuesList

      public List<Long> getValuesList()
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Specified by:
      getValuesList in interface SampleOrBuilder
      Returns:
      A list containing the values.
    • getValuesCount

      public int getValuesCount()
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Specified by:
      getValuesCount in interface SampleOrBuilder
      Returns:
      The count of values.
    • getValues

      public long getValues(int index)
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Specified by:
      getValues in interface SampleOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The values at the given index.
    • setValues

      public Sample.Builder setValues(int index, long value)
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Parameters:
      index - The index to set the value at.
      value - The values to set.
      Returns:
      This builder for chaining.
    • addValues

      public Sample.Builder addValues(long value)
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Parameters:
      value - The values to add.
      Returns:
      This builder for chaining.
    • addAllValues

      public Sample.Builder addAllValues(Iterable<? extends Long> values)
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Parameters:
      values - The values to add.
      Returns:
      This builder for chaining.
    • clearValues

      public Sample.Builder clearValues()
       The type and unit of each value is defined by Profile.sample_type.
       
      repeated int64 values = 2;
      Returns:
      This builder for chaining.
    • getAttributeIndicesList

      public List<Integer> getAttributeIndicesList()
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Specified by:
      getAttributeIndicesList in interface SampleOrBuilder
      Returns:
      A list containing the attributeIndices.
    • getAttributeIndicesCount

      public int getAttributeIndicesCount()
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Specified by:
      getAttributeIndicesCount in interface SampleOrBuilder
      Returns:
      The count of attributeIndices.
    • getAttributeIndices

      public int getAttributeIndices(int index)
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Specified by:
      getAttributeIndices in interface SampleOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The attributeIndices at the given index.
    • setAttributeIndices

      public Sample.Builder setAttributeIndices(int index, int value)
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Parameters:
      index - The index to set the value at.
      value - The attributeIndices to set.
      Returns:
      This builder for chaining.
    • addAttributeIndices

      public Sample.Builder addAttributeIndices(int value)
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Parameters:
      value - The attributeIndices to add.
      Returns:
      This builder for chaining.
    • addAllAttributeIndices

      public Sample.Builder addAllAttributeIndices(Iterable<? extends Integer> values)
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Parameters:
      values - The attributeIndices to add.
      Returns:
      This builder for chaining.
    • clearAttributeIndices

      public Sample.Builder clearAttributeIndices()
       References to attributes in ProfilesDictionary.attribute_table. [optional]
       
      repeated int32 attribute_indices = 3;
      Returns:
      This builder for chaining.
    • getLinkIndex

      public int getLinkIndex()
       Reference to link in ProfilesDictionary.link_table. [optional]
       It can be unset / set to 0 if no link exists, as link_table[0] is always a 'null' default value.
       
      int32 link_index = 4;
      Specified by:
      getLinkIndex in interface SampleOrBuilder
      Returns:
      The linkIndex.
    • setLinkIndex

      public Sample.Builder setLinkIndex(int value)
       Reference to link in ProfilesDictionary.link_table. [optional]
       It can be unset / set to 0 if no link exists, as link_table[0] is always a 'null' default value.
       
      int32 link_index = 4;
      Parameters:
      value - The linkIndex to set.
      Returns:
      This builder for chaining.
    • clearLinkIndex

      public Sample.Builder clearLinkIndex()
       Reference to link in ProfilesDictionary.link_table. [optional]
       It can be unset / set to 0 if no link exists, as link_table[0] is always a 'null' default value.
       
      int32 link_index = 4;
      Returns:
      This builder for chaining.
    • getTimestampsUnixNanoList

      public List<Long> getTimestampsUnixNanoList()
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Specified by:
      getTimestampsUnixNanoList in interface SampleOrBuilder
      Returns:
      A list containing the timestampsUnixNano.
    • getTimestampsUnixNanoCount

      public int getTimestampsUnixNanoCount()
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Specified by:
      getTimestampsUnixNanoCount in interface SampleOrBuilder
      Returns:
      The count of timestampsUnixNano.
    • getTimestampsUnixNano

      public long getTimestampsUnixNano(int index)
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Specified by:
      getTimestampsUnixNano in interface SampleOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The timestampsUnixNano at the given index.
    • setTimestampsUnixNano

      public Sample.Builder setTimestampsUnixNano(int index, long value)
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Parameters:
      index - The index to set the value at.
      value - The timestampsUnixNano to set.
      Returns:
      This builder for chaining.
    • addTimestampsUnixNano

      public Sample.Builder addTimestampsUnixNano(long value)
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Parameters:
      value - The timestampsUnixNano to add.
      Returns:
      This builder for chaining.
    • addAllTimestampsUnixNano

      public Sample.Builder addAllTimestampsUnixNano(Iterable<? extends Long> values)
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Parameters:
      values - The timestampsUnixNano to add.
      Returns:
      This builder for chaining.
    • clearTimestampsUnixNano

      public Sample.Builder clearTimestampsUnixNano()
       Timestamps associated with Sample represented in nanoseconds. These
       timestamps should fall within the Profile's time range.
       
      repeated fixed64 timestamps_unix_nano = 5;
      Returns:
      This builder for chaining.