[ 
https://issues.apache.org/jira/browse/NIFI-4637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453605#comment-16453605
 ] 

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_r184268871
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java
 ---
    @@ -336,51 +348,86 @@ public void shutdown() {
             }
         }
     
    +    private static final byte[] EMPTY_VIS_STRING;
    +
    +    static {
    +        try {
    +            EMPTY_VIS_STRING = "".getBytes("UTF-8");
    +        } catch (UnsupportedEncodingException e) {
    +            throw new RuntimeException(e);
    +        }
    +    }
    +
    +    private List<Put> buildPuts(byte[] rowKey, List<PutColumn> columns) {
    +        List<Put> retVal = new ArrayList<>();
    +
    +        try {
    +            Put put = null;
    +
    +            for (final PutColumn column : columns) {
    +                if (put == null || (put.getCellVisibility() == null && 
column.getVisibility() != null) || ( put.getCellVisibility() != null
    +                        && 
!put.getCellVisibility().getExpression().equals(column.getVisibility())
    +                    )) {
    +                    put = new Put(rowKey);
    +
    +                    if (column.getVisibility() != null) {
    +                        put.setCellVisibility(new 
CellVisibility(column.getVisibility()));
    +                    }
    +                    retVal.add(put);
    +                }
    +
    +                if (column.getTimestamp() != null) {
    +                    put.addColumn(
    +                            column.getColumnFamily(),
    +                            column.getColumnQualifier(),
    +                            column.getTimestamp(),
    +                            column.getBuffer());
    +                } else {
    +                    put.addColumn(
    +                            column.getColumnFamily(),
    +                            column.getColumnQualifier(),
    +                            column.getBuffer());
    +                }
    +            }
    +        } catch (DeserializationException de) {
    +            getLogger().error("Error writing cell visibility statement.", 
de);
    +            throw new RuntimeException(de);
    +        }
    +
    +        return retVal;
    +    }
    +
         @Override
         public void put(final String tableName, final Collection<PutFlowFile> 
puts) throws IOException {
             try (final Table table = 
connection.getTable(TableName.valueOf(tableName))) {
                 // Create one Put per row....
                 final Map<String, Put> rowPuts = new HashMap<>();
    --- End diff --
    
    This `rowPuts` 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)

Reply via email to