[17/24] git commit: PHOENIX-1170 Change status of local index during splitting to prevent usage when slower than query through data table (Rajeshbabu)

2014-10-28 Thread jamestaylor
PHOENIX-1170 Change status of local index during splitting to prevent usage 
when slower than query through data table (Rajeshbabu)


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

Branch: refs/heads/4.2
Commit: 4c0d00bdd32e1853e929729f396dda567dc6faeb
Parents: b48ca7b
Author: James Taylor 
Authored: Mon Oct 27 14:29:07 2014 -0700
Committer: James Taylor 
Committed: Mon Oct 27 14:29:07 2014 -0700

--
 .../org/apache/phoenix/end2end/QueryIT.java |  20 ++-
 .../phoenix/end2end/index/LocalIndexIT.java | 152 ---
 .../IndexHalfStoreFileReaderGenerator.java  |  63 
 .../hbase/regionserver/LocalIndexSplitter.java  |  40 +
 .../java/org/apache/phoenix/query/BaseTest.java |   1 +
 5 files changed, 250 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c0d00bd/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 cc431c1..f45b689 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
@@ -50,6 +50,7 @@ import java.sql.Timestamp;
 import java.util.Arrays;
 import java.util.Properties;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
@@ -60,6 +61,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.schema.PDataType;
 import org.apache.phoenix.schema.SequenceNotFoundException;
 import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.junit.Test;
@@ -761,14 +763,16 @@ public class QueryIT extends BaseQueryIT {
 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());
+
if(!admin.tableExists(TableName.valueOf(MetaDataUtil.getLocalIndexTableName(ATABLE_NAME
 {
+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());
+} 
 
 statement.setString(1, tenantId);
 rs = statement.executeQuery();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c0d00bd/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
index 019e0fb..7fa69d4 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
@@ -24,22 +24,31 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;

git commit: PHOENIX-1170 Change status of local index during splitting to prevent usage when slower than query through data table (Rajeshbabu)

2014-10-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 842f8a8a8 -> a1685c4f5


PHOENIX-1170 Change status of local index during splitting to prevent usage 
when slower than query through data table (Rajeshbabu)


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

Branch: refs/heads/master
Commit: a1685c4f5413d38a81da08945b736d554efb8ab8
Parents: 842f8a8
Author: James Taylor 
Authored: Mon Oct 27 14:29:07 2014 -0700
Committer: James Taylor 
Committed: Mon Oct 27 14:29:52 2014 -0700

--
 .../org/apache/phoenix/end2end/QueryIT.java |  20 ++-
 .../phoenix/end2end/index/LocalIndexIT.java | 152 ---
 .../IndexHalfStoreFileReaderGenerator.java  |  63 
 .../hbase/regionserver/LocalIndexSplitter.java  |  40 +
 .../java/org/apache/phoenix/query/BaseTest.java |   1 +
 5 files changed, 250 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a1685c4f/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 cc431c1..f45b689 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
@@ -50,6 +50,7 @@ import java.sql.Timestamp;
 import java.util.Arrays;
 import java.util.Properties;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
@@ -60,6 +61,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.schema.PDataType;
 import org.apache.phoenix.schema.SequenceNotFoundException;
 import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.junit.Test;
@@ -761,14 +763,16 @@ public class QueryIT extends BaseQueryIT {
 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());
+
if(!admin.tableExists(TableName.valueOf(MetaDataUtil.getLocalIndexTableName(ATABLE_NAME
 {
+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());
+} 
 
 statement.setString(1, tenantId);
 rs = statement.executeQuery();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a1685c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
index 019e0fb..7fa69d4 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
@@ -24,22 +24,31 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 
 import o

git commit: PHOENIX-1170 Change status of local index during splitting to prevent usage when slower than query through data table (Rajeshbabu)

2014-10-27 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 b48ca7b5c -> 4c0d00bdd


PHOENIX-1170 Change status of local index during splitting to prevent usage 
when slower than query through data table (Rajeshbabu)


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

Branch: refs/heads/4.0
Commit: 4c0d00bdd32e1853e929729f396dda567dc6faeb
Parents: b48ca7b
Author: James Taylor 
Authored: Mon Oct 27 14:29:07 2014 -0700
Committer: James Taylor 
Committed: Mon Oct 27 14:29:07 2014 -0700

--
 .../org/apache/phoenix/end2end/QueryIT.java |  20 ++-
 .../phoenix/end2end/index/LocalIndexIT.java | 152 ---
 .../IndexHalfStoreFileReaderGenerator.java  |  63 
 .../hbase/regionserver/LocalIndexSplitter.java  |  40 +
 .../java/org/apache/phoenix/query/BaseTest.java |   1 +
 5 files changed, 250 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c0d00bd/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 cc431c1..f45b689 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
@@ -50,6 +50,7 @@ import java.sql.Timestamp;
 import java.util.Arrays;
 import java.util.Properties;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
@@ -60,6 +61,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.schema.PDataType;
 import org.apache.phoenix.schema.SequenceNotFoundException;
 import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.junit.Test;
@@ -761,14 +763,16 @@ public class QueryIT extends BaseQueryIT {
 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());
+
if(!admin.tableExists(TableName.valueOf(MetaDataUtil.getLocalIndexTableName(ATABLE_NAME
 {
+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());
+} 
 
 statement.setString(1, tenantId);
 rs = statement.executeQuery();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c0d00bd/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
index 019e0fb..7fa69d4 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
@@ -24,22 +24,31 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CountDownLatch;
 
 import org.apa