priyankporwal commented on a change in pull request #520: PHOENIX-5333: A tool
to upgrade existing tables/indexes to use self-c…
URL: https://github.com/apache/phoenix/pull/520#discussion_r295478764
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexUpgradeToolIT.java
##########
@@ -0,0 +1,506 @@
+package org.apache.phoenix.end2end;
+
+import com.google.common.collect.Maps;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.TableNotFoundException;
+import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.phoenix.hbase.index.IndexRegionObserver;
+import org.apache.phoenix.hbase.index.Indexer;
+import org.apache.phoenix.index.GlobalIndexChecker;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.mapreduce.index.IndexUpgradeTool;
+import org.apache.phoenix.query.BaseTest;
+import org.apache.phoenix.query.ConnectionQueryServices;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.Parameterized;
+
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+import java.util.UUID;
+
+@RunWith(Parameterized.class)
+@Category(NeedsOwnMiniClusterTest.class)
+public class IndexUpgradeToolIT extends BaseTest {
+
+ private final boolean mutable;
+ private final boolean upgrade;
+ private StringBuilder optionsBuilder;
+ private String tableDDLOptions;
+
+ private static Map<String, String> serverProps =
Maps.newHashMapWithExpectedSize(1), clientProps =
Maps.newHashMapWithExpectedSize(1);
+
+ private String [] indexesList = {"TEST.INDEX1", "TEST.INDEX2",
"TEST1.INDEX3","TEST1.INDEX2","TEST1.INDEX1","TEST.INDEX3"};
+ private String [] tableList = {"TEST.MOCK1","TEST1.MOCK2","TEST.MOCK3"};
+
+ private String inputList =
"TEST.MOCK1:INDEX1,INDEX2;TEST1.MOCK2:INDEX3,INDEX2,INDEX1;TEST.MOCK3:INDEX3";
+
+
+ @Before
+ public void setup () throws Exception {
+ optionsBuilder = new StringBuilder();
+
+ if (upgrade) {
Review comment:
I feel this code block can use some comments to help new devs understand
that we are trying to restore the cluster state prior to upgrade/rollback
operations.
----------------------------------------------------------------
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