use of org.apache.storm.eventhubs.spout.IEventHubReceiver 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;
}
use of org.apache.storm.eventhubs.spout.IEventHubReceiver in project storm by apache.
the class TransactionalTridentEventHubEmitter method getOrCreatePartitionManager.
/**
* Check if partition manager for a given partiton is created
* if not, create it.
* @param partition
*/
private ITridentPartitionManager getOrCreatePartitionManager(Partition partition) {
ITridentPartitionManager pm;
if (!pmMap.containsKey(partition.getId())) {
IEventHubReceiver receiver = recvFactory.create(spoutConfig, partition.getId());
pm = pmFactory.create(receiver);
pmMap.put(partition.getId(), pm);
} else {
pm = pmMap.get(partition.getId());
}
return pm;
}
Aggregations