Class SparkTimeseriesDataSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<TimeseriesData>
-
- cern.nxcals.api.backport.domain.core.timeseriesdata.SparkTimeseriesDataSet
-
- All Implemented Interfaces:
TimeseriesDataSet
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<TimeseriesData>
,java.util.Collection<TimeseriesData>
,java.util.List<TimeseriesData>
,java.util.RandomAccess
public class SparkTimeseriesDataSet extends java.util.ArrayList<TimeseriesData> implements TimeseriesDataSet
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
add(TimeseriesData data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)boolean
addAll(java.util.Collection<? extends TimeseriesData> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)void
addTimeseriesData(TimeseriesData data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)TimeseriesDataSet
alignToTimestamps(TimeseriesDataSet required)
void
append(TimeseriesDataSet data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)protected boolean
canEqual(java.lang.Object other)
void
clear()
Deprecated.(never use, major performance hit, could have led to unpredictable states)boolean
equals(java.lang.Object o)
java.sql.Timestamp
getMaxStamp()
TimeseriesDataSetMetaData
getMetaData()
java.lang.String
getMetaDataInfo(LoggingTimeZone timeZone)
java.sql.Timestamp
getMinStamp()
TimeseriesData
getTimeseriesData(int index)
TimeseriesData
getTimeseriesData(java.sql.Timestamp timestamp)
Returns the data at the given timestamp or null if the data is not foundTimeseriesData
getTimeseriesDataOrLast(java.sql.Timestamp timestamp)
Returns the data at the given timestamp or repeat the last value if there is no value found at the given timestamp If there is no value before that time, null is returnedjava.lang.String
getUnit()
Variable
getVariable()
Note: Not always available (depending on the extraction)VariableDataType
getVariableDataType()
java.lang.String
getVariableName()
int
hashCode()
static TimeseriesDataSet
of(Variable variable, java.util.List<TimeseriesData> data)
static TimeseriesDataSet
of(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
static TimeseriesDataSet
ofAggregated(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
static TimeseriesDataSet
ofDataDistribution(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
static TimeseriesDataSet
ofFundamentals(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
static TimeseriesDataSet
ofSorted(Variable variable, java.util.List<TimeseriesData> data)
static TimeseriesDataSet
ofSorted(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
void
print(LoggingTimeZone utcTime)
Deprecated.(never use, antipattern)boolean
remove(java.lang.Object o)
Deprecated.(never use, major performance hit, could have led to unpredictable states)boolean
removeAll(java.util.Collection<?> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)boolean
retainAll(java.util.Collection<?> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)-
Methods inherited from class java.util.ArrayList
add, addAll, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeIf, removeRange, replaceAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cern.nxcals.api.backport.domain.core.timeseriesdata.TimeseriesDataSet
listIterator
-
-
-
-
Method Detail
-
of
public static TimeseriesDataSet of(Variable variable, java.util.List<TimeseriesData> data)
-
ofSorted
public static TimeseriesDataSet ofSorted(Variable variable, java.util.List<TimeseriesData> data)
-
of
public static TimeseriesDataSet of(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofFundamentals
public static TimeseriesDataSet ofFundamentals(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofDataDistribution
public static TimeseriesDataSet ofDataDistribution(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofSorted
public static TimeseriesDataSet ofSorted(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
ofAggregated
public static TimeseriesDataSet ofAggregated(Variable variable, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataset)
-
getTimeseriesData
public TimeseriesData getTimeseriesData(int index)
- Specified by:
getTimeseriesData
in interfaceTimeseriesDataSet
- Parameters:
index
- - the index in this TimeseriesDataSet for which TimeseriesData should be returned.- Returns:
- - TimeseriesData at the given index within this TimeseriesDataSet
-
getVariableName
public java.lang.String getVariableName()
- Specified by:
getVariableName
in interfaceTimeseriesDataSet
- Returns:
- - the name of the Variable to which this TimeseriesData belongs
-
getUnit
public java.lang.String getUnit()
- Specified by:
getUnit
in interfaceTimeseriesDataSet
-
getVariableDataType
public VariableDataType getVariableDataType()
- Specified by:
getVariableDataType
in interfaceTimeseriesDataSet
- Returns:
- - the type of the Variable to which this TimeseriesData belongs
-
getTimeseriesDataOrLast
public TimeseriesData getTimeseriesDataOrLast(java.sql.Timestamp timestamp)
Description copied from interface:TimeseriesDataSet
Returns the data at the given timestamp or repeat the last value if there is no value found at the given timestamp If there is no value before that time, null is returned- Specified by:
getTimeseriesDataOrLast
in interfaceTimeseriesDataSet
- Parameters:
timestamp
- - The given timestamp- Returns:
- - The data at the given timestamp or just before
-
getTimeseriesData
public TimeseriesData getTimeseriesData(java.sql.Timestamp timestamp)
Description copied from interface:TimeseriesDataSet
Returns the data at the given timestamp or null if the data is not found- Specified by:
getTimeseriesData
in interfaceTimeseriesDataSet
- Returns:
-
getMetaDataInfo
public java.lang.String getMetaDataInfo(LoggingTimeZone timeZone)
- Specified by:
getMetaDataInfo
in interfaceTimeseriesDataSet
-
getMetaData
public TimeseriesDataSetMetaData getMetaData()
- Specified by:
getMetaData
in interfaceTimeseriesDataSet
-
alignToTimestamps
public TimeseriesDataSet alignToTimestamps(TimeseriesDataSet required)
- Specified by:
alignToTimestamps
in interfaceTimeseriesDataSet
-
print
@Deprecated public void print(LoggingTimeZone utcTime)
Deprecated.(never use, antipattern)- Specified by:
print
in interfaceTimeseriesDataSet
-
addTimeseriesData
@Deprecated public void addTimeseriesData(TimeseriesData data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
addTimeseriesData
in interfaceTimeseriesDataSet
- Parameters:
data
- - the TimeseriesData to be added to this TimeseriesDataSet
-
append
@Deprecated public void append(TimeseriesDataSet data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)Description copied from interface:TimeseriesDataSet
Appends a Timeseries Data Set to the end of the current data set- Specified by:
append
in interfaceTimeseriesDataSet
- Parameters:
data
- The data set to be appended
-
add
@Deprecated public boolean add(TimeseriesData data)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
add
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
add
in interfacejava.util.List<TimeseriesData>
- Overrides:
add
in classjava.util.ArrayList<TimeseriesData>
-
remove
@Deprecated public boolean remove(java.lang.Object o)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
remove
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
remove
in interfacejava.util.List<TimeseriesData>
- Overrides:
remove
in classjava.util.ArrayList<TimeseriesData>
-
addAll
@Deprecated public boolean addAll(java.util.Collection<? extends TimeseriesData> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
addAll
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
addAll
in interfacejava.util.List<TimeseriesData>
- Overrides:
addAll
in classjava.util.ArrayList<TimeseriesData>
-
removeAll
@Deprecated public boolean removeAll(java.util.Collection<?> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
removeAll
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
removeAll
in interfacejava.util.List<TimeseriesData>
- Overrides:
removeAll
in classjava.util.ArrayList<TimeseriesData>
-
retainAll
@Deprecated public boolean retainAll(java.util.Collection<?> c)
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
retainAll
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
retainAll
in interfacejava.util.List<TimeseriesData>
- Overrides:
retainAll
in classjava.util.ArrayList<TimeseriesData>
-
clear
@Deprecated public void clear()
Deprecated.(never use, major performance hit, could have led to unpredictable states)- Specified by:
clear
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
clear
in interfacejava.util.List<TimeseriesData>
- Overrides:
clear
in classjava.util.ArrayList<TimeseriesData>
-
getVariable
public Variable getVariable()
Description copied from interface:TimeseriesDataSet
Note: Not always available (depending on the extraction)- Specified by:
getVariable
in interfaceTimeseriesDataSet
- Returns:
-
getMinStamp
public java.sql.Timestamp getMinStamp()
- Specified by:
getMinStamp
in interfaceTimeseriesDataSet
- Returns:
- - the smallest timestamp in the timeseries data set
-
getMaxStamp
public java.sql.Timestamp getMaxStamp()
- Specified by:
getMaxStamp
in interfaceTimeseriesDataSet
- Returns:
- - the highest timestamp in the timeseries data set.
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
equals
in interfacejava.util.List<TimeseriesData>
- Overrides:
equals
in classjava.util.ArrayList<TimeseriesData>
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<TimeseriesData>
- Specified by:
hashCode
in interfacejava.util.List<TimeseriesData>
- Overrides:
hashCode
in classjava.util.ArrayList<TimeseriesData>
-
-