kadirozde commented on a change in pull request #469: PHOENIX-5156 Consistent 
Global Indexes for Non-Transactional Tables
URL: https://github.com/apache/phoenix/pull/469#discussion_r266720305
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
 ##########
 @@ -509,28 +438,104 @@ public void 
preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnviro
           byte[] tableName = 
c.getEnvironment().getRegion().getTableDescriptor().getTableName().getName();
           Iterator<Pair<Mutation, byte[]>> indexUpdatesItr = 
indexUpdates.iterator();
           List<Mutation> localUpdates = new 
ArrayList<Mutation>(indexUpdates.size());
+          List<Pair<Mutation, byte[]>> postIndexUpdates = new 
ArrayList<>(indexUpdates.size());
+          List<Pair<Mutation, byte[]>> indexUpdatesForDeletes = new 
ArrayList<>(indexUpdates.size());
+          IndexMetaData indexMetaData = 
this.builder.getIndexMetaData(miniBatchOp);
+          if (!(indexMetaData instanceof PhoenixIndexMetaData)) {
+              throw new DoNotRetryIOException(
+                      "preBatchMutateWithExceptions: indexMetaData is not an 
instance of PhoenixIndexMetaData " +
+                              
c.getEnvironment().getRegion().getRegionInfo().getTable().getNameAsString());
+          }
+          List<IndexMaintainer> maintainers = 
((PhoenixIndexMetaData)indexMetaData).getIndexMaintainers();
           while(indexUpdatesItr.hasNext()) {
               Pair<Mutation, byte[]> next = indexUpdatesItr.next();
               if (Bytes.compareTo(next.getSecond(), tableName) == 0) {
                   localUpdates.add(next.getFirst());
                   indexUpdatesItr.remove();
               }
+              else {
+                  // get index maintainer for this index table
+                  IndexMaintainer indexMaintainer = null;
 
 Review comment:
   Will do it.

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