swaroopak commented on a change in pull request #510: PHOENIX-5295: Local Index 
data not replicating for older HBase versio…
URL: https://github.com/apache/phoenix/pull/510#discussion_r289157557
 
 

 ##########
 File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexReplicationIT.java
 ##########
 @@ -274,8 +274,133 @@ private boolean ensureAnyRows(HTable remoteTable) throws 
IOException {
         return found;
     }
 
+    private boolean ensureNumberOfRows(HTable remoteTable, int numRows) throws 
IOException {
+        Scan scan = new Scan();
+        scan.setRaw(true);
+        ResultScanner scanner = remoteTable.getScanner(scan);
+        int rowsFound = 0;
+        for (Result r : scanner) {
+            LOG.info("got row: " + r);
+            rowsFound++;
+        }
+        scanner.close();
+        return (numRows == rowsFound);
+    }
+
     private static Connection getConnection() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         return DriverManager.getConnection(URL, props);
     }
+
+    @Test
+    public void testReplicationWithMutableLocalIndexes() throws Exception {
+        // Generating new table names so they don't conflict with previous or 
concurrent test runs.
+        String dataTableName = generateUniqueName();
+        String dataTableFullName = SchemaUtil.getTableName(SCHEMA_NAME, 
dataTableName);
+        String indexTableName = generateUniqueIndexName();
+        String indexTableFullName = SchemaUtil.getTableName(SCHEMA_NAME, 
indexTableName);
+
+        Connection conn = getConnection();
+
+        //create the primary and index tables
+        conn.createStatement().execute(
 
 Review comment:
   nit: Please include this in try-catch or try-with-resources.

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