Class AbstractSiddhiAppCreator
- java.lang.Object
-
- org.wso2.siddhi.parser.core.appcreator.AbstractSiddhiAppCreator
-
- All Implemented Interfaces:
SiddhiAppCreator
- Direct Known Subclasses:
NatsSiddhiAppCreator
public abstract class AbstractSiddhiAppCreator extends Object implements SiddhiAppCreator
Abstract implementation ofSiddhiAppCreator. Developers can use this extension point to implement custom Siddhi App Creator based on the distribute implementation.
-
-
Constructor Summary
Constructors Constructor Description AbstractSiddhiAppCreator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract List<SiddhiQuery>createApps(String siddhiAppName, SiddhiQueryGroup queryGroup, MessagingSystem messagingSystem)This method should return valid concrete Siddhi App/s as Strings.List<DeployableSiddhiQueryGroup>createApps(SiddhiTopology topology, MessagingSystem messagingSystem)Create valid concrete Siddhi Apps for each Query Group in the givenSiddhiTopology.protected List<SiddhiQuery>generateQueryList(String queryTemplate, String queryGroupName, int parallelism)protected List<Integer>getPartitionNumbers(int appParallelism, int availablePartitionCount, int currentAppNum)protected StringgetTopicName(String siddhiAppName, String streamName, String groupingField)protected StringgetUpdatedQuery(String query, Map<String,String> valuesMap)protected voidupdateQueryList(List<SiddhiQuery> queryList, Map<String,String> valuesMap)
-
-
-
Method Detail
-
createApps
public List<DeployableSiddhiQueryGroup> createApps(SiddhiTopology topology, MessagingSystem messagingSystem)
Description copied from interface:SiddhiAppCreatorCreate valid concrete Siddhi Apps for each Query Group in the givenSiddhiTopology.- Specified by:
createAppsin interfaceSiddhiAppCreator- Parameters:
topology- Input topology to create Siddhi Apps- Returns:
- List of
DeployableSiddhiQueryGroups. Length of the list should be equal to no. of groups user has defined. Length of the list should be greater than zero always.
-
createApps
protected abstract List<SiddhiQuery> createApps(String siddhiAppName, SiddhiQueryGroup queryGroup, MessagingSystem messagingSystem)
This method should return valid concrete Siddhi App/s as Strings. No. of returned Siddhi Apps should equal the parallelism count for parse group.- Parameters:
queryGroup- Input parse group to produce Siddhi Apps.- Returns:
- List of valid concrete Siddhi Apps as String.
-
getPartitionNumbers
protected List<Integer> getPartitionNumbers(int appParallelism, int availablePartitionCount, int currentAppNum)
-
generateQueryList
protected List<SiddhiQuery> generateQueryList(String queryTemplate, String queryGroupName, int parallelism)
-
updateQueryList
protected void updateQueryList(List<SiddhiQuery> queryList, Map<String,String> valuesMap)
-
getTopicName
protected String getTopicName(String siddhiAppName, String streamName, String groupingField)
- Parameters:
siddhiAppName- Name of the userdefined siddhi appstreamName- Currently processing stream namegroupingField- Partition key field, if available otherwise null- Returns:
- created topic name Creates the topic name from above parameters
-
-