Class BroadcastDistributionStrategy


  • public class BroadcastDistributionStrategy
    extends DistributionStrategy
    Publishing strategy to broad cast message to all destinations
    • Constructor Detail

      • BroadcastDistributionStrategy

        public BroadcastDistributionStrategy()
    • Method Detail

      • init

        public void init​(io.siddhi.query.api.definition.StreamDefinition streamDefinition,
                         OptionHolder transportOptionHolder,
                         OptionHolder distributionOptionHolder,
                         List<OptionHolder> destinationOptionHolders,
                         ConfigReader configReader)
        Initialize the Distribution strategy with the information it will require to make decisions.
        Specified by:
        init in class DistributionStrategy
        Parameters:
        streamDefinition - The stream attached to the sink this DistributionStrategy is used in
        transportOptionHolder - Sink options of the sink which uses this DistributionStrategy
        distributionOptionHolder - Option holder containing static and dynamic options related to the distribution strategy.
        destinationOptionHolders - The list of options under @destination of the relevant sink.
        configReader - Hold the BroadcastDistributionStrategy extensions configuration reader.
      • getDestinationsToPublish

        public List<Integer> getDestinationsToPublish​(Object payload,
                                                      DynamicOptions transportOptions)
        This method tells the ID(s) of the destination(s) to which a given messages should be sent. There can be cases where a given message is only sent to a specific destination(e.g., partition based) and message is sent to multiple endpoints(e.g., broadcast)
        Specified by:
        getDestinationsToPublish in class DistributionStrategy
        Parameters:
        payload - payload of the message
        transportOptions - Dynamic transport options of the sink
        Returns:
        Set of IDs of the destination to which the event should be sent