public class InMemorySink extends Sink<State>
Sink
which represents in-memory transport. This implementation can send incoming objects
to in-memory transport within JVM.Sink.OnErrorAction
isTryingToConnect
Constructor and Description |
---|
InMemorySink() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Called to connect to the backend before events are published
|
void |
destroy()
Called at the end to clean all the resources consumed
|
void |
disconnect()
Called after all publishing is done, or when ConnectionUnavailableException is thrown
|
protected ServiceDeploymentInfo |
exposeServiceDeploymentInfo()
Give information to the deployment about the service exposed by the sink.
|
String[] |
getSupportedDynamicOptions()
Supported dynamic options by the transport
|
Class[] |
getSupportedInputEventClasses() |
protected StateFactory<State> |
init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition,
OptionHolder optionHolder,
ConfigReader sinkConfigReader,
SiddhiAppContext siddhiAppContext)
Will be called for initialing the
Sink |
void |
publish(Object payload,
DynamicOptions dynamicOptions,
State s)
Sending events via output transport
|
connectWithRetry, getHandler, getMapper, getServiceDeploymentInfoList, getStreamDefinition, getType, init, initOnlyTransport, isConnected, publish, setConnected, shutdown
public Class[] getSupportedInputEventClasses()
getSupportedInputEventClasses
in class Sink<State>
protected ServiceDeploymentInfo exposeServiceDeploymentInfo()
Sink
exposeServiceDeploymentInfo
in class Sink<State>
public String[] getSupportedDynamicOptions()
Sink
getSupportedDynamicOptions
in class Sink<State>
protected StateFactory<State> init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition, OptionHolder optionHolder, ConfigReader sinkConfigReader, SiddhiAppContext siddhiAppContext)
Sink
Sink
init
in class Sink<State>
outputStreamDefinition
- containing stream definition bind to the Sink
optionHolder
- Option holder containing static and dynamic options related to the Sink
sinkConfigReader
- this hold the Sink
extensions configuration reader.siddhiAppContext
- SiddhiAppContext
of the parent siddhi app.public void connect() throws ConnectionUnavailableException
Sink
connect
in class Sink<State>
ConnectionUnavailableException
- if it cannot connect to the backendpublic void disconnect()
Sink
disconnect
in class Sink<State>
public void destroy()
Sink
public void publish(Object payload, DynamicOptions dynamicOptions, State s) throws ConnectionUnavailableException
Sink
publish
in class Sink<State>
payload
- payload of the eventdynamicOptions
- of the event constructing the payloads
- current state of the sinkConnectionUnavailableException
- throw when connections are unavailable.Copyright © 2019. All rights reserved.