Class SparkTimeseriesData
- java.lang.Object
-
- cern.nxcals.api.backport.domain.core.timeseriesdata.SparkTimeseriesData
-
- All Implemented Interfaces:
TimeseriesData,java.lang.Cloneable,java.lang.Comparable<TimeseriesData>
public class SparkTimeseriesData extends java.lang.Object implements TimeseriesData
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSparkTimeseriesData.SparkTimeseriesDataBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanafter(TimeseriesData timeseriesData)TimeseriesDataalignToTimestamp(java.sql.Timestamp timestamp)booleanbefore(TimeseriesData timeseriesData)static SparkTimeseriesData.SparkTimeseriesDataBuilderbuilder()intcompareTo(TimeseriesData other)intcompareValueTo(TimeseriesData that)int[]dimensions()Gets the data dimensions of time series data.booleanequals(java.lang.Object obj)java.lang.StringgetDestination()Gets the Varchar value associated with the time series data.doublegetDoubleValue()Gets the Numeric value associated with the time series data.doublegetDoubleValueAtIndex(int index)Gets numeric value from the vectornumeric value at the given index.double[]getDoubleValues()Gets the Vector of Numeric values associated with the time series data.java.lang.StringgetFormattedStamp(LoggingTimeZone timeZone)longgetLongValue()Gets the Numeric value associated with the time series data.longgetLongValueAtIndex(int index)Gets numeric value from the vectornumeric value at the given index.long[]getLongValues()Gets the Vector of Numeric values associated with the time series data.double[][]getMatrixDoubleValues()long[][]getMatrixLongValues()java.lang.StringgetName()java.lang.StringgetNumericStatus()Gets the Status associated with the time series data.java.math.BigDecimalgetNumericValue()Deprecated.(never use, major performance hit)java.math.BigDecimalgetNumericValueAtVectorIndex(int index)Deprecated.(never use, performance hit)java.sql.TimestampgetStamp()Gets the timestamp of the timeseries data.java.lang.StringgetStringValueAtIndex(int index)java.lang.String[]getStringValues()java.lang.StringgetVarcharValue()Gets the Varchar value associated with the time series data.VariableDataTypegetVariableDataType()int[]getVectorIndexes()int[]getVectorNumericIndexes()Gets the array of vectornumeric element indexes.java.math.BigDecimal[]getVectorNumericValues()Deprecated.(never use, major performance hit)inthashCode()booleanisNullValue()Checks whether the value is nullbooleanisNullValue(int index)Checks whether the value is null for a given index (vector numeric types)java.lang.BooleanisSubSet()Indicates if this Timeseries Data is a subset of the actual logged vectornumerioc value as a result of filtering by index or value.static TimeseriesDataof(@NonNull java.sql.Timestamp timestamp, @NonNull cern.cmw.datax.ImmutableEntry data)static TimeseriesDataof(@NonNull org.apache.spark.sql.Row row)static TimeseriesDataofDataDistribution(@NonNull org.apache.spark.sql.Row row)static TimeseriesDataofDouble(@NonNull java.sql.Timestamp timestamp, double value)static TimeseriesDataofFundamental(@NonNull org.apache.spark.sql.Row row)voidprint(LoggingTimeZone timezone)Deprecated.(never use, antipattern)SparkTimeseriesData.SparkTimeseriesDataBuildertoBuilder()java.lang.StringtoStringValue()Represents the value in a stringjava.lang.StringtoStringValue(int index)Gets the string of a value for a given index for a vector numeric typejava.lang.Class<?>type()Gets the data type of time series data.
-
-
-
Method Detail
-
of
public static TimeseriesData of(@NonNull @NonNull org.apache.spark.sql.Row row)
-
of
public static TimeseriesData of(@NonNull @NonNull java.sql.Timestamp timestamp, @NonNull @NonNull cern.cmw.datax.ImmutableEntry data)
-
ofDouble
public static TimeseriesData ofDouble(@NonNull @NonNull java.sql.Timestamp timestamp, double value)
-
ofDataDistribution
public static TimeseriesData ofDataDistribution(@NonNull @NonNull org.apache.spark.sql.Row row)
-
ofFundamental
public static TimeseriesData ofFundamental(@NonNull @NonNull org.apache.spark.sql.Row row)
-
toBuilder
public SparkTimeseriesData.SparkTimeseriesDataBuilder toBuilder()
-
type
public java.lang.Class<?> type()
Description copied from interface:TimeseriesDataGets the data type of time series data.- Specified by:
typein interfaceTimeseriesData- Returns:
- the data type of time series data.
-
dimensions
public int[] dimensions()
Description copied from interface:TimeseriesDataGets the data dimensions of time series data.- Specified by:
dimensionsin interfaceTimeseriesData- Returns:
- the data dimensions of time series data.
-
getVariableDataType
public VariableDataType getVariableDataType()
- Specified by:
getVariableDataTypein interfaceTimeseriesData- See Also:
TimeseriesDataSet.getVariableDataType()
-
after
public boolean after(TimeseriesData timeseriesData)
- Specified by:
afterin interfaceTimeseriesData
-
before
public boolean before(TimeseriesData timeseriesData)
- Specified by:
beforein interfaceTimeseriesData
-
getFormattedStamp
public java.lang.String getFormattedStamp(LoggingTimeZone timeZone)
- Specified by:
getFormattedStampin interfaceTimeseriesData- Parameters:
timeZone- - the timezone which should be used to format the timestamp of this data- Returns:
- - a String representing the timestamp of this data, formatted according to the given timezone
-
getNumericStatus
public java.lang.String getNumericStatus() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Status associated with the time series data.- Specified by:
getNumericStatusin interfaceTimeseriesData- Returns:
- the Status associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Status of time series data that does not have a status associated with it i.e. it is not of the relevant datatype.
-
getDestination
public java.lang.String getDestination() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Varchar value associated with the time series data.- Specified by:
getDestinationin interfaceTimeseriesData- Returns:
- the Varchar value associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the destination value of time series data that does not have a destination value associated with it i.e. it is not of the fundamental datatype.
-
getNumericValue
@Deprecated public java.math.BigDecimal getNumericValue() throws java.lang.NoSuchMethodExceptionDeprecated.(never use, major performance hit)Description copied from interface:TimeseriesDataGets the Numeric value associated with the time series data.- Specified by:
getNumericValuein interfaceTimeseriesData- Returns:
- the Numeric value associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Numeric value of time series data that does not have a Numeric Value associated with it i.e. it is not of the relevant datatype.
-
getDoubleValue
public double getDoubleValue() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Numeric value associated with the time series data.- Specified by:
getDoubleValuein interfaceTimeseriesData- Returns:
- the Numeric value associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Numeric value of time series data that does not have a Numeric Value associated with it i.e. it is not of the relevant datatype.
-
getLongValue
public long getLongValue() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Numeric value associated with the time series data.- Specified by:
getLongValuein interfaceTimeseriesData- Returns:
- the Numeric value associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Numeric value of time series data that does not have a Numeric Value associated with it i.e. it is not of the relevant datatype.
-
getVarcharValue
public java.lang.String getVarcharValue() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Varchar value associated with the time series data.- Specified by:
getVarcharValuein interfaceTimeseriesData- Returns:
- the Varchar value associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Varchar value of time series data that does not have a Varchar value associated with it i.e. it is not of the relevant datatype.
-
getVectorNumericValues
@Deprecated public java.math.BigDecimal[] getVectorNumericValues() throws java.lang.NoSuchMethodExceptionDeprecated.(never use, major performance hit)Description copied from interface:TimeseriesDataGets the Vector of Numeric values associated with the time series data.- Specified by:
getVectorNumericValuesin interfaceTimeseriesData- Returns:
- the Vector of Numeric values associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Vector of Numeric values of the time series data that does not have a Vector of Numeric values associated with it i.e. it is not of the relevant datatype.
-
getDoubleValues
public double[] getDoubleValues() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Vector of Numeric values associated with the time series data.- Specified by:
getDoubleValuesin interfaceTimeseriesData- Returns:
- the Vector of Numeric values associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Vector of Numeric values of the time series data that does not have a Vector of Numeric values associated with it i.e. it is not of the relevant datatype.
-
getLongValues
public long[] getLongValues() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the Vector of Numeric values associated with the time series data.- Specified by:
getLongValuesin interfaceTimeseriesData- Returns:
- the Vector of Numeric values associated with the time series data.
- Throws:
java.lang.NoSuchMethodException- - if an attempt is made to retrieve the Vector of Numeric values of the time series data that does not have a Vector of Numeric values associated with it i.e. it is not of the relevant datatype.
-
getStringValues
public java.lang.String[] getStringValues() throws java.lang.NoSuchMethodException- Specified by:
getStringValuesin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
getMatrixDoubleValues
public double[][] getMatrixDoubleValues() throws java.lang.NoSuchMethodException- Specified by:
getMatrixDoubleValuesin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
getMatrixLongValues
public long[][] getMatrixLongValues() throws java.lang.NoSuchMethodException- Specified by:
getMatrixLongValuesin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
print
@Deprecated public void print(LoggingTimeZone timezone)
Deprecated.(never use, antipattern)- Specified by:
printin interfaceTimeseriesData
-
getNumericValueAtVectorIndex
@Deprecated public java.math.BigDecimal getNumericValueAtVectorIndex(int index) throws java.lang.NoSuchMethodExceptionDeprecated.(never use, performance hit)Description copied from interface:TimeseriesDataGets numeric value from the vectornumeric value at the given index.- Specified by:
getNumericValueAtVectorIndexin interfaceTimeseriesData- Returns:
- the numeric value from the vectornumeric value at the given index or null if there is no value at the given index.
- Throws:
java.lang.NoSuchMethodException
-
getDoubleValueAtIndex
public double getDoubleValueAtIndex(int index) throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets numeric value from the vectornumeric value at the given index.- Specified by:
getDoubleValueAtIndexin interfaceTimeseriesData- Returns:
- the numeric value from the vectornumeric value at the given index or null if there is no value at the given index.
- Throws:
java.lang.NoSuchMethodException
-
getLongValueAtIndex
public long getLongValueAtIndex(int index) throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets numeric value from the vectornumeric value at the given index.- Specified by:
getLongValueAtIndexin interfaceTimeseriesData- Returns:
- the numeric value from the vectornumeric value at the given index or null if there is no value at the given index.
- Throws:
java.lang.NoSuchMethodException
-
getStringValueAtIndex
public java.lang.String getStringValueAtIndex(int index) throws java.lang.NoSuchMethodException- Specified by:
getStringValueAtIndexin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
isSubSet
public java.lang.Boolean isSubSet() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataIndicates if this Timeseries Data is a subset of the actual logged vectornumerioc value as a result of filtering by index or value.- Specified by:
isSubSetin interfaceTimeseriesData- Returns:
- true if this Timeseries Data is a subset of the actual logged vectornumerioc value.
- Throws:
java.lang.NoSuchMethodException
-
getVectorNumericIndexes
public int[] getVectorNumericIndexes() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the array of vectornumeric element indexes. This is useful in the case that this vectornumeric data is a subset of the actual logged vectornumerioc value (as a result of filtering by index or value).- Specified by:
getVectorNumericIndexesin interfaceTimeseriesData- Returns:
- the array of vectornumeric element indexes.
- Throws:
java.lang.NoSuchMethodException
-
getVectorIndexes
public int[] getVectorIndexes() throws java.lang.NoSuchMethodException- Specified by:
getVectorIndexesin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
toStringValue
public java.lang.String toStringValue() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataRepresents the value in a string- Specified by:
toStringValuein interfaceTimeseriesData- Returns:
- The value in a string
- Throws:
java.lang.NoSuchMethodException
-
toStringValue
public java.lang.String toStringValue(int index) throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataGets the string of a value for a given index for a vector numeric type- Specified by:
toStringValuein interfaceTimeseriesData- Returns:
- Throws:
java.lang.NoSuchMethodException
-
isNullValue
public boolean isNullValue() throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataChecks whether the value is null- Specified by:
isNullValuein interfaceTimeseriesData- Returns:
- Throws:
java.lang.NoSuchMethodException
-
isNullValue
public boolean isNullValue(int index) throws java.lang.NoSuchMethodExceptionDescription copied from interface:TimeseriesDataChecks whether the value is null for a given index (vector numeric types)- Specified by:
isNullValuein interfaceTimeseriesData- Returns:
- Throws:
java.lang.NoSuchMethodException
-
alignToTimestamp
public TimeseriesData alignToTimestamp(java.sql.Timestamp timestamp) throws java.lang.NoSuchMethodException
- Specified by:
alignToTimestampin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
compareValueTo
public int compareValueTo(TimeseriesData that) throws java.lang.NoSuchMethodException
- Specified by:
compareValueToin interfaceTimeseriesData- Throws:
java.lang.NoSuchMethodException
-
compareTo
public int compareTo(TimeseriesData other)
- Specified by:
compareToin interfacejava.lang.Comparable<TimeseriesData>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
builder
public static SparkTimeseriesData.SparkTimeseriesDataBuilder builder()
-
getStamp
public java.sql.Timestamp getStamp()
Description copied from interface:TimeseriesDataGets the timestamp of the timeseries data.- Specified by:
getStampin interfaceTimeseriesData- Returns:
- - the timestamp of the timeseries data.
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceTimeseriesData
-
-