Search in sources :

Example 1 with EventHubSpout

use of org.apache.storm.eventhubs.spout.EventHubSpout in project storm by apache.

the class EventCount method runScenario.

protected void runScenario(String[] args) throws Exception {
    readEHConfig(args);
    EventHubSpout eventHubSpout = createEventHubSpout();
    StormTopology topology = buildTopology(eventHubSpout);
    submitTopology(args, topology);
}
Also used : StormTopology(org.apache.storm.generated.StormTopology) EventHubSpout(org.apache.storm.eventhubs.spout.EventHubSpout)

Example 2 with EventHubSpout

use of org.apache.storm.eventhubs.spout.EventHubSpout in project storm by apache.

the class AtMostOnceEventCount method createEventHubSpout.

@Override
protected EventHubSpout createEventHubSpout() {
    IPartitionManagerFactory pmFactory = new IPartitionManagerFactory() {

        private static final long serialVersionUID = 1L;

        @Override
        public IPartitionManager create(EventHubSpoutConfig spoutConfig, String partitionId, IStateStore stateStore, IEventHubReceiver receiver) {
            return new SimplePartitionManager(spoutConfig, partitionId, stateStore, receiver);
        }
    };
    EventHubSpout eventHubSpout = new EventHubSpout(spoutConfig, null, pmFactory, null);
    return eventHubSpout;
}
Also used : IPartitionManagerFactory(org.apache.storm.eventhubs.spout.IPartitionManagerFactory) IStateStore(org.apache.storm.eventhubs.spout.IStateStore) SimplePartitionManager(org.apache.storm.eventhubs.spout.SimplePartitionManager) EventHubSpoutConfig(org.apache.storm.eventhubs.spout.EventHubSpoutConfig) EventHubSpout(org.apache.storm.eventhubs.spout.EventHubSpout) IEventHubReceiver(org.apache.storm.eventhubs.spout.IEventHubReceiver)

Aggregations

EventHubSpout (org.apache.storm.eventhubs.spout.EventHubSpout)2 EventHubSpoutConfig (org.apache.storm.eventhubs.spout.EventHubSpoutConfig)1 IEventHubReceiver (org.apache.storm.eventhubs.spout.IEventHubReceiver)1 IPartitionManagerFactory (org.apache.storm.eventhubs.spout.IPartitionManagerFactory)1 IStateStore (org.apache.storm.eventhubs.spout.IStateStore)1 SimplePartitionManager (org.apache.storm.eventhubs.spout.SimplePartitionManager)1 StormTopology (org.apache.storm.generated.StormTopology)1