/** * Create a DRPCPubSub using a {@link BulletConfig}. * * @param config The BulletConfig containing settings to create a new DRPCPubSub. * @throws PubSubException if there were errors in creating an instance. */ public DRPCPubSub(BulletConfig config) throws PubSubException { super(config); this.config = new DRPCConfig(config); maxUncommittedMessages = getRequiredConfig(Number.class, DRPCConfig.DRPC_MAX_UNCOMMITED_MESSAGES).intValue(); }
/** * Create a DRPCPubSub using a {@link BulletConfig}. * * @param config The BulletConfig containing settings to create a new DRPCPubSub. * @throws PubSubException if there were errors in creating an instance. */ public DRPCPubSub(BulletConfig config) throws PubSubException { super(config); this.config = new DRPCConfig(config); maxUncommittedMessages = getRequiredConfig(Number.class, DRPCConfig.DRPC_MAX_UNCOMMITED_MESSAGES).intValue(); }
@Test(expectedExceptions = IllegalStateException.class) public void testWindowingMustBeDisabled() { new DRPCConfig((String) null); }
@BeforeMethod public void setup() { config = new DRPCConfig("src/test/resources/test_drpc_config.yaml"); config.set(DRPCConfig.DRPC_SERVERS, Collections.singletonList("foo.bar.bullet.drpc.com")); pubscriber = new DRPCQueryResultPubscriber(config); }
@Test public void testCustomConfig() { DRPCConfig config = new DRPCConfig("src/test/resources/test_drpc_config.yaml"); Assert.assertEquals(config.get("fake.setting"), "foo"); Assert.assertEquals(config.get(DRPCConfig.DRPC_HTTP_CONNECT_RETRY_LIMIT), 1); // Defaulted Assert.assertEquals(config.get(BulletStormConfig.TOPOLOGY_METRICS_ENABLE), false); Assert.assertEquals(config.get(BulletStormConfig.AGGREGATION_MAX_SIZE), BulletConfig.DEFAULT_AGGREGATION_MAX_SIZE); Assert.assertEquals(config.get(BulletStormConfig.QUERY_SPOUT_CPU_LOAD), BulletStormConfig.DEFAULT_QUERY_SPOUT_CPU_LOAD); }
private static DRPCConfig makeEmpty() { BulletStormConfig config = new BulletStormConfig(); config.set(BulletStormConfig.WINDOW_DISABLE, true); return new DRPCConfig(config); }
@BeforeMethod public void setup() throws Exception { config = new DRPCConfig("src/test/resources/test_drpc_config.yaml"); // 1 task for the component named "foo" with task index 0 CustomTopologyContext context = new CustomTopologyContext(Collections.singletonList(1), "foo", 0); config.set(DRPCConfig.STORM_CONTEXT, context); Map stormConfig = new Config("src/test/resources/test_storm_config.yaml").getAll(Optional.empty()); config.set(DRPCConfig.STORM_CONFIG, stormConfig); }
@BeforeMethod public void setup() { DRPCConfig config = new DRPCConfig("src/test/resources/test_drpc_config.yaml"); Map stormConfig = new Config("src/test/resources/test_storm_config.yaml").getAll(Optional.empty()); config.set(DRPCConfig.STORM_CONFIG, stormConfig); publisher = new DRPCResultPublisher(config); collector = publisher.getCollector(); // Override the ReturnResults with our own that uses our collector and fails every two tuples injectedMockBolt = new MockReturnResults(collector, 5); publisher.setBolt(injectedMockBolt); }
@BeforeMethod public void setup() { DRPCConfig config = new DRPCConfig("src/test/resources/test_drpc_config.yaml"); // 1 task for the component named "foo" with task index 0 CustomTopologyContext context = new CustomTopologyContext(Collections.singletonList(1), "foo", 0); config.set(DRPCConfig.STORM_CONTEXT, context); Map stormConfig = new Config("src/test/resources/test_storm_config.yaml").getAll(Optional.empty()); config.set(DRPCConfig.STORM_CONFIG, stormConfig); subscriber = new DRPCQuerySubscriber(config, 5); DRPCOutputCollector collector = subscriber.getCollector(); // Override the DRPCSpout with our own that emits using our collector. injectedMockSpout = new MockDRPCSpout("foo", collector); subscriber.setSpout(injectedMockSpout); }