[ https://issues.apache.org/jira/browse/NIFI-4637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453621#comment-16453621 ]
ASF GitHub Bot commented on NIFI-4637: -------------------------------------- Github user ijokarumawak commented on a diff in the pull request: https://github.com/apache/nifi/pull/2518#discussion_r184288776 --- Diff: nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/src/main/java/org/apache/nifi/hbase/AbstractPutHBase.java --- @@ -131,6 +133,59 @@ public void onScheduled(final ProcessContext context) { clientService = context.getProperty(HBASE_CLIENT_SERVICE).asControllerService(HBaseClientService.class); } + @Override + protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) { + if (propertyDescriptorName.startsWith("visibility.")) { + String[] parts = propertyDescriptorName.split("\\."); + String displayName; + String description; + + if (parts.length == 2) { + displayName = String.format("Column Family %s Default Visibility", parts[1]); + description = String.format("Default visibility setting for %s", parts[1]); + } else if (parts.length == 3) { + displayName = String.format("Column Qualifier %s.%s Default Visibility", parts[1], parts[2]); + description = String.format("Default visibility setting for %s.%s", parts[1], parts[2]); + } else { + return null; + } + + return new PropertyDescriptor.Builder() + .name(propertyDescriptorName) + .displayName(displayName) + .description(description) + .addValidator(StandardValidators.NON_BLANK_VALIDATOR) + .dynamic(true) + .build(); + } + + return null; + } + + protected String pickVisibilityString(String columnFamily, String columnQualifier, FlowFile flowFile, ProcessContext context) { + final String lookupKey = String.format("visibility.%s.%s", columnFamily, columnQualifier); + final String fromAttribute = flowFile.getAttribute(lookupKey); + if (fromAttribute != null) { + return fromAttribute; + } else { + PropertyValue descriptor = context.getProperty(lookupKey); + if (descriptor == null) { + descriptor = context.getProperty(String.format("visibility.%s", columnFamily)); + } + + String retVal = descriptor != null ? descriptor.getValue() : null; + + return retVal; + } + } + + protected String pickVisibilityString(String defaultVisibilityString, String columnFamily, String columnQualifier, FlowFile flowFile) { --- End diff -- This method is not used any longer. Please remove it. > Add support for HBase visibility labels to HBase processors and controller > services > ----------------------------------------------------------------------------------- > > Key: NIFI-4637 > URL: https://issues.apache.org/jira/browse/NIFI-4637 > Project: Apache NiFi > Issue Type: Improvement > Reporter: Mike Thomsen > Assignee: Mike Thomsen > Priority: Major > > HBase supports visibility labels, but you can't use them from NiFi because > there is no way to set them. The existing processors and services should be > upgraded to handle this capability. -- This message was sent by Atlassian JIRA (v7.6.3#76005)