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


---

Reply via email to