[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/4.x-HBase-0.98
Commit: d45938c2bb9186d5db9f39eb63069985a35dddb0
Parents: a9934ef
Author: Ankit Singhal 
Authored: Mon May 16 12:45:33 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:45:33 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 +++---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  1 +
 .../query/ConnectionQueryServicesImpl.java  | 98 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 +++--
 .../org/apache/phoenix/util/SchemaUtil.java | 15 ++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 +++
 14 files changed, 220 insertions(+), 85 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d45938c2/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index abcf6ef..aa7a6b2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d45938c2/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 28dbbebf070eb7a54644d578333b762b1e2ccf30
Parents: c345e09
Author: Ankit Singhal 
Authored: Mon May 16 12:38:04 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:38:04 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  4 +-
 .../query/ConnectionQueryServicesImpl.java  | 86 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 ---
 .../org/apache/phoenix/util/SchemaUtil.java | 15 +++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++-
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 
 14 files changed, 216 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/28dbbebf/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index abcf6ef..aa7a6b2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/28dbbebf/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 3bd2a78e1f85d44bff1c0bad09f62ca08acaced7
Parents: 156c356
Author: Ankit Singhal 
Authored: Mon May 16 12:19:55 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:19:55 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  4 +-
 .../query/ConnectionQueryServicesImpl.java  | 86 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 ---
 .../org/apache/phoenix/util/SchemaUtil.java | 15 +++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++-
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 
 14 files changed, 216 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3bd2a78e/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index abcf6ef..aa7a6b2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3bd2a78e/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/master
Commit: 20ce95b0c09d7aaa394f2e703f6b1e193141ad33
Parents: 33fb201
Author: Ankit Singhal 
Authored: Mon May 16 12:16:47 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:16:47 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  4 +-
 .../query/ConnectionQueryServicesImpl.java  | 86 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 ---
 .../org/apache/phoenix/util/SchemaUtil.java | 15 +++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++-
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 
 14 files changed, 216 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/20ce95b0/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index 1d0f767..fbea0f0 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/20ce95b0/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();