[2/2] git commit: PHOENIX-1058 Support index region split on it's corresponding data region split (Rajeshbabu)

2014-08-11 Thread jamestaylor
PHOENIX-1058 Support index region split on it's corresponding data region split 
(Rajeshbabu)


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4fa6146b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4fa6146b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4fa6146b

Branch: refs/heads/4.0
Commit: 4fa6146b3a2b0352f2b71e176a36d08499307438
Parents: 2ed929a
Author: Rajeshbabu Chintaguntla rajeshbabu.chintagun...@huawei.com
Authored: Mon Aug 11 23:53:34 2014 +0530
Committer: James Taylor jtay...@salesforce.com
Committed: Mon Aug 11 16:26:01 2014 -0700

--
 .../org/apache/phoenix/end2end/BaseQueryIT.java |   6 +
 .../org/apache/phoenix/end2end/QueryIT.java |  24 +-
 .../phoenix/end2end/index/LocalIndexIT.java | 110 +++
 .../regionserver/IndexHalfStoreFileReader.java  | 458 +
 .../IndexHalfStoreFileReaderGenerator.java  | 159 +++
 .../regionserver/IndexSplitTransaction.java | 974 +++
 .../hbase/regionserver/LocalIndexSplitter.java  | 101 ++
 .../apache/phoenix/index/IndexMaintainer.java   |  32 +
 ...ocalIndexParallelIteratorRegionSplitter.java |   1 +
 .../query/ConnectionQueryServicesImpl.java  |  17 +
 .../java/org/apache/phoenix/query/BaseTest.java |   9 +-
 11 files changed, 1876 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4fa6146b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
index d736612..4263dd2 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
@@ -113,6 +113,12 @@ public abstract class BaseQueryIT extends 
BaseClientManagedTimeIT {
 + B_STRING,  + A_DATE) });
 testCases.add(new String[] { CREATE INDEX  + ATABLE_INDEX_NAME +  
ON aTable (a_integer) INCLUDE (
 + A_STRING,  + B_STRING,  + A_DATE) });
+testCases.add(new String[] { CREATE LOCAL INDEX  + ATABLE_INDEX_NAME 
+  ON aTable (a_integer DESC) INCLUDE (
++ A_STRING,  + B_STRING,  + A_DATE) });
+testCases.add(new String[] { CREATE LOCAL INDEX  + ATABLE_INDEX_NAME 
+  ON aTable (a_integer, a_string) INCLUDE (
++ B_STRING,  + A_DATE) });
+testCases.add(new String[] { CREATE LOCAL INDEX  + ATABLE_INDEX_NAME 
+  ON aTable (a_integer) INCLUDE (
++ A_STRING,  + B_STRING,  + A_DATE) });
 testCases.add(new String[] {  });
 return testCases;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4fa6146b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
index d9c3862..35140f4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
@@ -739,19 +739,17 @@ public class QueryIT extends BaseQueryIT {
 
 byte[] tableName = Bytes.toBytes(ATABLE_NAME);
 admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
-if 
(admin.tableExists(TableName.valueOf(MetaDataUtil.getLocalIndexTableName(atable
 {
-HTable htable = (HTable) 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(tableName);
-htable.clearRegionCache();
-int nRegions = htable.getRegionLocations().size();
-admin.split(tableName, 
ByteUtil.concat(Bytes.toBytes(tenantId), Bytes.toBytes(00A + 
Character.valueOf((char) ('3' + nextRunCount())) + ts))); // vary split point 
with test run
-int retryCount = 0;
-do {
-Thread.sleep(2000);
-retryCount++;
-//htable.clearRegionCache();
-} while (retryCount  10  htable.getRegionLocations().size() 
== nRegions);
-assertNotEquals(nRegions, htable.getRegionLocations().size());
-}
+HTable htable = (HTable) 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(tableName);
+htable.clearRegionCache();
+int nRegions = htable.getRegionLocations().size();
+admin.split(tableName, ByteUtil.concat(Bytes.toBytes(tenantId), 
Bytes.toBytes(00A + Character.valueOf((char) ('3' + 

[2/2] git commit: PHOENIX-1058 Support index region split on it's corresponding data region split (Rajeshbabu)

2014-08-11 Thread jamestaylor
PHOENIX-1058 Support index region split on it's corresponding data region split 
(Rajeshbabu)


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/bdf873f5
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/bdf873f5
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/bdf873f5

Branch: refs/heads/master
Commit: bdf873f5a0789420f02f9f0a303b91a36ce85d39
Parents: 416b8a6
Author: Rajeshbabu Chintaguntla rajeshbabu.chintagun...@huawei.com
Authored: Mon Aug 11 23:53:34 2014 +0530
Committer: James Taylor jtay...@salesforce.com
Committed: Mon Aug 11 16:27:44 2014 -0700

--
 .../org/apache/phoenix/end2end/BaseQueryIT.java |   6 +
 .../org/apache/phoenix/end2end/QueryIT.java |  24 +-
 .../phoenix/end2end/index/LocalIndexIT.java | 110 +++
 .../regionserver/IndexHalfStoreFileReader.java  | 458 +
 .../IndexHalfStoreFileReaderGenerator.java  | 159 +++
 .../regionserver/IndexSplitTransaction.java | 974 +++
 .../hbase/regionserver/LocalIndexSplitter.java  | 101 ++
 .../apache/phoenix/index/IndexMaintainer.java   |  32 +
 ...ocalIndexParallelIteratorRegionSplitter.java |   1 +
 .../query/ConnectionQueryServicesImpl.java  |  17 +
 .../java/org/apache/phoenix/query/BaseTest.java |   9 +-
 11 files changed, 1876 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/bdf873f5/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
index d736612..4263dd2 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java
@@ -113,6 +113,12 @@ public abstract class BaseQueryIT extends 
BaseClientManagedTimeIT {
 + B_STRING,  + A_DATE) });
 testCases.add(new String[] { CREATE INDEX  + ATABLE_INDEX_NAME +  
ON aTable (a_integer) INCLUDE (
 + A_STRING,  + B_STRING,  + A_DATE) });
+testCases.add(new String[] { CREATE LOCAL INDEX  + ATABLE_INDEX_NAME 
+  ON aTable (a_integer DESC) INCLUDE (
++ A_STRING,  + B_STRING,  + A_DATE) });
+testCases.add(new String[] { CREATE LOCAL INDEX  + ATABLE_INDEX_NAME 
+  ON aTable (a_integer, a_string) INCLUDE (
++ B_STRING,  + A_DATE) });
+testCases.add(new String[] { CREATE LOCAL INDEX  + ATABLE_INDEX_NAME 
+  ON aTable (a_integer) INCLUDE (
++ A_STRING,  + B_STRING,  + A_DATE) });
 testCases.add(new String[] {  });
 return testCases;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bdf873f5/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
index d9c3862..35140f4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryIT.java
@@ -739,19 +739,17 @@ public class QueryIT extends BaseQueryIT {
 
 byte[] tableName = Bytes.toBytes(ATABLE_NAME);
 admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
-if 
(admin.tableExists(TableName.valueOf(MetaDataUtil.getLocalIndexTableName(atable
 {
-HTable htable = (HTable) 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(tableName);
-htable.clearRegionCache();
-int nRegions = htable.getRegionLocations().size();
-admin.split(tableName, 
ByteUtil.concat(Bytes.toBytes(tenantId), Bytes.toBytes(00A + 
Character.valueOf((char) ('3' + nextRunCount())) + ts))); // vary split point 
with test run
-int retryCount = 0;
-do {
-Thread.sleep(2000);
-retryCount++;
-//htable.clearRegionCache();
-} while (retryCount  10  htable.getRegionLocations().size() 
== nRegions);
-assertNotEquals(nRegions, htable.getRegionLocations().size());
-}
+HTable htable = (HTable) 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(tableName);
+htable.clearRegionCache();
+int nRegions = htable.getRegionLocations().size();
+admin.split(tableName, ByteUtil.concat(Bytes.toBytes(tenantId), 
Bytes.toBytes(00A + Character.valueOf((char) ('3' +