Custom State Managers
Custom state managers can be created and added to runners to utilize new data sources, if needed.
Base State Managers
public class MyStateManager<T> extends StateManager<T>{
/**
* Constructor with provided "alias", event runner which owns the manager
* as well as all the configurations available to the runner
*/
public MyStateManager(String name, EventRunner runner, Map<String, String> config) {
super(name, runner, config);
}
/**
* Function called during initialization of a state manager, typically
* used to establish connections.
*/
@Override
public void configure() throws HotException {
}
/**
* Function called when the runner performs a commit action, typically
* used to process buffers or commit to external systems.
*/
@Override
public void commit() throws HotException {
}
/**
* Function called during termination of a state manager, typically
* used to close connections with external systems.
*/
@Override
public void close() throws IOException {
}
/**
* Function called for reading a single record for given id from
* the state manager and returning selected data fields.
* Data can be returned in any format preferred by the target
* system, as convertToAggregate function is called for the output.
*/
@Override
public Object getRawValueByID(String ID, String fields[]) throws HotException {
}
/**
* Function called for reading a list of records for given ids from
* the state manager and returning selected data fields.
* Data can be returned in any format preferred by the target
* system, as convertToAggregate function is called for the output.
*/
public Stream getRawStreamByID(String[] IDs, String fields[]) throws HotException {
}
/**
* Function called for streaming records from
* the state manager and returning selected data fields.
* Data can be returned in any format preferred by the target
* system, as convertToAggregate function is called for the output.
* Typically limit and skip are also applied on the returned stream.
*/
public Stream getRawStream(String fields[]) throws HotException {
}
/**
* Function called for translating target system specific records
* into aggregates of T type, usually utilizing JSON manipulation
* or similar conversion techniques.
*/
public Aggregate<T> convertToAggregate(Object object) throws HotException {
}
}Writeable State Managers
End State Managers
Journal Store Managers
Read Functions
Write Functions
Special Interfaces
Bulkable Interface
Queryable Interface
Journalable Interface
Customizable Interface
ID Generators
Last updated
