Github user mmiklavc commented on a diff in the pull request:
https://github.com/apache/metron/pull/946#discussion_r178584790
--- Diff:
metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/utils/ElasticsearchUtils.java
---
@@ -107,32 +113,94 @@ public static String getBaseIndexName(String
indexName) {
return parts[0];
}
- public static TransportClient getClient(Map<String, Object>
globalConfiguration, Map<String, String> optionalSettings) {
+ /**
+ * Instantiates an Elasticsearch client based on es.client.class, if
set. Defaults to
+ * org.elasticsearch.transport.client.PreBuiltTransportClient.
+ *
+ * @param globalConfiguration Metron global config
+ * @return
+ */
+ public static TransportClient getClient(Map<String, Object>
globalConfiguration) {
+ Set<String> customESSettings = new HashSet<>();
+ customESSettings.addAll(Arrays.asList("es.client.class",
"es.xpack.username", "es.xpack.password.file"));
--- End diff --
These are non-es-specific settings that we're pulling via the global config
key that are leveraged for constructing the client. The client blows up on any
unexpected keys in its config. We should probably make a note.
---