twdsilva commented on a change in pull request #473: PHOENIX-5138 - ViewIndexId 
sequences created after PHOENIX-5132 shoul…
URL: https://github.com/apache/phoenix/pull/473#discussion_r269699673
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
 ##########
 @@ -2310,6 +2316,98 @@ private static void mapChildViewsToNamespace(String 
connUrl, Properties props, L
         }
     }
 
+    public static void mergeViewIndexIdSequences(ConnectionQueryServices cqs, 
PhoenixConnection metaConnection)
+        throws SQLException{
+         /* before PHOENIX-5132, there was a per-tenant sequence to generate 
view index ids,
+           which could cause problems if global and tenant-owned view indexes 
were mixed for the
+           same physical base table. Now there's just one sequence for all 
view indexes of the same
+           physical table, but we have to check to see if there are any legacy 
sequences, and
+           merge them into a single sequence equal to max + 1 of the largest 
legacy sequence
+           to avoid collisons.
+         */
+        Map<String, List<SequenceKey>> sequenceTableMap = new HashMap<>();
 
 Review comment:
   maybe add a comment saying this is storing a mapping between physical table 
to list of view index sequences

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