ElasticsearchConfig extends MapConfig { public String getClientFactoryClassName() { if (containsKey(CONFIG_KEY_CLIENT_FACTORY)) { return get(CONFIG_KEY_CLIENT_FACTORY); } else { throw new SamzaException("You must specify a client factory class" + " for the Elasticsearch system."); } } ElasticsearchConfig(String name, Config config); String getClientFactoryClassName(); Config getElasticseachSettings(); Optional<String> getIndexRequestFactoryClassName(); Optional<String> getTransportHost(); Optional<Integer> getTransportPort(); Optional<Integer> getBulkFlushMaxActions(); Optional<Integer> getBulkFlushMaxSizeMB(); Optional<Integer> getBulkFlushIntervalMS(); static final String CONFIG_KEY_CLIENT_FACTORY; static final String PREFIX_ELASTICSEARCH_SETTINGS; static final String CONFIG_KEY_INDEX_REQUEST_FACTORY; static final String CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS; static final String CONFIG_KEY_BULK_FLUSH_MAX_SIZE_MB; static final String CONFIG_KEY_BULK_FLUSH_INTERVALS_MS; static final String CONFIG_KEY_CLIENT_TRANSPORT_HOST; static final String CONFIG_KEY_CLIENT_TRANSPORT_PORT; }
@Test public void testGetClientFactoryClassName() throws Exception { ElasticsearchConfig config = configForProperty("systems.es.client.factory", "bar"); assertEquals("bar", config.getClientFactoryClassName()); }