Package org.kairosdb.client
Interface Client
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
HttpClient
public interface Client extends Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RollupTaskcreateRollupTask(RollupBuilder builder)Create a new roll-up.voiddelete(QueryBuilder builder)Deletes data in KairosDB using the query built by the builder.voiddeleteMetric(String name)Deletes a metric.voiddeleteRollupTask(String id)Delete the roll-up.ClassgetDataPointValueClass(String groupType)Returns the data point value class for the given group type or null if one is not registered for the group typeObjectgetMetricNames()Returns a list of all metric names.RollupTaskgetRollupTask(String id)Returns the roll-up.List<RollupTask>getRollupTasks()Returns a list of all roll-up tasks.List<String>getStatus()Returns status of Kairos Instance.intgetStatusCheck()Returns a status code fo 204 if all is healthy.StringgetVersion()Returns the version string for the KairosDB server.voidpushMetrics(MetricBuilder builder)Sends metrics from the builder to the KairosDB server.QueryResponsequery(QueryBuilder builder)Queries KairosDB using the query built by the builder.<T> Tquery(QueryBuilder builder, JsonResponseHandler<T> handler)Queries KairosDB using the query built by the builder.QueryTagResponsequeryTags(QueryTagBuilder builder)Queries KairosDB tags using the query built by the builder.<T> TqueryTags(QueryTagBuilder builder, JsonResponseHandler<T> handler)Queries KairosDB tags using the query built by the builder.voidregisterCustomDataType(String groupType, Class dataPointValueClass)Registers a new custom data type.
-
-
-
Method Detail
-
createRollupTask
RollupTask createRollupTask(RollupBuilder builder)
Create a new roll-up.- Parameters:
builder- roll-up builder- Returns:
- newly created roll-up task
- Throws:
UnexpectedResponseException- if the operation fails
-
deleteRollupTask
void deleteRollupTask(String id)
Delete the roll-up. Throws an exception if the delete fails.- Parameters:
id- identifier of the roll-up- Throws:
UnexpectedResponseException- if the operation fails
-
getRollupTasks
List<RollupTask> getRollupTasks()
Returns a list of all roll-up tasks.- Returns:
- list of roll-up tasks
- Throws:
UnexpectedResponseException- if the operation fails
-
getRollupTask
RollupTask getRollupTask(String id)
Returns the roll-up.- Parameters:
id- roll-up identifier- Returns:
- roll-up or null if no roll-ups match the specified identifier
- Throws:
UnexpectedResponseException- if the operation fails
-
getMetricNames
Object getMetricNames()
Returns a list of all metric names.- Returns:
- list of all metric names
- Throws:
UnexpectedResponseException- if the operation fails
-
getStatus
List<String> getStatus()
Returns status of Kairos Instance.- Returns:
- status of Kairos instance
- Throws:
UnexpectedResponseException- if the operation fails
-
getStatusCheck
int getStatusCheck()
Returns a status code fo 204 if all is healthy.- Returns:
- status of Kairos instance
- Throws:
UnexpectedResponseException- if the operation fails
-
query
<T> T query(QueryBuilder builder, JsonResponseHandler<T> handler)
Queries KairosDB using the query built by the builder.- Parameters:
builder- query builderhandler- response handler- Returns:
- query response
- Throws:
UnexpectedResponseException- if the operation fails
-
query
QueryResponse query(QueryBuilder builder)
Queries KairosDB using the query built by the builder.- Parameters:
builder- query builder- Returns:
- query response
- Throws:
UnexpectedResponseException- if the operation fails
-
queryTags
QueryTagResponse queryTags(QueryTagBuilder builder)
Queries KairosDB tags using the query built by the builder.- Parameters:
builder- query tag builder- Returns:
- query response
- Throws:
UnexpectedResponseException- if the operation fails
-
queryTags
<T> T queryTags(QueryTagBuilder builder, JsonResponseHandler<T> handler)
Queries KairosDB tags using the query built by the builder.- Parameters:
builder- query tag builder- Returns:
- query response
- Throws:
UnexpectedResponseException- if the operation fails
-
pushMetrics
void pushMetrics(MetricBuilder builder)
Sends metrics from the builder to the KairosDB server.- Parameters:
builder- metrics builder- Throws:
UnexpectedResponseException- if the operation fails
-
deleteMetric
void deleteMetric(String name)
Deletes a metric. This is the metric and all its data points. An exception is thrown if this operation fails.- Parameters:
name- the metric to delete- Throws:
UnexpectedResponseException- if the operation fails
-
delete
void delete(QueryBuilder builder)
Deletes data in KairosDB using the query built by the builder. An exception is thrown if this operation fails.- Parameters:
builder- query builder- Throws:
UnexpectedResponseException- if the operation fails
-
getVersion
String getVersion()
Returns the version string for the KairosDB server.- Returns:
- KairosDB version
-
registerCustomDataType
void registerCustomDataType(String groupType, Class dataPointValueClass)
Registers a new custom data type. The assumption is that this data type already exists on the server. The dataPointValueClass is used to serialize and deserialize the custom type. This is simply a POJO.- Parameters:
groupType- type used to deserialize the json on the clientdataPointValueClass- class that is the value of a data point
-
-