Package org.apache.druid.client.broker
Interface BrokerClient
- All Known Implementing Classes:
BrokerClientImpl
public interface BrokerClient
High-level Broker client.
All methods return futures, enabling asynchronous logic. If you want a synchronous response, use
FutureUtils.get or FutureUtils.getUnchecked.
Futures resolve to exceptions in the manner described by ServiceClient.asyncRequest(org.apache.druid.rpc.RequestBuilder, org.apache.druid.java.util.http.client.response.HttpResponseHandler<IntermediateType, FinalType>).
ServiceClientModule.-
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.
-
Method Details
-
submitNativeQuery
Submits the given query to the/druid/v2endpoint of a Broker. -
submitSqlQuery
Submit the givensqlQueryto the Broker's SQL query endpoint,/druid/v2/sql/. -
submitSqlTask
com.google.common.util.concurrent.ListenableFuture<SqlTaskStatus> submitSqlTask(ClientSqlQuery sqlQuery) Submit the givensqlQueryto the Broker's SQL task endpoint,/druid/v2/sql/task/. -
fetchExplainPlan
com.google.common.util.concurrent.ListenableFuture<List<ExplainPlan>> fetchExplainPlan(ClientSqlQuery sqlQuery) Fetches the explain plan for the givensqlQueryfrom the Broker's SQL task endpoint.- Parameters:
sqlQuery- the SQL query for which theEXPLAIN PLAN FORinformation is to be fetched
-
updateCoordinatorDynamicConfig
com.google.common.util.concurrent.ListenableFuture<Boolean> updateCoordinatorDynamicConfig(CoordinatorDynamicConfig config) Updates the broker with the givenCoordinatorDynamicConfig. -
updateBrokerDynamicConfig
com.google.common.util.concurrent.ListenableFuture<Boolean> updateBrokerDynamicConfig(BrokerDynamicConfig config) Updates the broker with the givenBrokerDynamicConfig. -
getQueryReport
com.google.common.util.concurrent.ListenableFuture<String> getQueryReport(String sqlQueryId, boolean selfOnly) Gets the report for a SQL query by its SQL query ID.- 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
Cancels a SQL query by its SQL query ID.- Parameters:
sqlQueryId- the SQL query ID to cancel- Returns:
- true if the cancellation was accepted
-