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| Modifier and Type | Field and Description |
|---|---|
protected static String |
TOPIC_KEY |
protected Option |
topicOption |
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, isStateful, onError, publish, retryPublish, setConnected, shutdownprotected static final String TOPIC_KEY
protected Option topicOption
public Class[] getSupportedInputEventClasses()
getSupportedInputEventClasses in class Sink<State>protected ServiceDeploymentInfo exposeServiceDeploymentInfo()
SinkexposeServiceDeploymentInfo in class Sink<State>public String[] getSupportedDynamicOptions()
SinkgetSupportedDynamicOptions in class Sink<State>protected StateFactory<State> init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition, OptionHolder optionHolder, ConfigReader sinkConfigReader, SiddhiAppContext siddhiAppContext)
SinkSinkinit in class Sink<State>outputStreamDefinition - containing stream definition bind to the SinkoptionHolder - Option holder containing static and dynamic options related to the SinksinkConfigReader - this hold the Sink extensions configuration reader.siddhiAppContext - SiddhiAppContext of the parent siddhi app.public void connect()
throws ConnectionUnavailableException
Sinkconnect in class Sink<State>ConnectionUnavailableException - if it cannot connect to the backendpublic void disconnect()
Sinkdisconnect in class Sink<State>public void destroy()
Sinkpublic void publish(Object payload, DynamicOptions dynamicOptions, State s) throws ConnectionUnavailableException
Sinkpublish 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 © 2022. All rights reserved.