net.opentsdb.core
public interface DataPoints extends Iterable<DataPoint>
Implementations of this interface aren't expected to be synchronized.
Modifier and Type | Method and Description |
---|---|
int |
aggregatedSize()
Returns the number of data points aggregated in this instance.
|
double |
doubleValue(int i)
Returns the value of the
i th data point as a float. |
List<String> |
getAggregatedTags()
Returns the tags associated with some but not all of the data points.
|
com.stumbleupon.async.Deferred<List<String>> |
getAggregatedTagsAsync()
Returns the tags associated with some but not all of the data points.
|
List<Annotation> |
getAnnotations()
Compiles the annotations for each span into a new array list
|
Map<String,String> |
getTags()
Returns the tags associated with these data points.
|
com.stumbleupon.async.Deferred<Map<String,String>> |
getTagsAsync()
Returns the tags associated with these data points.
|
List<String> |
getTSUIDs()
Returns a list of unique TSUIDs contained in the results
|
boolean |
isInteger(int i)
Tells whether or not the
i th value is of integer type. |
SeekableView |
iterator()
Returns a zero-copy view to go through
size() data points. |
long |
longValue(int i)
Returns the value of the
i th data point as a long. |
String |
metricName()
Returns the name of the series.
|
com.stumbleupon.async.Deferred<String> |
metricNameAsync()
Returns the name of the series.
|
int |
size()
Returns the number of data points.
|
long |
timestamp(int i)
Returns the timestamp associated with the
i th data point. |
String metricName()
com.stumbleupon.async.Deferred<String> metricNameAsync()
Map<String,String> getTags()
null
map of tag names (keys), tag values (values).com.stumbleupon.async.Deferred<Map<String,String>> getTagsAsync()
null
map of tag names (keys), tag values (values).List<String> getAggregatedTags()
When this instance represents the aggregation of multiple time series
(same metric but different tags), getTags()
returns the tags that
are common to all data points (intersection set) whereas this method
returns all the tags names that are not common to all data points (union
set minus the intersection set, also called the symmetric difference).
If this instance does not represent an aggregation of multiple time series, the list returned is empty.
null
list of tag names.com.stumbleupon.async.Deferred<List<String>> getAggregatedTagsAsync()
When this instance represents the aggregation of multiple time series
(same metric but different tags), getTags()
returns the tags that
are common to all data points (intersection set) whereas this method
returns all the tags names that are not common to all data points (union
set minus the intersection set, also called the symmetric difference).
If this instance does not represent an aggregation of multiple time series, the list returned is empty.
null
list of tag names.List<String> getTSUIDs()
List<Annotation> getAnnotations()
int size()
This method must be implemented in O(1)
or O(n)
where n =
.aggregatedSize()
> 0
int aggregatedSize()
When this instance represents the aggregation of multiple time series
(same metric but different tags), size()
returns the number of data
points after aggregation, whereas this method returns the number of data
points before aggregation.
If this instance does not represent an aggregation of multiple time series, then 0 is returned.
SeekableView iterator()
size()
data points.
The iterator returned must return each DataPoint
in O(1)
.
The DataPoint
returned must not be stored and gets
invalidated as soon as next
is called on the iterator. If you
want to store individual data points, you need to copy the timestamp
and value out of each DataPoint
into your own data structures.
long timestamp(int i)
i
th data point.
The first data point has index 0.
This method must be implemented in
O(
or better.
aggregatedSize()
)
It is guaranteed that
timestamp(i) < timestamp(i+1)
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
boolean isInteger(int i)
i
th value is of integer type.
The first data point has index 0.
This method must be implemented in
O(
or better.aggregatedSize()
)
true
if the i
th value is of integer type,
false
if it's of floating point type.IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
long longValue(int i)
i
th data point as a long.
The first data point has index 0.
This method must be implemented in
O(
or better.
Use aggregatedSize()
)iterator()
to get successive O(1)
accesses.
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
ClassCastException
- if the
isInteger(i)
== false
.iterator()
double doubleValue(int i)
i
th data point as a float.
The first data point has index 0.
This method must be implemented in
O(
or better.
Use aggregatedSize()
)iterator()
to get successive O(1)
accesses.
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
ClassCastException
- if the
isInteger(i)
== true
.iterator()