kadirozde commented on a change in pull request #740: PHOENIX-5795 Supporting 
selective queries for index rows updated conc…
URL: https://github.com/apache/phoenix/pull/740#discussion_r396696345
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
 ##########
 @@ -803,7 +766,31 @@ protected PhoenixIndexMetaData 
getPhoenixIndexMetaData(ObserverContext<RegionCop
         return (PhoenixIndexMetaData)indexMetaData;
     }
 
-    private void preparePostIndexMutations(BatchMutateContext context, long 
now, PhoenixIndexMetaData indexMetaData)
+    private boolean hasAllIndexedColumns(IndexMaintainer indexMaintainer, 
MultiMutation multiMutation) {
+        Map<byte[], List<Cell>> familyMap = multiMutation.getFamilyCellMap();
+        for (ColumnReference columnReference : 
indexMaintainer.getIndexedColumns()) {
+            byte[] family = columnReference.getFamily();
+            List<Cell> cellList = familyMap.get(family);
+            if (cellList == null) {
+                return false;
+            }
+            boolean has = false;
+            for (Cell cell : cellList) {
+                if (Bytes.compareTo(CellUtil.cloneFamily(cell), family) == 0 &&
+                        Bytes.compareTo(CellUtil.cloneQualifier(cell), 
columnReference.getQualifier() ) == 0) {
+                    has = true;
 
 Review comment:
   Please see line 177. The multiMutationMap attribute holds the data table 
pending rows. Also indexMaintainer.getIndexedColumns() returns the data column 
references for indexed columns. The data columns are grouped into three 
classes, pk columns (data table pk columns), the indexed columns (the columns 
for which we want to have indexing; they form the prefix for the primary key 
for the index table (after salt and tenant id)) and covered columns. The 
purpose of the loop is to find out if all the indexed columns are included in 
the pending data table mutation pointed by multiMutation. I will add these 
comments to the code.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to