ParserWriterConfiguration implements WriterConfiguration { @Override public int getBatchSize(String sensorName) { if(config != null && config.getSensorParserConfig(sensorName) != null && config.getSensorParserConfig(sensorName).getParserConfig() != null ) { Object batchObj = config.getSensorParserConfig(sensorName).getParserConfig().get(IndexingConfigurations.BATCH_SIZE_CONF); return batchObj == null ? ParserConfigurations.DEFAULT_KAFKA_BATCH_SIZE : ConversionUtils.convert(batchObj, Integer.class); } return 1; } ParserWriterConfiguration(ParserConfigurations config); @Override int getBatchSize(String sensorName); @Override int getBatchTimeout(String sensorName); @Override List<Integer> getAllConfiguredTimeouts(); @Override String getIndex(String sensorName); @Override boolean isEnabled(String sensorName); @Override Map<String, Object> getSensorConfig(String sensorName); @Override Map<String, Object> getGlobalConfig(); @Override boolean isDefault(String sensorName); @Override String getFieldNameConverter(String sensorName);  }
@Test public void testDefaultBatchSize() { ParserWriterConfiguration config = new ParserWriterConfiguration( new ParserConfigurations() ); assertEquals(1, config.getBatchSize("foo")); }