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 class
SparkTimeseriesData.SparkTimeseriesDataBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
after(TimeseriesData timeseriesData)
TimeseriesData
alignToTimestamp(java.sql.Timestamp timestamp)
boolean
before(TimeseriesData timeseriesData)
static SparkTimeseriesData.SparkTimeseriesDataBuilder
builder()
int
compareTo(TimeseriesData other)
int
compareValueTo(TimeseriesData that)
int[]
dimensions()
Gets the data dimensions of time series data.boolean
equals(java.lang.Object obj)
java.lang.String
getDestination()
Gets the Varchar value associated with the time series data.double
getDoubleValue()
Gets the Numeric value associated with the time series data.double
getDoubleValueAtIndex(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.String
getFormattedStamp(LoggingTimeZone timeZone)
long
getLongValue()
Gets the Numeric value associated with the time series data.long
getLongValueAtIndex(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.String
getName()
java.lang.String
getNumericStatus()
Gets the Status associated with the time series data.java.math.BigDecimal
getNumericValue()
Deprecated.(never use, major performance hit)java.math.BigDecimal
getNumericValueAtVectorIndex(int index)
Deprecated.(never use, performance hit)java.sql.Timestamp
getStamp()
Gets the timestamp of the timeseries data.java.lang.String
getStringValueAtIndex(int index)
java.lang.String[]
getStringValues()
java.lang.String
getVarcharValue()
Gets the Varchar value associated with the time series data.VariableDataType
getVariableDataType()
int[]
getVectorIndexes()
int[]
getVectorNumericIndexes()
Gets the array of vectornumeric element indexes.java.math.BigDecimal[]
getVectorNumericValues()
Deprecated.(never use, major performance hit)int
hashCode()
boolean
isNullValue()
Checks whether the value is nullboolean
isNullValue(int index)
Checks whether the value is null for a given index (vector numeric types)java.lang.Boolean
isSubSet()
Indicates if this Timeseries Data is a subset of the actual logged vectornumerioc value as a result of filtering by index or value.static TimeseriesData
of(@NonNull java.sql.Timestamp timestamp, @NonNull cern.cmw.datax.ImmutableEntry data)
static TimeseriesData
of(@NonNull org.apache.spark.sql.Row row)
static TimeseriesData
ofDataDistribution(@NonNull org.apache.spark.sql.Row row)
static TimeseriesData
ofDouble(@NonNull java.sql.Timestamp timestamp, double value)
static TimeseriesData
ofFundamental(@NonNull org.apache.spark.sql.Row row)
void
print(LoggingTimeZone timezone)
Deprecated.(never use, antipattern)SparkTimeseriesData.SparkTimeseriesDataBuilder
toBuilder()
java.lang.String
toStringValue()
Represents the value in a stringjava.lang.String
toStringValue(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:TimeseriesData
Gets the data type of time series data.- Specified by:
type
in interfaceTimeseriesData
- Returns:
- the data type of time series data.
-
dimensions
public int[] dimensions()
Description copied from interface:TimeseriesData
Gets the data dimensions of time series data.- Specified by:
dimensions
in interfaceTimeseriesData
- Returns:
- the data dimensions of time series data.
-
getVariableDataType
public VariableDataType getVariableDataType()
- Specified by:
getVariableDataType
in interfaceTimeseriesData
- See Also:
TimeseriesDataSet.getVariableDataType()
-
after
public boolean after(TimeseriesData timeseriesData)
- Specified by:
after
in interfaceTimeseriesData
-
before
public boolean before(TimeseriesData timeseriesData)
- Specified by:
before
in interfaceTimeseriesData
-
getFormattedStamp
public java.lang.String getFormattedStamp(LoggingTimeZone timeZone)
- Specified by:
getFormattedStamp
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Status associated with the time series data.- Specified by:
getNumericStatus
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Varchar value associated with the time series data.- Specified by:
getDestination
in 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.NoSuchMethodException
Deprecated.(never use, major performance hit)Description copied from interface:TimeseriesData
Gets the Numeric value associated with the time series data.- Specified by:
getNumericValue
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Numeric value associated with the time series data.- Specified by:
getDoubleValue
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Numeric value associated with the time series data.- Specified by:
getLongValue
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Varchar value associated with the time series data.- Specified by:
getVarcharValue
in 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.NoSuchMethodException
Deprecated.(never use, major performance hit)Description copied from interface:TimeseriesData
Gets the Vector of Numeric values associated with the time series data.- Specified by:
getVectorNumericValues
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Vector of Numeric values associated with the time series data.- Specified by:
getDoubleValues
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the Vector of Numeric values associated with the time series data.- Specified by:
getLongValues
in 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:
getStringValues
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
getMatrixDoubleValues
public double[][] getMatrixDoubleValues() throws java.lang.NoSuchMethodException
- Specified by:
getMatrixDoubleValues
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
getMatrixLongValues
public long[][] getMatrixLongValues() throws java.lang.NoSuchMethodException
- Specified by:
getMatrixLongValues
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
print
@Deprecated public void print(LoggingTimeZone timezone)
Deprecated.(never use, antipattern)- Specified by:
print
in interfaceTimeseriesData
-
getNumericValueAtVectorIndex
@Deprecated public java.math.BigDecimal getNumericValueAtVectorIndex(int index) throws java.lang.NoSuchMethodException
Deprecated.(never use, performance hit)Description copied from interface:TimeseriesData
Gets numeric value from the vectornumeric value at the given index.- Specified by:
getNumericValueAtVectorIndex
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets numeric value from the vectornumeric value at the given index.- Specified by:
getDoubleValueAtIndex
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets numeric value from the vectornumeric value at the given index.- Specified by:
getLongValueAtIndex
in 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:
getStringValueAtIndex
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
isSubSet
public java.lang.Boolean isSubSet() throws java.lang.NoSuchMethodException
Description copied from interface:TimeseriesData
Indicates if this Timeseries Data is a subset of the actual logged vectornumerioc value as a result of filtering by index or value.- Specified by:
isSubSet
in 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.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets 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:
getVectorNumericIndexes
in interfaceTimeseriesData
- Returns:
- the array of vectornumeric element indexes.
- Throws:
java.lang.NoSuchMethodException
-
getVectorIndexes
public int[] getVectorIndexes() throws java.lang.NoSuchMethodException
- Specified by:
getVectorIndexes
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
toStringValue
public java.lang.String toStringValue() throws java.lang.NoSuchMethodException
Description copied from interface:TimeseriesData
Represents the value in a string- Specified by:
toStringValue
in interfaceTimeseriesData
- Returns:
- The value in a string
- Throws:
java.lang.NoSuchMethodException
-
toStringValue
public java.lang.String toStringValue(int index) throws java.lang.NoSuchMethodException
Description copied from interface:TimeseriesData
Gets the string of a value for a given index for a vector numeric type- Specified by:
toStringValue
in interfaceTimeseriesData
- Returns:
- Throws:
java.lang.NoSuchMethodException
-
isNullValue
public boolean isNullValue() throws java.lang.NoSuchMethodException
Description copied from interface:TimeseriesData
Checks whether the value is null- Specified by:
isNullValue
in interfaceTimeseriesData
- Returns:
- Throws:
java.lang.NoSuchMethodException
-
isNullValue
public boolean isNullValue(int index) throws java.lang.NoSuchMethodException
Description copied from interface:TimeseriesData
Checks whether the value is null for a given index (vector numeric types)- Specified by:
isNullValue
in interfaceTimeseriesData
- Returns:
- Throws:
java.lang.NoSuchMethodException
-
alignToTimestamp
public TimeseriesData alignToTimestamp(java.sql.Timestamp timestamp) throws java.lang.NoSuchMethodException
- Specified by:
alignToTimestamp
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
compareValueTo
public int compareValueTo(TimeseriesData that) throws java.lang.NoSuchMethodException
- Specified by:
compareValueTo
in interfaceTimeseriesData
- Throws:
java.lang.NoSuchMethodException
-
compareTo
public int compareTo(TimeseriesData other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<TimeseriesData>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
builder
public static SparkTimeseriesData.SparkTimeseriesDataBuilder builder()
-
getStamp
public java.sql.Timestamp getStamp()
Description copied from interface:TimeseriesData
Gets the timestamp of the timeseries data.- Specified by:
getStamp
in interfaceTimeseriesData
- Returns:
- - the timestamp of the timeseries data.
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceTimeseriesData
-
-