You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/03/23 19:17:10 UTC

[GitHub] [phoenix] kadirozde commented on a change in pull request #740: PHOENIX-5795 Supporting selective queries for index rows updated conc…

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:
users@infra.apache.org


With regards,
Apache Git Services