/** * Creates and initializes a Publisher that writes to the DRPC servers. Intended to be used inside a Storm * bolt in a Storm topology. * * @param config Needs the Storm configuration {@link Map} in {@link com.yahoo.bullet.storm.BulletStormConfig#STORM_CONFIG}. */ public DRPCResultPublisher(BulletConfig config) { // Get the Storm Config that has all the relevant cluster settings and properties Map stormConfig = config.getRequiredConfigAs(DRPCConfig.STORM_CONFIG, Map.class); collector = new DRPCOutputCollector(); // Wrap the collector in a OutputCollector (it just delegates to the underlying DRPCOutputCollector) OutputCollector boltOutputCollector = new OutputCollector(collector); bolt = new ReturnResults(); // No need for a TopologyContext bolt.prepare(stormConfig, null, boltOutputCollector); }
/** * Creates and initializes a Publisher that writes to the DRPC servers. Intended to be used inside a Storm * bolt in a Storm topology. * * @param config Needs the Storm configuration {@link Map} in {@link com.yahoo.bullet.storm.BulletStormConfig#STORM_CONFIG}. */ public DRPCResultPublisher(BulletConfig config) { // Get the Storm Config that has all the relevant cluster settings and properties Map stormConfig = config.getRequiredConfigAs(DRPCConfig.STORM_CONFIG, Map.class); collector = new DRPCOutputCollector(); // Wrap the collector in a OutputCollector (it just delegates to the underlying DRPCOutputCollector) OutputCollector boltOutputCollector = new OutputCollector(collector); bolt = new ReturnResults(); // No need for a TopologyContext bolt.prepare(stormConfig, null, boltOutputCollector); }