public class DefaultSqlBackedClient extends Object implements SqlBackedClient
Constructor and Description |
---|
DefaultSqlBackedClient(DataSource dataSource,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Creates a sql converter using the given database and datasource.
|
DefaultSqlBackedClient(String url,
String driver,
String username,
String password,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Creates a sql converter using the given database and datasource.
|
Modifier and Type | Method and Description |
---|---|
Future<com.fasterxml.jackson.databind.JsonNode> |
executeQuery(DruidQuery<?> druidQuery,
SuccessCallback successCallback,
FailureCallback failureCallback)
Uses a
DruidQuery to fetch results from a Sql client,
parses the results from Sql and returns an equivalent JsonNode
to what druid would respond with. |
public DefaultSqlBackedClient(DataSource dataSource, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws SQLException
dataSource
- The dataSource for the jdbc schema.objectMapper
- The mapper for all JSON processing.SQLException
- if can't read from database.public DefaultSqlBackedClient(String url, String driver, String username, String password, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws SQLException
url
- The url location of the database to connect to.driver
- The driver (i.e. "org.h2.Driver") to connect with.username
- The username to connect to the database.password
- The password to connect to the database.objectMapper
- The mapper for all JSON processing.SQLException
- if can't read from database.public Future<com.fasterxml.jackson.databind.JsonNode> executeQuery(DruidQuery<?> druidQuery, SuccessCallback successCallback, FailureCallback failureCallback)
SqlBackedClient
DruidQuery
to fetch results from a Sql client,
parses the results from Sql and returns an equivalent JsonNode
to what druid would respond with.executeQuery
in interface SqlBackedClient
druidQuery
- The query to be executed.successCallback
- The callback for handling a successful result.failureCallback
- The callback for handling exceptionsCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.