net.opentsdb.core
public final class TSQuery extends Object
validateAndSetQuery()
method to
validate the request. If required information is missing or cannot be parsed
it will throw an exception. If validation passes, use
buildQueries(TSDB)
to compile the query into Query
objects
for processing.
Note: If using POJO deserialization, make sure to avoid setting the
start_time
and end_time
fields.Constructor and Description |
---|
TSQuery()
Default constructor necessary for POJO de/serialization
|
Modifier and Type | Method and Description |
---|---|
Query[] |
buildQueries(TSDB tsdb)
Compiles the TSQuery into an array of Query objects for execution.
|
long |
endTime() |
String |
getEnd() |
boolean |
getGlobalAnnotations() |
boolean |
getMsResolution() |
boolean |
getNoAnnotations() |
Map<String,ArrayList<String>> |
getOptions() |
boolean |
getPadding() |
List<TSSubQuery> |
getQueries() |
boolean |
getShowTSUIDs() |
String |
getStart() |
String |
getTimezone() |
void |
setEnd(String end)
Optionally sets the end time for all queries.
|
void |
setGlobalAnnotations(boolean with_global) |
void |
setMsResolution(boolean ms_resolution) |
void |
setNoAnnotations(boolean no_annotations) |
void |
setOptions(HashMap<String,ArrayList<String>> options) |
void |
setPadding(boolean padding) |
void |
setQueries(ArrayList<TSSubQuery> queries) |
void |
setShowTSUIDs(boolean show_tsuids) |
void |
setStart(String start)
Sets the start time for further parsing.
|
void |
setTimezone(String timezone) |
long |
startTime() |
String |
toString() |
void |
validateAndSetQuery()
Runs through query parameters to make sure it's a valid request.
|
public void validateAndSetQuery()
start_time
and end_time
fields as well as
sets the TSSubQuery
fields necessary for execution.IllegalArgumentException
- if something is wrong with the querypublic Query[] buildQueries(TSDB tsdb)
tsdb
- The tsdb to use for TSDB.newQuery()
public long startTime()
public long endTime()
public String getStart()
public String getEnd()
public String getTimezone()
public boolean getPadding()
public boolean getNoAnnotations()
public boolean getGlobalAnnotations()
public boolean getShowTSUIDs()
public List<TSSubQuery> getQueries()
public boolean getMsResolution()
public void setStart(String start)
DateTime.parseDateTimeString(java.lang.String, java.lang.String)
for details.start
- A start time from the userpublic void setEnd(String end)
DateTime.parseDateTimeString(java.lang.String, java.lang.String)
for details.end
- An end time from the userpublic void setTimezone(String timezone)
timezone
- an optional timezone for date parsingpublic void setOptions(HashMap<String,ArrayList<String>> options)
options
- a map of options to pass on to the serializerpublic void setPadding(boolean padding)
padding
- whether or not the query should include paddingpublic void setNoAnnotations(boolean no_annotations)
no_annotations
- whether or not to suppress annotation outputpublic void setGlobalAnnotations(boolean with_global)
with_global
- whether or not to load global annotationspublic void setShowTSUIDs(boolean show_tsuids)
show_tsuids
- whether or not to show TSUIDs in outputpublic void setQueries(ArrayList<TSSubQuery> queries)
queries
- a list of TSSubQuery
objects to storepublic void setMsResolution(boolean ms_resolution)
ms_resolution
- whether or not the user wants millisecond resolution