Package org.apache.druid.client.broker
Class BrokerClientImpl
java.lang.Object
org.apache.druid.client.broker.BrokerClientImpl
- All Implemented Interfaces:
BrokerClient
-
Constructor Summary
ConstructorsConstructorDescriptionBrokerClientImpl(ServiceClient client, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.ListenableFuture<Boolean>cancelSqlQuery(String sqlQueryId) Cancels a SQL query by its SQL query ID.com.google.common.util.concurrent.ListenableFuture<List<ExplainPlan>>fetchExplainPlan(ClientSqlQuery sqlQuery) Fetches the explain plan for the givensqlQueryfrom the Broker's SQL task endpoint.com.google.common.util.concurrent.ListenableFuture<String>getQueryReport(String sqlQueryId, boolean selfOnly) Gets the report for a SQL query by its SQL query ID.com.google.common.util.concurrent.ListenableFuture<String>submitNativeQuery(Query<?> query) Submits the given query to the/druid/v2endpoint of a Broker.com.google.common.util.concurrent.ListenableFuture<String>submitSqlQuery(ClientSqlQuery sqlQuery) Submit the givensqlQueryto the Broker's SQL query endpoint,/druid/v2/sql/.com.google.common.util.concurrent.ListenableFuture<SqlTaskStatus>submitSqlTask(ClientSqlQuery sqlQuery) Submit the givensqlQueryto the Broker's SQL task endpoint,/druid/v2/sql/task/.com.google.common.util.concurrent.ListenableFuture<Boolean>Updates the broker with the givenBrokerDynamicConfig.com.google.common.util.concurrent.ListenableFuture<Boolean>Updates the broker with the givenCoordinatorDynamicConfig.
-
Constructor Details
-
BrokerClientImpl
public BrokerClientImpl(ServiceClient client, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
-
Method Details
-
submitNativeQuery
Description copied from interface:BrokerClientSubmits the given query to the/druid/v2endpoint of a Broker.- Specified by:
submitNativeQueryin interfaceBrokerClient
-
submitSqlQuery
public com.google.common.util.concurrent.ListenableFuture<String> submitSqlQuery(ClientSqlQuery sqlQuery) Description copied from interface:BrokerClientSubmit the givensqlQueryto the Broker's SQL query endpoint,/druid/v2/sql/.- Specified by:
submitSqlQueryin interfaceBrokerClient
-
submitSqlTask
public com.google.common.util.concurrent.ListenableFuture<SqlTaskStatus> submitSqlTask(ClientSqlQuery sqlQuery) Description copied from interface:BrokerClientSubmit the givensqlQueryto the Broker's SQL task endpoint,/druid/v2/sql/task/.- Specified by:
submitSqlTaskin interfaceBrokerClient
-
fetchExplainPlan
public com.google.common.util.concurrent.ListenableFuture<List<ExplainPlan>> fetchExplainPlan(ClientSqlQuery sqlQuery) Description copied from interface:BrokerClientFetches the explain plan for the givensqlQueryfrom the Broker's SQL task endpoint.- Specified by:
fetchExplainPlanin interfaceBrokerClient- Parameters:
sqlQuery- the SQL query for which theEXPLAIN PLAN FORinformation is to be fetched
-
updateCoordinatorDynamicConfig
public com.google.common.util.concurrent.ListenableFuture<Boolean> updateCoordinatorDynamicConfig(CoordinatorDynamicConfig config) Description copied from interface:BrokerClientUpdates the broker with the givenCoordinatorDynamicConfig.- Specified by:
updateCoordinatorDynamicConfigin interfaceBrokerClient
-
updateBrokerDynamicConfig
public com.google.common.util.concurrent.ListenableFuture<Boolean> updateBrokerDynamicConfig(BrokerDynamicConfig config) Description copied from interface:BrokerClientUpdates the broker with the givenBrokerDynamicConfig.- Specified by:
updateBrokerDynamicConfigin interfaceBrokerClient
-
getQueryReport
public com.google.common.util.concurrent.ListenableFuture<String> getQueryReport(String sqlQueryId, boolean selfOnly) Description copied from interface:BrokerClientGets the report for a SQL query by its SQL query ID.- Specified by:
getQueryReportin interfaceBrokerClient- Parameters:
sqlQueryId- the SQL query IDselfOnly- if true, only check the local broker; if false, check all brokers- Returns:
- JSON response from the report API
-
cancelSqlQuery
public com.google.common.util.concurrent.ListenableFuture<Boolean> cancelSqlQuery(String sqlQueryId) Description copied from interface:BrokerClientCancels a SQL query by its SQL query ID.- Specified by:
cancelSqlQueryin interfaceBrokerClient- Parameters:
sqlQueryId- the SQL query ID to cancel- Returns:
- true if the cancellation was accepted
-