Custom Query Managers
Custom state managers can be created and added to runners to query new data sources, if needed.
public class MyQueryManager extends QueryManager{
/**
* Constructor with provided "alias", event runner which owns the manager
* as well as all the configurations available to the runner
*/
public MyQueryManager(String name, EventRunner runner, Map<String, String> config) {
super(name, runner, config);
}
/**
* Function called during initialization of a query manager, typically
* used to establish connections.
*/
@Override
public void configure() throws HotException {
}
/**
* Function called during termination of a query manager, typically
* used to close connections with external systems.
*/
@Override
public void close() throws IOException {
}
/**
* Function called for streaming records from
* the query manager for a given query definition.
* Data can be returned in any format preferred by the target
* system, as convertToJson function is called for the output.
*/
@Override
public abstract Stream getRawQueryStream(Query query, InjectionHelper helper) throws HotException{
}
/**
* Function called for translating target system specific records
* into JsonNode.
*/
public JsonNode convertToJson(Object object) throws HotException{
}
}Last updated
