public class InMemorySink extends Sink
Sink which represents in-memory transport. This implementation can send incoming objects
to in-memory transport within JVM.isTryingToConnect| Constructor and Description |
|---|
InMemorySink() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Called to connect to the backend before events are published
|
Map<String,Object> |
currentState()
Used to collect the serializable state of the processing element, that need to be
persisted for the reconstructing the element to the same state on a different point of time
|
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
|
String[] |
getSupportedDynamicOptions()
Supported dynamic options by the transport
|
Class[] |
getSupportedInputEventClasses() |
protected void |
init(org.wso2.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)
Sending events via output transport
|
void |
restoreState(Map<String,Object> state)
Used to restore serialized state of the processing element, for reconstructing
the element to the same state as if was on a previous point of time.
|
connectWithRetry, getElementId, getHandler, getMapper, getStreamDefinition, getType, init, initOnlyTransport, isConnected, publish, setConnected, shutdownpublic Class[] getSupportedInputEventClasses()
getSupportedInputEventClasses in class Sinkpublic String[] getSupportedDynamicOptions()
SinkgetSupportedDynamicOptions in class Sinkprotected void init(org.wso2.siddhi.query.api.definition.StreamDefinition outputStreamDefinition,
OptionHolder optionHolder,
ConfigReader sinkConfigReader,
SiddhiAppContext siddhiAppContext)
SinkSinkinit in class SinkoutputStreamDefinition - 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 SinkConnectionUnavailableException - if it cannot connect to the backendpublic void disconnect()
Sinkdisconnect in class Sinkpublic void destroy()
Sinkpublic void publish(Object payload, DynamicOptions dynamicOptions) throws ConnectionUnavailableException
Sinkpublish in class Sinkpayload - payload of the eventdynamicOptions - one of the event constructing the payloadConnectionUnavailableException - throw when connections are unavailable.public Map<String,Object> currentState()
Snapshotablepublic void restoreState(Map<String,Object> state)
Snapshotablestate - the stateful objects of the element as an array on
the same order provided by currentState().Copyright © 2018 WSO2. All rights reserved.