Class Record
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<Record.Builder,
Record>
Represents a time-series data point being written into Timestream. Each record contains an array of dimensions. Dimensions represent the metadata attributes of a time-series data point, such as the instance name or Availability Zone of an EC2 instance. A record also contains the measure name, which is the name of the measure being collected (for example, the CPU utilization of an EC2 instance). Additionally, a record contains the measure value and the value type, which is the data type of the measure value. Also, the record contains the timestamp of when the measure was collected and the timestamp unit, which represents the granularity of the timestamp.
Records have a Version
field, which is a 64-bit long
that you can use for updating data
points. Writes of a duplicate record with the same dimension, timestamp, and measure name but different measure value
will only succeed if the Version
attribute of the record in the write request is higher than that of the
existing record. Timestream defaults to a Version
of 1
for records without the
Version
field.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Record.Builder
builder()
Contains the list of dimensions for time-series data points.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the Dimensions property.final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the MeasureValues property.final String
Measure represents the data attribute of the time series.final String
Contains the measure value for the time-series data point.final List
<MeasureValue> Contains the list of MeasureValue for time-series data points.final MeasureValueType
Contains the data type of the measure value for the time-series data point.final String
Contains the data type of the measure value for the time-series data point.static Class
<? extends Record.Builder> final String
time()
Contains the time at which the measure value for the data point was collected.final TimeUnit
timeUnit()
The granularity of the timestamp unit.final String
The granularity of the timestamp unit.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.final Long
version()
64-bit attribute used for record updates.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
hasDimensions
public final boolean hasDimensions()For responses, this returns true if the service returned a value for the Dimensions property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
dimensions
Contains the list of dimensions for time-series data points.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasDimensions()
method.- Returns:
- Contains the list of dimensions for time-series data points.
-
measureName
Measure represents the data attribute of the time series. For example, the CPU utilization of an EC2 instance or the RPM of a wind turbine are measures.
- Returns:
- Measure represents the data attribute of the time series. For example, the CPU utilization of an EC2 instance or the RPM of a wind turbine are measures.
-
measureValue
Contains the measure value for the time-series data point.
- Returns:
- Contains the measure value for the time-series data point.
-
measureValueType
Contains the data type of the measure value for the time-series data point. Default type is
DOUBLE
. For more information, see Data types.If the service returns an enum value that is not available in the current SDK version,
measureValueType
will returnMeasureValueType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frommeasureValueTypeAsString()
.- Returns:
- Contains the data type of the measure value for the time-series data point. Default type is
DOUBLE
. For more information, see Data types. - See Also:
-
measureValueTypeAsString
Contains the data type of the measure value for the time-series data point. Default type is
DOUBLE
. For more information, see Data types.If the service returns an enum value that is not available in the current SDK version,
measureValueType
will returnMeasureValueType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frommeasureValueTypeAsString()
.- Returns:
- Contains the data type of the measure value for the time-series data point. Default type is
DOUBLE
. For more information, see Data types. - See Also:
-
time
Contains the time at which the measure value for the data point was collected. The time value plus the unit provides the time elapsed since the epoch. For example, if the time value is
12345
and the unit isms
, then12345 ms
have elapsed since the epoch.- Returns:
- Contains the time at which the measure value for the data point was collected. The time value plus the
unit provides the time elapsed since the epoch. For example, if the time value is
12345
and the unit isms
, then12345 ms
have elapsed since the epoch.
-
timeUnit
The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is
MILLISECONDS
.If the service returns an enum value that is not available in the current SDK version,
timeUnit
will returnTimeUnit.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromtimeUnitAsString()
.- Returns:
- The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds,
nanoseconds, or other supported values. Default is
MILLISECONDS
. - See Also:
-
timeUnitAsString
The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is
MILLISECONDS
.If the service returns an enum value that is not available in the current SDK version,
timeUnit
will returnTimeUnit.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromtimeUnitAsString()
.- Returns:
- The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds,
nanoseconds, or other supported values. Default is
MILLISECONDS
. - See Also:
-
version
64-bit attribute used for record updates. Write requests for duplicate data with a higher version number will update the existing measure value and version. In cases where the measure value is the same,
Version
will still be updated. Default value is1
.Version
must be1
or greater, or you will receive aValidationException
error.- Returns:
- 64-bit attribute used for record updates. Write requests for duplicate data with a higher version number
will update the existing measure value and version. In cases where the measure value is the same,
Version
will still be updated. Default value is1
.Version
must be1
or greater, or you will receive aValidationException
error.
-
hasMeasureValues
public final boolean hasMeasureValues()For responses, this returns true if the service returned a value for the MeasureValues property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
measureValues
Contains the list of MeasureValue for time-series data points.
This is only allowed for type
MULTI
. For scalar values, useMeasureValue
attribute of the record directly.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasMeasureValues()
method.- Returns:
- Contains the list of MeasureValue for time-series data points.
This is only allowed for type
MULTI
. For scalar values, useMeasureValue
attribute of the record directly.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<Record.Builder,
Record> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
sdkFields
-