@Generated(value="software.amazon.awssdk:codegen") public final class Record extends Object implements SdkPojo, Serializable, 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.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Record.Builder |
| Modifier and Type | Method and Description |
|---|---|
static Record.Builder |
builder() |
List<Dimension> |
dimensions()
Contains the list of dimensions for time-series data points.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
boolean |
hasDimensions()
For responses, this returns true if the service returned a value for the Dimensions property.
|
int |
hashCode() |
boolean |
hasMeasureValues()
For responses, this returns true if the service returned a value for the MeasureValues property.
|
String |
measureName()
Measure represents the data attribute of the time series.
|
String |
measureValue()
Contains the measure value for the time-series data point.
|
List<MeasureValue> |
measureValues()
Contains the list of MeasureValue for time-series data points.
|
MeasureValueType |
measureValueType()
Contains the data type of the measure value for the time-series data point.
|
String |
measureValueTypeAsString()
Contains the data type of the measure value for the time-series data point.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends Record.Builder> |
serializableBuilderClass() |
String |
time()
Contains the time at which the measure value for the data point was collected.
|
TimeUnit |
timeUnit()
The granularity of the timestamp unit.
|
String |
timeUnitAsString()
The granularity of the timestamp unit.
|
Record.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
Long |
version()
64-bit attribute used for record updates.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic final boolean hasDimensions()
isEmpty() 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.public final List<Dimension> 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.
public final String 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.
public final String measureValue()
Contains the measure value for the time-series data point.
public final MeasureValueType 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 return MeasureValueType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available
from measureValueTypeAsString().
DOUBLE. For more information, see Data
types.MeasureValueTypepublic final String 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 return MeasureValueType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available
from measureValueTypeAsString().
DOUBLE. For more information, see Data
types.MeasureValueTypepublic final String 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 is
ms, then 12345 ms have elapsed since the epoch.
12345 and
the unit is ms, then 12345 ms have elapsed since the epoch.public final TimeUnit 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
return TimeUnit.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
timeUnitAsString().
MILLISECONDS.TimeUnitpublic final String 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
return TimeUnit.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
timeUnitAsString().
MILLISECONDS.TimeUnitpublic final Long 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 is 1.
Version must be 1 or greater, or you will receive a ValidationException
error.
Version will still be updated. Default value is 1.
Version must be 1 or greater, or you will receive a
ValidationException error.
public final boolean hasMeasureValues()
isEmpty() 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.public final List<MeasureValue> measureValues()
Contains the list of MeasureValue for time-series data points.
This is only allowed for type MULTI. For scalar values, use MeasureValue 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.
This is only allowed for type MULTI. For scalar values, use MeasureValue
attribute of the record directly.
public Record.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<Record.Builder,Record>public static Record.Builder builder()
public static Class<? extends Record.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields in interface SdkPojopublic final String toString()
Copyright © 2023. All rights reserved.