Package io.siddhi.core
Class SiddhiAppRuntimeImpl
- java.lang.Object
-
- io.siddhi.core.SiddhiAppRuntimeImpl
-
- All Implemented Interfaces:
SiddhiAppRuntime
public class SiddhiAppRuntimeImpl extends Object implements SiddhiAppRuntime
Keep streamDefinitions, partitionRuntimes, queryRuntimes of an SiddhiApp and streamJunctions and inputHandlers used.
-
-
Constructor Summary
Constructors Constructor Description SiddhiAppRuntimeImpl(Map<String,io.siddhi.query.api.definition.AbstractDefinition> streamDefinitionMap, Map<String,io.siddhi.query.api.definition.AbstractDefinition> tableDefinitionMap, Map<String,io.siddhi.query.api.definition.AbstractDefinition> windowDefinitionMap, Map<String,io.siddhi.query.api.definition.AbstractDefinition> aggregationDefinitionMap, InputManager inputManager, Map<String,QueryRuntime> queryProcessorMap, Map<String,StreamJunction> streamJunctionMap, Map<String,Table> tableMap, Map<String,Window> windowMap, ConcurrentMap<String,AggregationRuntime> aggregationMap, Map<String,List<Source>> sourceMap, Map<String,List<Sink>> sinkMap, Map<String,PartitionRuntime> partitionMap, ConcurrentMap<String,Trigger> triggerMap, SiddhiAppContext siddhiAppContext, Map<String,SiddhiAppRuntime> siddhiAppRuntimeMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCallback(String queryName, QueryCallback callback)voidaddCallback(String streamId, StreamCallback streamCallback)voidclearAllRevisions()SiddhiDebuggerdebug()voidenablePlayBack(boolean playBackEnabled, Long idleTime, Long incrementInMilliseconds)To enable and disable Siddhi App playback mode on runtime along with optional parameters.Map<String,io.siddhi.query.api.definition.AggregationDefinition>getAggregationDefinitionMap()Get the aggregation definition map.InputHandlergetInputHandler(String streamId)StringgetName()io.siddhi.query.api.definition.Attribute[]getOnDemandQueryOutputAttributes(io.siddhi.query.api.execution.query.OnDemandQuery onDemandQuery)io.siddhi.query.api.definition.Attribute[]getOnDemandQueryOutputAttributes(String onDemandQuery)Map<String,Map<String,io.siddhi.query.api.definition.AbstractDefinition>>getPartitionedInnerStreamDefinitionMap()Collection<PartitionRuntime>getPartitions()Collection<QueryRuntime>getQueries()Set<String>getQueryNames()Get the names of the available queries.io.siddhi.query.api.SiddhiAppgetSiddhiApp()Collection<List<Sink>>getSinks()Collection<List<Source>>getSources()LevelgetStatisticsLevel()Method to check the Siddhi App statistics level enabled.io.siddhi.query.api.definition.Attribute[]getStoreQueryOutputAttributes(io.siddhi.query.api.execution.query.StoreQuery storeQuery)Deprecated.io.siddhi.query.api.definition.Attribute[]getStoreQueryOutputAttributes(String onDemandQuery)Deprecated.Map<String,io.siddhi.query.api.definition.StreamDefinition>getStreamDefinitionMap()Get the stream definition map.Map<String,io.siddhi.query.api.definition.TableDefinition>getTableDefinitionMap()Get the table definition map.TableInputHandlergetTableInputHandler(String tableId)Collection<Table>getTables()Collection<Trigger>getTiggers()Set<String>getWarnings()Method to get Siddhi App runtime warnings.Map<String,io.siddhi.query.api.definition.WindowDefinition>getWindowDefinitionMap()Get the window definition map.Collection<Window>getWindows()voidhandleExceptionWith(com.lmax.disruptor.ExceptionHandler<Object> exceptionHandler)voidhandleRuntimeExceptionWith(ExceptionListener exceptionListener)PersistenceReferencepersist()Event[]query(io.siddhi.query.api.execution.query.OnDemandQuery onDemandQuery)Event[]query(io.siddhi.query.api.execution.query.StoreQuery storeQuery)Deprecated.Event[]query(String onDemandQuery)voidremoveCallback(QueryCallback callback)voidremoveCallback(StreamCallback streamCallback)voidrestore(byte[] snapshot)StringrestoreLastRevision()voidrestoreRevision(String revision)voidsetPurgingEnabled(boolean purgingEnabled)voidsetStatisticsLevel(Level level)To enable, disable and change Siddhi App statistics level on runtime.voidshutdown()byte[]snapshot()voidstart()voidstartSources()voidstartWithoutSources()
-
-
-
Constructor Detail
-
SiddhiAppRuntimeImpl
public SiddhiAppRuntimeImpl(Map<String,io.siddhi.query.api.definition.AbstractDefinition> streamDefinitionMap, Map<String,io.siddhi.query.api.definition.AbstractDefinition> tableDefinitionMap, Map<String,io.siddhi.query.api.definition.AbstractDefinition> windowDefinitionMap, Map<String,io.siddhi.query.api.definition.AbstractDefinition> aggregationDefinitionMap, InputManager inputManager, Map<String,QueryRuntime> queryProcessorMap, Map<String,StreamJunction> streamJunctionMap, Map<String,Table> tableMap, Map<String,Window> windowMap, ConcurrentMap<String,AggregationRuntime> aggregationMap, Map<String,List<Source>> sourceMap, Map<String,List<Sink>> sinkMap, Map<String,PartitionRuntime> partitionMap, ConcurrentMap<String,Trigger> triggerMap, SiddhiAppContext siddhiAppContext, Map<String,SiddhiAppRuntime> siddhiAppRuntimeMap)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceSiddhiAppRuntime
-
getStreamDefinitionMap
public Map<String,io.siddhi.query.api.definition.StreamDefinition> getStreamDefinitionMap()
Get the stream definition map.- Specified by:
getStreamDefinitionMapin interfaceSiddhiAppRuntime- Returns:
- Map of
StreamDefinitions.
-
getTableDefinitionMap
public Map<String,io.siddhi.query.api.definition.TableDefinition> getTableDefinitionMap()
Get the table definition map.- Specified by:
getTableDefinitionMapin interfaceSiddhiAppRuntime- Returns:
- Map of
TableDefinitions.
-
getWindowDefinitionMap
public Map<String,io.siddhi.query.api.definition.WindowDefinition> getWindowDefinitionMap()
Get the window definition map.- Specified by:
getWindowDefinitionMapin interfaceSiddhiAppRuntime- Returns:
- Map of
WindowDefinitions.
-
getAggregationDefinitionMap
public Map<String,io.siddhi.query.api.definition.AggregationDefinition> getAggregationDefinitionMap()
Get the aggregation definition map.- Specified by:
getAggregationDefinitionMapin interfaceSiddhiAppRuntime- Returns:
- Map of
AggregationDefinitions.
-
getQueryNames
public Set<String> getQueryNames()
Get the names of the available queries.- Specified by:
getQueryNamesin interfaceSiddhiAppRuntime- Returns:
- string set of query names.
-
getPartitionedInnerStreamDefinitionMap
public Map<String,Map<String,io.siddhi.query.api.definition.AbstractDefinition>> getPartitionedInnerStreamDefinitionMap()
- Specified by:
getPartitionedInnerStreamDefinitionMapin interfaceSiddhiAppRuntime
-
addCallback
public void addCallback(String streamId, StreamCallback streamCallback)
- Specified by:
addCallbackin interfaceSiddhiAppRuntime
-
addCallback
public void addCallback(String queryName, QueryCallback callback)
- Specified by:
addCallbackin interfaceSiddhiAppRuntime
-
removeCallback
public void removeCallback(StreamCallback streamCallback)
- Specified by:
removeCallbackin interfaceSiddhiAppRuntime
-
removeCallback
public void removeCallback(QueryCallback callback)
- Specified by:
removeCallbackin interfaceSiddhiAppRuntime
-
query
public Event[] query(String onDemandQuery)
- Specified by:
queryin interfaceSiddhiAppRuntime
-
query
public Event[] query(io.siddhi.query.api.execution.query.OnDemandQuery onDemandQuery)
- Specified by:
queryin interfaceSiddhiAppRuntime
-
query
@Deprecated public Event[] query(io.siddhi.query.api.execution.query.StoreQuery storeQuery)
Deprecated.- Specified by:
queryin interfaceSiddhiAppRuntime
-
getOnDemandQueryOutputAttributes
public io.siddhi.query.api.definition.Attribute[] getOnDemandQueryOutputAttributes(String onDemandQuery)
- Specified by:
getOnDemandQueryOutputAttributesin interfaceSiddhiAppRuntime
-
getOnDemandQueryOutputAttributes
public io.siddhi.query.api.definition.Attribute[] getOnDemandQueryOutputAttributes(io.siddhi.query.api.execution.query.OnDemandQuery onDemandQuery)
- Specified by:
getOnDemandQueryOutputAttributesin interfaceSiddhiAppRuntime
-
getStoreQueryOutputAttributes
@Deprecated public io.siddhi.query.api.definition.Attribute[] getStoreQueryOutputAttributes(String onDemandQuery)
Deprecated.- Specified by:
getStoreQueryOutputAttributesin interfaceSiddhiAppRuntime
-
getStoreQueryOutputAttributes
@Deprecated public io.siddhi.query.api.definition.Attribute[] getStoreQueryOutputAttributes(io.siddhi.query.api.execution.query.StoreQuery storeQuery)
Deprecated.- Specified by:
getStoreQueryOutputAttributesin interfaceSiddhiAppRuntime
-
getInputHandler
public InputHandler getInputHandler(String streamId)
- Specified by:
getInputHandlerin interfaceSiddhiAppRuntime
-
getTableInputHandler
public TableInputHandler getTableInputHandler(String tableId)
- Specified by:
getTableInputHandlerin interfaceSiddhiAppRuntime
-
getSources
public Collection<List<Source>> getSources()
- Specified by:
getSourcesin interfaceSiddhiAppRuntime
-
getSinks
public Collection<List<Sink>> getSinks()
- Specified by:
getSinksin interfaceSiddhiAppRuntime
-
getTables
public Collection<Table> getTables()
- Specified by:
getTablesin interfaceSiddhiAppRuntime
-
getWindows
public Collection<Window> getWindows()
- Specified by:
getWindowsin interfaceSiddhiAppRuntime
-
getTiggers
public Collection<Trigger> getTiggers()
- Specified by:
getTiggersin interfaceSiddhiAppRuntime
-
start
public void start()
- Specified by:
startin interfaceSiddhiAppRuntime
-
startWithoutSources
public void startWithoutSources()
- Specified by:
startWithoutSourcesin interfaceSiddhiAppRuntime
-
setPurgingEnabled
public void setPurgingEnabled(boolean purgingEnabled)
- Specified by:
setPurgingEnabledin interfaceSiddhiAppRuntime
-
startSources
public void startSources()
- Specified by:
startSourcesin interfaceSiddhiAppRuntime
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceSiddhiAppRuntime
-
debug
public SiddhiDebugger debug()
- Specified by:
debugin interfaceSiddhiAppRuntime
-
persist
public PersistenceReference persist()
- Specified by:
persistin interfaceSiddhiAppRuntime
-
snapshot
public byte[] snapshot()
- Specified by:
snapshotin interfaceSiddhiAppRuntime
-
restore
public void restore(byte[] snapshot) throws CannotRestoreSiddhiAppStateException- Specified by:
restorein interfaceSiddhiAppRuntime- Throws:
CannotRestoreSiddhiAppStateException
-
restoreRevision
public void restoreRevision(String revision) throws CannotRestoreSiddhiAppStateException
- Specified by:
restoreRevisionin interfaceSiddhiAppRuntime- Throws:
CannotRestoreSiddhiAppStateException
-
restoreLastRevision
public String restoreLastRevision() throws CannotRestoreSiddhiAppStateException
- Specified by:
restoreLastRevisionin interfaceSiddhiAppRuntime- Throws:
CannotRestoreSiddhiAppStateException
-
clearAllRevisions
public void clearAllRevisions() throws CannotClearSiddhiAppStateException- Specified by:
clearAllRevisionsin interfaceSiddhiAppRuntime- Throws:
CannotClearSiddhiAppStateException
-
handleExceptionWith
public void handleExceptionWith(com.lmax.disruptor.ExceptionHandler<Object> exceptionHandler)
- Specified by:
handleExceptionWithin interfaceSiddhiAppRuntime
-
handleRuntimeExceptionWith
public void handleRuntimeExceptionWith(ExceptionListener exceptionListener)
- Specified by:
handleRuntimeExceptionWithin interfaceSiddhiAppRuntime
-
getSiddhiApp
public io.siddhi.query.api.SiddhiApp getSiddhiApp()
- Specified by:
getSiddhiAppin interfaceSiddhiAppRuntime
-
getQueries
public Collection<QueryRuntime> getQueries()
- Specified by:
getQueriesin interfaceSiddhiAppRuntime
-
getPartitions
public Collection<PartitionRuntime> getPartitions()
- Specified by:
getPartitionsin interfaceSiddhiAppRuntime
-
getStatisticsLevel
public Level getStatisticsLevel()
Method to check the Siddhi App statistics level enabled.- Specified by:
getStatisticsLevelin interfaceSiddhiAppRuntime- Returns:
- Level value of Siddhi App statistics state
-
setStatisticsLevel
public void setStatisticsLevel(Level level)
To enable, disable and change Siddhi App statistics level on runtime.- Specified by:
setStatisticsLevelin interfaceSiddhiAppRuntime- Parameters:
level- whether statistics is OFF, BASIC or DETAIL
-
enablePlayBack
public void enablePlayBack(boolean playBackEnabled, Long idleTime, Long incrementInMilliseconds)To enable and disable Siddhi App playback mode on runtime along with optional parameters.- Specified by:
enablePlayBackin interfaceSiddhiAppRuntime- Parameters:
playBackEnabled- whether playback is enabled or notidleTime-incrementInMilliseconds-
-
getWarnings
public Set<String> getWarnings()
Description copied from interface:SiddhiAppRuntimeMethod to get Siddhi App runtime warnings.- Specified by:
getWarningsin interfaceSiddhiAppRuntime- Returns:
- list of recorded runtime warnings.
-
-