com.cloudera.api.v4
Interface ImpalaQueriesResource

All Known Subinterfaces:
ImpalaQueriesResourceV6

public interface ImpalaQueriesResource


Method Summary
 ApiImpalaCancelResponse cancelImpalaQuery(String serviceName, String queryId)
          Cancels an Impala Query.
 ApiImpalaQueryResponse getImpalaQueries(String serviceName, String query, String from, String to, int limit, int offset)
          Returns a list of queries that satisfy the filter
 ApiImpalaQueryDetailsResponse getQueryDetails(String queryId, String format)
          Returns details about the query.
 

Method Detail

getImpalaQueries

@Path(value="/")
ApiImpalaQueryResponse getImpalaQueries(String serviceName,
                                             String query,
                                             String from,
                                             String to,
                                             int limit,
                                             int offset)
Returns a list of queries that satisfy the filter

Available since API v4.

Parameters:
serviceName - The name of the service
query - A filter to apply to the queries. A basic filter tests the value of an attribute and looks something like 'rowsFetched = 1' or 'user = root'. Multiple basic filters can be combined into a complex expression using standard and / or boolean logic and parenthesis. An example of a complex filter is: 'query_duration > 5s and (user = root or user = myUserName)'. An example of expected full query string in requested URL is: '?filter=(query_duration > 5s and (user = root or user = myUserName))'.
from - Start of the period to query in ISO 8601 format (defaults to 5 minutes before the 'to' time).
to - End of the period to query in ISO 8601 format (defaults to current time).
limit - The maximum number of queries to return. Queries will be returned in the following order:
  • All executing queries, ordered from longest to shortest running
  • All completed queries order by end time descending.
offset - The offset to start returning queries from. This is useful for paging through lists of queries. Note that this has non-deterministic behavior if executing queries are included in the response because they can disappear from the list while paging. To exclude executing queries from the response and a 'executing = false' clause to your filter.
Returns:
A list of impala queries and warnings

getQueryDetails

@Path(value="/{queryId: [a-zA-Z0-9]+:[a-zA-Z0-9]+}")
ApiImpalaQueryDetailsResponse getQueryDetails(String queryId,
                                                   String format)
Returns details about the query. Not all queries have details, check the detailsAvailable field from the getQueries response.

Available since API v4.

Parameters:
queryId - The queryId to get information about
format - There are two valid format parameters:
  • 'text': this is a text based, human readable representation of the Impala runtime profile.
  • 'thrift_encoded': this a compact-thrift, base64 encoded representation of the Impala RuntimeProfile.thrift object. See the Impala documentation for more details.
Returns:
The query details

cancelImpalaQuery

@Path(value="/{queryId}/cancel")
ApiImpalaCancelResponse cancelImpalaQuery(String serviceName,
                                               String queryId)
Cancels an Impala Query.

Available since API v4.

Parameters:
serviceName - The name of the service
queryId - The queryId to cancel
Returns:
A warning if there was one. Otherwise null.


Copyright © Cloudera, Inc. Released under Apache License, Version 2.0.