From 827759a7fc32bb421e8e0011a2815201f60e1086 Mon Sep 17 00:00:00 2001 From: Ed Date: Fri, 9 Mar 2018 12:06:34 -0500 Subject: [PATCH 1/2] FetchHBaseRow - log level and displayName update log level for "not found" to DEBUG instead of ERROR, and added displayName to all property descriptors --- .../org/apache/nifi/hbase/FetchHBaseRow.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java index 8d06da9b3703..05afd0eea4f0 100644 --- a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java +++ b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java @@ -67,14 +67,16 @@ public class FetchHBaseRow extends AbstractProcessor { static final Pattern COLUMNS_PATTERN = Pattern.compile("\\w+(:\\w+)?(?:,\\w+(:\\w+)?)*"); static final PropertyDescriptor HBASE_CLIENT_SERVICE = new PropertyDescriptor.Builder() - .name("HBase Client Service") + .displayName("HBase Client Service") + .name("fetchhbaserow-client-service") .description("Specifies the Controller Service to use for accessing HBase.") .required(true) .identifiesControllerService(HBaseClientService.class) .build(); static final PropertyDescriptor TABLE_NAME = new PropertyDescriptor.Builder() - .name("Table Name") + .displayName("Table Name") + .name("fetchhbaserow-table-name") .description("The name of the HBase Table to fetch from.") .required(true) .expressionLanguageSupported(true) @@ -82,7 +84,8 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor ROW_ID = new PropertyDescriptor.Builder() - .name("Row Identifier") + .displayName("Row Identifier") + .name("fetchhbaserow-row-identifier") .description("The identifier of the row to fetch.") .required(true) .expressionLanguageSupported(true) @@ -90,7 +93,8 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor COLUMNS = new PropertyDescriptor.Builder() - .name("Columns") + .displayName("Columns") + .name("fetchhbaserow-columns") .description("An optional comma-separated list of \":\" pairs to fetch. To return all columns " + "for a given family, leave off the qualifier such as \",\".") .required(false) @@ -108,7 +112,8 @@ public class FetchHBaseRow extends AbstractProcessor { "The format of the JSON document is determined by the JSON Format property."); static final PropertyDescriptor DESTINATION = new PropertyDescriptor.Builder() - .name("Destination") + .displayName("Destination") + .name("fetchhbaserow-destination") .description("Indicates whether the row fetched from HBase is written to FlowFile content or FlowFile Attributes.") .required(true) .allowableValues(DESTINATION_ATTRIBUTES, DESTINATION_CONTENT) @@ -121,7 +126,8 @@ public class FetchHBaseRow extends AbstractProcessor { "Creates a JSON document with the format: {\"\":\"\", \"\":\"\"."); static final PropertyDescriptor JSON_FORMAT = new PropertyDescriptor.Builder() - .name("JSON Format") + .displayName("JSON Format") + .name("fetchhbaserow-json-format") .description("Specifies how to represent the HBase row as a JSON document.") .required(true) .allowableValues(JSON_FORMAT_FULL_ROW, JSON_FORMAT_QUALIFIER_AND_VALUE) @@ -132,7 +138,8 @@ public class FetchHBaseRow extends AbstractProcessor { static final AllowableValue ENCODING_BASE64 = new AllowableValue("base64", "base64", "Creates a Base64 encoded String of the given data."); static final PropertyDescriptor JSON_VALUE_ENCODING = new PropertyDescriptor.Builder() - .name("JSON Value Encoding") + .displayName("JSON Value Encoding") + .name("fetchhbaserow-json-value-encoding") .description("Specifies how to represent row ids, column families, column qualifiers, and values when stored in FlowFile attributes, or written to JSON.") .required(true) .allowableValues(ENCODING_NONE, ENCODING_BASE64) @@ -140,7 +147,8 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor DECODE_CHARSET = new PropertyDescriptor.Builder() - .name("Decode Character Set") + .displayName("Decode Character Set") + .name("fetchhbaserow-decode-character-set") .description("The character set used to decode data from HBase.") .required(true) .defaultValue("UTF-8") @@ -148,7 +156,8 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor ENCODE_CHARSET = new PropertyDescriptor.Builder() - .name("Encode Character Set") + .displayName("Encode Character Set") + .name("fetchhbaserow-encode-character-set") .description("The character set used to encode the JSON representation of the row.") .required(true) .defaultValue("UTF-8") @@ -268,7 +277,7 @@ public void onTrigger(ProcessContext context, ProcessSession session) throws Pro FlowFile handlerFlowFile = handler.getFlowFile(); if (!handler.handledRow()) { - getLogger().error("Row {} not found in {}, transferring to not found", new Object[] {rowId, tableName}); + getLogger().debug("Row {} not found in {}, transferring to not found", new Object[] {rowId, tableName}); session.transfer(handlerFlowFile, REL_NOT_FOUND); return; } From 0c2428dc70d5722214fd58d858398b52da91f7f9 Mon Sep 17 00:00:00 2001 From: Ed Date: Fri, 9 Mar 2018 13:17:18 -0500 Subject: [PATCH 2/2] dropping display names to avoid regression issues --- .../org/apache/nifi/hbase/FetchHBaseRow.java | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java index 05afd0eea4f0..654f7af6c9bf 100644 --- a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java +++ b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/FetchHBaseRow.java @@ -67,16 +67,14 @@ public class FetchHBaseRow extends AbstractProcessor { static final Pattern COLUMNS_PATTERN = Pattern.compile("\\w+(:\\w+)?(?:,\\w+(:\\w+)?)*"); static final PropertyDescriptor HBASE_CLIENT_SERVICE = new PropertyDescriptor.Builder() - .displayName("HBase Client Service") - .name("fetchhbaserow-client-service") + .name("HBase Client Service") .description("Specifies the Controller Service to use for accessing HBase.") .required(true) .identifiesControllerService(HBaseClientService.class) .build(); static final PropertyDescriptor TABLE_NAME = new PropertyDescriptor.Builder() - .displayName("Table Name") - .name("fetchhbaserow-table-name") + .name("Table Name") .description("The name of the HBase Table to fetch from.") .required(true) .expressionLanguageSupported(true) @@ -84,8 +82,7 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor ROW_ID = new PropertyDescriptor.Builder() - .displayName("Row Identifier") - .name("fetchhbaserow-row-identifier") + .name("Row Identifier") .description("The identifier of the row to fetch.") .required(true) .expressionLanguageSupported(true) @@ -93,8 +90,7 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor COLUMNS = new PropertyDescriptor.Builder() - .displayName("Columns") - .name("fetchhbaserow-columns") + .name("Columns") .description("An optional comma-separated list of \":\" pairs to fetch. To return all columns " + "for a given family, leave off the qualifier such as \",\".") .required(false) @@ -112,8 +108,7 @@ public class FetchHBaseRow extends AbstractProcessor { "The format of the JSON document is determined by the JSON Format property."); static final PropertyDescriptor DESTINATION = new PropertyDescriptor.Builder() - .displayName("Destination") - .name("fetchhbaserow-destination") + .name("Destination") .description("Indicates whether the row fetched from HBase is written to FlowFile content or FlowFile Attributes.") .required(true) .allowableValues(DESTINATION_ATTRIBUTES, DESTINATION_CONTENT) @@ -126,8 +121,7 @@ public class FetchHBaseRow extends AbstractProcessor { "Creates a JSON document with the format: {\"\":\"\", \"\":\"\"."); static final PropertyDescriptor JSON_FORMAT = new PropertyDescriptor.Builder() - .displayName("JSON Format") - .name("fetchhbaserow-json-format") + .name("JSON Format") .description("Specifies how to represent the HBase row as a JSON document.") .required(true) .allowableValues(JSON_FORMAT_FULL_ROW, JSON_FORMAT_QUALIFIER_AND_VALUE) @@ -138,8 +132,7 @@ public class FetchHBaseRow extends AbstractProcessor { static final AllowableValue ENCODING_BASE64 = new AllowableValue("base64", "base64", "Creates a Base64 encoded String of the given data."); static final PropertyDescriptor JSON_VALUE_ENCODING = new PropertyDescriptor.Builder() - .displayName("JSON Value Encoding") - .name("fetchhbaserow-json-value-encoding") + .name("JSON Value Encoding") .description("Specifies how to represent row ids, column families, column qualifiers, and values when stored in FlowFile attributes, or written to JSON.") .required(true) .allowableValues(ENCODING_NONE, ENCODING_BASE64) @@ -147,8 +140,7 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor DECODE_CHARSET = new PropertyDescriptor.Builder() - .displayName("Decode Character Set") - .name("fetchhbaserow-decode-character-set") + .name("Decode Character Set") .description("The character set used to decode data from HBase.") .required(true) .defaultValue("UTF-8") @@ -156,8 +148,7 @@ public class FetchHBaseRow extends AbstractProcessor { .build(); static final PropertyDescriptor ENCODE_CHARSET = new PropertyDescriptor.Builder() - .displayName("Encode Character Set") - .name("fetchhbaserow-encode-character-set") + .name("Encode Character Set") .description("The character set used to encode the JSON representation of the row.") .required(true) .defaultValue("UTF-8")