phoenix git commit: PHOENIX-1336 Exception when select from local index:Cache of region boundaries are out of date(Rajeshbabu)

2015-01-22 Thread rajeshbabu
Repository: phoenix
Updated Branches:
  refs/heads/4.0 d2cef2bd3 - 349d36bce


PHOENIX-1336 Exception when select from local index:Cache of region boundaries 
are out of date(Rajeshbabu)


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

Branch: refs/heads/4.0
Commit: 349d36bcee61ad3200c2072983c9430fdcfaaa95
Parents: d2cef2b
Author: Rajeshbabu Chintaguntla rajeshb...@apache.org
Authored: Thu Jan 22 17:36:03 2015 +0530
Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org
Committed: Thu Jan 22 17:36:03 2015 +0530

--
 .../phoenix/end2end/index/LocalIndexIT.java | 45 +++-
 .../org/apache/phoenix/compile/ScanRanges.java  |  7 ++-
 .../coprocessor/BaseScannerRegionObserver.java  |  1 +
 .../phoenix/iterate/ChunkedResultIterator.java  | 24 +++
 4 files changed, 75 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/349d36bc/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 03323f1..6ff0475 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
@@ -32,6 +32,7 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
 
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -101,7 +102,7 @@ public class LocalIndexIT extends BaseHBaseManagedTimeIT {
 k3 INTEGER,\n +
 v1 VARCHAR,\n +
 CONSTRAINT pk PRIMARY KEY (t_id, k1, k2))\n
-+ (saltBuckets != null  splits == null ? 
(,salt_buckets= + saltBuckets) :  
++ (saltBuckets != null  splits == null ? ( 
salt_buckets= + saltBuckets) : 
 + (saltBuckets == null  splits != null ? ( split on 
 + splits) : ));
 conn.createStatement().execute(ddl);
 conn.close();
@@ -786,6 +787,48 @@ public class LocalIndexIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testLocalIndexScanWithSmallChunks() throws Exception {
+createBaseTable(TestUtil.DEFAULT_DATA_TABLE_NAME, 3, null);
+Properties props = new Properties();
+props.setProperty(QueryServices.SCAN_RESULT_CHUNK_SIZE, 2);
+Connection conn1 = DriverManager.getConnection(getUrl(), props);
+try{
+String[] strings = 
{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z};
+for (int i = 0; i  26; i++) {
+   conn1.createStatement().execute(
+UPSERT INTO  + TestUtil.DEFAULT_DATA_TABLE_NAME +  
values('+strings[i]+', + i + ,
++ (i + 1) + , + (i + 2) + ,' + strings[25 - i] 
+ '));
+}
+conn1.commit();
+conn1.createStatement().execute(CREATE LOCAL INDEX  + 
TestUtil.DEFAULT_INDEX_TABLE_NAME +  ON  + TestUtil.DEFAULT_DATA_TABLE_NAME + 
(v1));
+conn1.createStatement().execute(CREATE LOCAL INDEX  + 
TestUtil.DEFAULT_INDEX_TABLE_NAME + _2 ON  + TestUtil.DEFAULT_DATA_TABLE_NAME 
+ (k3));
+
+ResultSet rs = conn1.createStatement().executeQuery(SELECT * FROM 
 + TestUtil.DEFAULT_DATA_TABLE_NAME);
+assertTrue(rs.next());
+
+String query = SELECT t_id,k1,v1 FROM  + 
TestUtil.DEFAULT_DATA_TABLE_NAME;
+rs = conn1.createStatement().executeQuery(query);
+for (int j = 0; j  26; j++) {
+assertTrue(rs.next());
+assertEquals(strings[25 - j], rs.getString(t_id));
+assertEquals(25 - j, rs.getInt(k1));
+assertEquals(strings[j], rs.getString(V1));
+}
+query = SELECT t_id,k1,k3 FROM  + 
TestUtil.DEFAULT_DATA_TABLE_NAME;
+rs = conn1.createStatement().executeQuery(query);
+Thread.sleep(1000);
+for (int j = 0; j  26; j++) {
+assertTrue(rs.next());
+assertEquals(strings[j], rs.getString(t_id));
+assertEquals(j, rs.getInt(k1));
+assertEquals(j + 2, rs.getInt(k3));
+}
+   } finally {
+conn1.close();
+}
+}
+
+@Test
 public void testLocalIndexScanAfterRegionsMerge() throws Exception {
 createBaseTable(TestUtil.DEFAULT_DATA_TABLE_NAME, null, 

Apache-Phoenix | 4.0 | Build Successful

2015-01-22 Thread Apache Jenkins Server
4.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.0/lastCompletedBuild/testReport/

Changes
[rajeshbabu] PHOENIX-1336 Exception when select from local index:Cache of region boundaries are out of date(Rajeshbabu)



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


phoenix git commit: PHOENIX-1336 Exception when select from local index:Cache of region boundaries are out of date(Rajeshbabu)

2015-01-22 Thread rajeshbabu
Repository: phoenix
Updated Branches:
  refs/heads/master fe532bf7c - f6f71096a


PHOENIX-1336 Exception when select from local index:Cache of region boundaries 
are out of date(Rajeshbabu)


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

Branch: refs/heads/master
Commit: f6f71096a57866361bdd2ef8c9e0087cfe2ccbfb
Parents: fe532bf
Author: Rajeshbabu Chintaguntla rajeshb...@apache.org
Authored: Thu Jan 22 17:34:51 2015 +0530
Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org
Committed: Thu Jan 22 17:34:51 2015 +0530

--
 .../phoenix/end2end/index/LocalIndexIT.java | 45 +++-
 .../org/apache/phoenix/compile/ScanRanges.java  |  7 ++-
 .../coprocessor/BaseScannerRegionObserver.java  |  1 +
 .../phoenix/iterate/ChunkedResultIterator.java  | 24 +++
 4 files changed, 75 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f6f71096/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 03323f1..6ff0475 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
@@ -32,6 +32,7 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
 
 import org.apache.hadoop.hbase.HRegionInfo;
@@ -101,7 +102,7 @@ public class LocalIndexIT extends BaseHBaseManagedTimeIT {
 k3 INTEGER,\n +
 v1 VARCHAR,\n +
 CONSTRAINT pk PRIMARY KEY (t_id, k1, k2))\n
-+ (saltBuckets != null  splits == null ? 
(,salt_buckets= + saltBuckets) :  
++ (saltBuckets != null  splits == null ? ( 
salt_buckets= + saltBuckets) : 
 + (saltBuckets == null  splits != null ? ( split on 
 + splits) : ));
 conn.createStatement().execute(ddl);
 conn.close();
@@ -786,6 +787,48 @@ public class LocalIndexIT extends BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testLocalIndexScanWithSmallChunks() throws Exception {
+createBaseTable(TestUtil.DEFAULT_DATA_TABLE_NAME, 3, null);
+Properties props = new Properties();
+props.setProperty(QueryServices.SCAN_RESULT_CHUNK_SIZE, 2);
+Connection conn1 = DriverManager.getConnection(getUrl(), props);
+try{
+String[] strings = 
{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z};
+for (int i = 0; i  26; i++) {
+   conn1.createStatement().execute(
+UPSERT INTO  + TestUtil.DEFAULT_DATA_TABLE_NAME +  
values('+strings[i]+', + i + ,
++ (i + 1) + , + (i + 2) + ,' + strings[25 - i] 
+ '));
+}
+conn1.commit();
+conn1.createStatement().execute(CREATE LOCAL INDEX  + 
TestUtil.DEFAULT_INDEX_TABLE_NAME +  ON  + TestUtil.DEFAULT_DATA_TABLE_NAME + 
(v1));
+conn1.createStatement().execute(CREATE LOCAL INDEX  + 
TestUtil.DEFAULT_INDEX_TABLE_NAME + _2 ON  + TestUtil.DEFAULT_DATA_TABLE_NAME 
+ (k3));
+
+ResultSet rs = conn1.createStatement().executeQuery(SELECT * FROM 
 + TestUtil.DEFAULT_DATA_TABLE_NAME);
+assertTrue(rs.next());
+
+String query = SELECT t_id,k1,v1 FROM  + 
TestUtil.DEFAULT_DATA_TABLE_NAME;
+rs = conn1.createStatement().executeQuery(query);
+for (int j = 0; j  26; j++) {
+assertTrue(rs.next());
+assertEquals(strings[25 - j], rs.getString(t_id));
+assertEquals(25 - j, rs.getInt(k1));
+assertEquals(strings[j], rs.getString(V1));
+}
+query = SELECT t_id,k1,k3 FROM  + 
TestUtil.DEFAULT_DATA_TABLE_NAME;
+rs = conn1.createStatement().executeQuery(query);
+Thread.sleep(1000);
+for (int j = 0; j  26; j++) {
+assertTrue(rs.next());
+assertEquals(strings[j], rs.getString(t_id));
+assertEquals(j, rs.getInt(k1));
+assertEquals(j + 2, rs.getInt(k3));
+}
+   } finally {
+conn1.close();
+}
+}
+
+@Test
 public void testLocalIndexScanAfterRegionsMerge() throws Exception {
 createBaseTable(TestUtil.DEFAULT_DATA_TABLE_NAME, 

Apache-Phoenix | Master | Build Successful

2015-01-22 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git

Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-master/lastSuccessfulBuild/artifact/

Last Complete Test Report https://builds.apache.org/job/Phoenix-master/lastCompletedBuild/testReport/

Changes
[rajeshbabu] PHOENIX-1336 Exception when select from local index:Cache of region boundaries are out of date(Rajeshbabu)



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


svn commit: r1654105 - in /phoenix/site: publish/secondary_indexing.html source/src/site/markdown/secondary_indexing.md

2015-01-22 Thread jamestaylor
Author: jamestaylor
Date: Fri Jan 23 01:18:19 2015
New Revision: 1654105

URL: http://svn.apache.org/r1654105
Log:
Update local index docs (Rajeshbabu)

Modified:
phoenix/site/publish/secondary_indexing.html
phoenix/site/source/src/site/markdown/secondary_indexing.md

Modified: phoenix/site/publish/secondary_indexing.html
URL: 
http://svn.apache.org/viewvc/phoenix/site/publish/secondary_indexing.html?rev=1654105r1=1654104r2=1654105view=diff
==
--- phoenix/site/publish/secondary_indexing.html (original)
+++ phoenix/site/publish/secondary_indexing.html Fri Jan 23 01:18:19 2015
@@ -1,7 +1,7 @@
 
 !DOCTYPE html
 !--
- Generated by Apache Maven Doxia at 2015-01-20
+ Generated by Apache Maven Doxia at 2015-01-22
  Rendered using Reflow Maven Skin 1.1.0 
(http://andriusvelykis.github.io/reflow-maven-skin)
 --
 html  xml:lang=en lang=en
@@ -259,6 +259,14 @@
 lt;/propertygt;
 /pre 
  /div 
+ pTo support local index regions merge on data regions merge you will need 
to add the following parameter to tthbase-site.xml/tt in all the region 
servers and restart. (It’s applicable for Phoenix 4.3+ versions)/p 
+ div class=source 
+  prelt;propertygt;
+  lt;namegt;hbase.coprocessor.regionserver.classeslt;/namegt;
+  
lt;valuegt;org.apache.hadoop.hbase.regionserver.LocalIndexMergerlt;/valuegt;
+lt;/propertygt;
+/pre 
+ /div 
 /div 
 div class=section 
  h2 id=TuningTuning/h2 

Modified: phoenix/site/source/src/site/markdown/secondary_indexing.md
URL: 
http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/secondary_indexing.md?rev=1654105r1=1654104r2=1654105view=diff
==
--- phoenix/site/source/src/site/markdown/secondary_indexing.md (original)
+++ phoenix/site/source/src/site/markdown/secondary_indexing.md Fri Jan 23 
01:18:19 2015
@@ -132,6 +132,15 @@ You will need to add the following param
 /property
 ```
 
+To support local index regions merge on data regions merge you will need to 
add the following parameter to `hbase-site.xml` in all the region servers and 
restart. (It’s applicable for Phoenix 4.3+ versions)
+
+```
+property
+  namehbase.coprocessor.regionserver.classes/name
+  valueorg.apache.hadoop.hbase.regionserver.LocalIndexMerger/value
+/property
+```
+
 ## Tuning
 Out the box, indexing is pretty fast. However, to optimize for your particular 
environment and workload, there are several properties you can tune.