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

ASF GitHub Bot commented on NIFI-4637:
--------------------------------------

Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2518#discussion_r172976240
  
    --- 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
 ---
    @@ -349,18 +399,54 @@ public boolean checkAndPut(final String tableName, 
final byte[] rowId, final byt
     
         @Override
         public void delete(final String tableName, final byte[] rowId) throws 
IOException {
    +        delete(tableName, rowId, null);
    +    }
    +
    +    @Override
    +    public void delete(String tableName, byte[] rowId, String 
visibilityLabel) throws IOException {
             try (final Table table = 
connection.getTable(TableName.valueOf(tableName))) {
                 Delete delete = new Delete(rowId);
    +            if (visibilityLabel != null && 
!visibilityLabel.trim().equals("")) {
    +                delete.setCellVisibility(new 
CellVisibility(visibilityLabel));
    +            }
                 table.delete(delete);
             }
         }
     
         @Override
         public void delete(String tableName, List<byte[]> rowIds) throws 
IOException {
    +        delete(tableName, rowIds);
    +    }
    +
    +    @Override
    +    public void deleteCells(String tableName, List<DeleteRequest> deletes) 
throws IOException {
    +        List<Delete> deleteRequests = new ArrayList<>();
    +        for (int index = 0; index < deletes.size(); index++) {
    +            DeleteRequest req = deletes.get(index);
    +            Delete delete = new Delete(req.getRowId())
    +                .addColumn(req.getColumnFamily(), 
req.getColumnQualifier());
    +            if (req.getVisibilityLabel() != null && 
!req.getVisibilityLabel().trim().equals("")) {
    +                delete.setCellVisibility(new 
CellVisibility(req.getVisibilityLabel()));
    +            }
    +            deleteRequests.add(delete);
    +        }
    +        batchDelete(tableName, deleteRequests);
    +    }
    +
    +    @Override
    +    public void delete(String tableName, List<byte[]> rowIds, String 
visibilityLabel) throws IOException {
             List<Delete> deletes = new ArrayList<>();
             for (int index = 0; index < rowIds.size(); index++) {
    -            deletes.add(new Delete(rowIds.get(index)));
    +            Delete delete = new Delete(rowIds.get(index));
    +            if (visibilityLabel != null && 
!visibilityLabel.trim().equals("")) {
    --- End diff --
    
    same here


> 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