shahrs87 commented on a change in pull request #978:
URL: https://github.com/apache/phoenix/pull/978#discussion_r537120770



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
##########
@@ -991,6 +1000,49 @@ public void 
preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnviro
         }
     }
 
+    /**
+     * Set Cell Tags to delete markers with source of operation attribute.
+     * @param miniBatchOp
+     * @throws IOException
+     */
+    private void setDeleteAttributes(MiniBatchOperationInProgress<Mutation> 
miniBatchOp)
+            throws IOException {
+        for (int i = 0; i < miniBatchOp.size(); i++) {
+            Mutation m = miniBatchOp.getOperation(i);
+            if (!(m instanceof  Delete)) {
+                // Ignore if it is not Delete type.
+                continue;
+            }
+            byte[] sourceOpAttr = 
m.getAttribute(QueryServices.SOURCE_OPERATION_ATTRIB);
+            if (sourceOpAttr == null) {
+                continue;
+            }
+
+            Tag sourceOpTag = new 
ArrayBackedTag(PhoenixTagType.SOURCE_OPERATION_TAG_TYPE,
+                    sourceOpAttr);
+            List<Cell> updatedCells = new ArrayList<>();
+            for (CellScanner cellScanner = m.cellScanner(); 
cellScanner.advance();) {
+                Cell cell = cellScanner.current();
+                RawCell rawCell = (RawCell)cell;
+                List<Tag> tags = new ArrayList<>();
+                Iterator<Tag> tagsIterator = rawCell.getTags();
+                while (tagsIterator.hasNext()) {
+                    tags.add(tagsIterator.next());
+                }
+                tags.add(sourceOpTag);
+                // TODO: PrivateCellUtil's IA is Private. Need to change it to 
LP with IA.COPROC.

Review comment:
       Done in latest revision.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to