Github user zezutom commented on a diff in the pull request:
https://github.com/apache/metron/pull/732#discussion_r137960020
--- Diff:
metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/writer/SimpleHbaseEnrichmentWriter.java
---
@@ -134,6 +136,39 @@ public void configure(String sensorName,
WriterConfiguration configuration) {
LOG.debug("Sensor: '{}': {Provider: '{}', Converter: '{}'}",
sensorName, getClassName(provider), getClassName(converter));
}
+
+ private void validateEnrichmentType(String sensorName,
WriterConfiguration configuration) {
+ Map<String, Object> sensorConfig =
configuration.getSensorConfig(sensorName);
+ Object enrichmentTypeObj =
Configurations.ENRICHMENT_TYPE.get(sensorConfig);
+ if (enrichmentTypeObj == null) {
+ throw new IllegalArgumentException(String.format("%s must be
provided", Configurations.ENRICHMENT_TYPE.getKey()));
+ }
+
+ if (!(enrichmentTypeObj instanceof String)) {
+ throw new IllegalArgumentException(String.format("%s must be a
string", Configurations.ENRICHMENT_TYPE.getKey()));
+ }
+
+ String enrichmentType = enrichmentTypeObj.toString();
+ if (enrichmentType.trim().isEmpty()) {
+ throw new IllegalArgumentException(String.format("%s must not be an
empty string",
+ Configurations.ENRICHMENT_TYPE.getKey()));
+ }
+ }
+
+ private void validateKeyColumns(String sensorName, WriterConfiguration
configuration) {
+ Map<String, Object> sensorConfig =
configuration.getSensorConfig(sensorName);
+ Object keyColumnsObj = Configurations.KEY_COLUMNS.get(sensorConfig);
+
+ try {
+ List<String> keyColumns = getColumns(keyColumnsObj, true);
+ if (keyColumns == null || keyColumns.isEmpty()) {
+ throw new IllegalArgumentException(String.format("%s must be
provided", Configurations.KEY_COLUMNS.getKey()));
+ }
+ } catch (RuntimeException ex) {
+ throw new IllegalArgumentException(ex.getMessage());
--- End diff --
Hi @cestella , thanks for the review. The second arg is now added, and yes
I did check hbase streaming worked in the full-dev cluster.
---