phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-18 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 0f5c31574 -> cd6322536


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/4.x-HBase-1.2
Commit: cd6322536fabefa4f63bf0dc808b8b5c9c765808
Parents: 0f5c315
Author: James Taylor 
Authored: Mon Sep 18 11:25:09 2017 -0700
Committer: James Taylor 
Committed: Mon Sep 18 11:28:43 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 47 +++-
 1 file changed, 17 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cd632253/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 7a06bcd..e226491 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -41,6 +41,7 @@ import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
 import org.apache.phoenix.schema.SequenceAlreadyExistsException;
 import org.apache.phoenix.schema.SequenceNotFoundException;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
@@ -1403,47 +1404,39 @@ public class SequenceIT extends ParallelStatsDisabledIT 
{
 
 @Test
 public void testPointInTimeSequence() throws Exception {
-String sequenceName = generateNameWithSchema();
-Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-Connection conn;
+String seqName = generateNameWithSchema(); 
+Properties scnProps = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection beforeSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 ResultSet rs;
-String seqName = sequenceName;
-long ts = nextTimestamp();
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5));
-conn = DriverManager.getConnection(getUrl(), props);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("CREATE SEQUENCE " + seqName + "");
 
 try {
-conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+beforeSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 fail();
 } catch (SequenceNotFoundException e) {
-conn.close();
+beforeSeqConn.close();
 }
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10));
-conn = DriverManager.getConnection(getUrl(), props);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection afterSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(1, rs.getInt(1));
-conn.close();
-
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 7));
-conn = DriverManager.getConnection(getUrl(), props);
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(2, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 15));
-conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("DROP SEQUENCE " + seqName + "");
-rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+
+rs = afterSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 assertTrue(rs.next());
 assertEquals(3, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20));
-conn = DriverManager.getConnection(getUrl(), props);
 try {
 rs = conn.createStatement().executeQuery("SELECT next value for " 

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-18 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 6bcb1802a -> c42fa1542


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/4.x-HBase-1.1
Commit: c42fa15423b47df2769f871f30a0bd16dd730740
Parents: 6bcb180
Author: James Taylor 
Authored: Mon Sep 18 11:25:09 2017 -0700
Committer: James Taylor 
Committed: Mon Sep 18 11:27:37 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 47 +++-
 1 file changed, 17 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c42fa154/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 7a06bcd..e226491 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -41,6 +41,7 @@ import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
 import org.apache.phoenix.schema.SequenceAlreadyExistsException;
 import org.apache.phoenix.schema.SequenceNotFoundException;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
@@ -1403,47 +1404,39 @@ public class SequenceIT extends ParallelStatsDisabledIT 
{
 
 @Test
 public void testPointInTimeSequence() throws Exception {
-String sequenceName = generateNameWithSchema();
-Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-Connection conn;
+String seqName = generateNameWithSchema(); 
+Properties scnProps = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection beforeSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 ResultSet rs;
-String seqName = sequenceName;
-long ts = nextTimestamp();
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5));
-conn = DriverManager.getConnection(getUrl(), props);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("CREATE SEQUENCE " + seqName + "");
 
 try {
-conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+beforeSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 fail();
 } catch (SequenceNotFoundException e) {
-conn.close();
+beforeSeqConn.close();
 }
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10));
-conn = DriverManager.getConnection(getUrl(), props);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection afterSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(1, rs.getInt(1));
-conn.close();
-
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 7));
-conn = DriverManager.getConnection(getUrl(), props);
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(2, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 15));
-conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("DROP SEQUENCE " + seqName + "");
-rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+
+rs = afterSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 assertTrue(rs.next());
 assertEquals(3, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20));
-conn = DriverManager.getConnection(getUrl(), props);
 try {
 rs = conn.createStatement().executeQuery("SELECT next value for " 

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-18 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 9499bac16 -> 5eb3819b1


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 5eb3819b1b8d646369d5236a0885ccc623186e6d
Parents: 9499bac
Author: James Taylor 
Authored: Mon Sep 18 11:25:09 2017 -0700
Committer: James Taylor 
Committed: Mon Sep 18 11:25:44 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 47 +++-
 1 file changed, 17 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5eb3819b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 7a06bcd..e226491 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -41,6 +41,7 @@ import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
 import org.apache.phoenix.schema.SequenceAlreadyExistsException;
 import org.apache.phoenix.schema.SequenceNotFoundException;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
@@ -1403,47 +1404,39 @@ public class SequenceIT extends ParallelStatsDisabledIT 
{
 
 @Test
 public void testPointInTimeSequence() throws Exception {
-String sequenceName = generateNameWithSchema();
-Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-Connection conn;
+String seqName = generateNameWithSchema(); 
+Properties scnProps = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection beforeSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 ResultSet rs;
-String seqName = sequenceName;
-long ts = nextTimestamp();
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5));
-conn = DriverManager.getConnection(getUrl(), props);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("CREATE SEQUENCE " + seqName + "");
 
 try {
-conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+beforeSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 fail();
 } catch (SequenceNotFoundException e) {
-conn.close();
+beforeSeqConn.close();
 }
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10));
-conn = DriverManager.getConnection(getUrl(), props);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection afterSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(1, rs.getInt(1));
-conn.close();
-
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 7));
-conn = DriverManager.getConnection(getUrl(), props);
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(2, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 15));
-conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("DROP SEQUENCE " + seqName + "");
-rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+
+rs = afterSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 assertTrue(rs.next());
 assertEquals(3, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20));
-conn = DriverManager.getConnection(getUrl(), props);
 try {
 rs = conn.createStatement().executeQuery("SELECT next value for 

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-18 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 711b5bfad -> e455df310


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/master
Commit: e455df310de0633daf8ddf5aeae985981db3c06f
Parents: 711b5bf
Author: James Taylor 
Authored: Mon Sep 18 11:25:09 2017 -0700
Committer: James Taylor 
Committed: Mon Sep 18 11:25:09 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 47 +++-
 1 file changed, 17 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e455df31/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 7a06bcd..e226491 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -41,6 +41,7 @@ import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
 import org.apache.phoenix.schema.SequenceAlreadyExistsException;
 import org.apache.phoenix.schema.SequenceNotFoundException;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
@@ -1403,47 +1404,39 @@ public class SequenceIT extends ParallelStatsDisabledIT 
{
 
 @Test
 public void testPointInTimeSequence() throws Exception {
-String sequenceName = generateNameWithSchema();
-Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-Connection conn;
+String seqName = generateNameWithSchema(); 
+Properties scnProps = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection beforeSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 ResultSet rs;
-String seqName = sequenceName;
-long ts = nextTimestamp();
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5));
-conn = DriverManager.getConnection(getUrl(), props);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("CREATE SEQUENCE " + seqName + "");
 
 try {
-conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+beforeSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 fail();
 } catch (SequenceNotFoundException e) {
-conn.close();
+beforeSeqConn.close();
 }
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10));
-conn = DriverManager.getConnection(getUrl(), props);
+scnProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(EnvironmentEdgeManager.currentTimeMillis()));
+Connection afterSeqConn = DriverManager.getConnection(getUrl(), 
scnProps);
+
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(1, rs.getInt(1));
-conn.close();
-
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 7));
-conn = DriverManager.getConnection(getUrl(), props);
 rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
 assertTrue(rs.next());
 assertEquals(2, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 15));
-conn = DriverManager.getConnection(getUrl(), props);
 conn.createStatement().execute("DROP SEQUENCE " + seqName + "");
-rs = conn.createStatement().executeQuery("SELECT next value for " + 
seqName);
+
+rs = afterSeqConn.createStatement().executeQuery("SELECT next value 
for " + seqName);
 assertTrue(rs.next());
 assertEquals(3, rs.getInt(1));
-conn.close();
 
-props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20));
-conn = DriverManager.getConnection(getUrl(), props);
 try {
 rs = conn.createStatement().executeQuery("SELECT next value for " 
+ seqName);
  

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-15 Thread mujtaba
Repository: phoenix
Updated Branches:
  refs/heads/master a4f6c2c1a -> c06ef877e


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/master
Commit: c06ef877efa2c55de3430c8289ebad63e8bebc93
Parents: a4f6c2c
Author: Mujtaba 
Authored: Fri Sep 15 10:59:49 2017 -0700
Committer: Mujtaba 
Committed: Fri Sep 15 10:59:49 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 896 ++-
 1 file changed, 461 insertions(+), 435 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c06ef877/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 10f465f..7a06bcd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -35,6 +35,7 @@ import java.util.Map;
 import java.util.Properties;
 
 import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.jdbc.PhoenixStatement;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
@@ -44,31 +45,41 @@ import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.SequenceUtil;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 
-public class SequenceIT extends BaseClientManagedTimeIT {
-private static final String NEXT_VAL_SQL = "SELECT NEXT VALUE FOR foo.bar 
FROM \"SYSTEM\".\"SEQUENCE\"";
-private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s FROM \"SYSTEM\".\"SEQUENCE\"";
+public class SequenceIT extends ParallelStatsDisabledIT {
+private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s";
 private static final long BATCH_SIZE = 3;

 private Connection conn;
 
+private static String generateNameWithSchema() {
+   return SchemaUtil.getTableName(generateUniqueName(), 
generateUniqueName());
+}
+
 @BeforeClass
-@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class)
+@Shadower(classBeingShadowed = ParallelStatsDisabledIT.class)
 public static void doSetup() throws Exception {
-Map props = getDefaultProps();
-// Must update config before starting server
+Map props = Maps.newHashMap();
 props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, 
Long.toString(BATCH_SIZE));
 setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
 }
 
+@Before
+public void init() throws Exception {
+   createConnection();
+}
+
 @After
 public void tearDown() throws Exception {
 // close any open connection between tests, so that connections are 
not leaked
@@ -79,20 +90,21 @@ public class SequenceIT extends BaseClientManagedTimeIT {
 
@Test
public void testSystemTable() throws Exception {
-   nextConnection();
+   conn.createStatement().execute("CREATE SEQUENCE " + 
generateNameWithSchema());
String query = "SELECT sequence_schema, sequence_name, 
current_value, increment_by FROM \"SYSTEM\".\"SEQUENCE\"";
ResultSet rs = conn.prepareStatement(query).executeQuery();
-   assertFalse(rs.next());
+   assertTrue(rs.next());
}
 
@Test
public void testDuplicateSequences() throws Exception {
-nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE alpha.beta 
START WITH 2 INCREMENT BY 4\n");
+String sequenceName = generateNameWithSchema();
+
+
+   conn.createStatement().execute("CREATE SEQUENCE " + 
sequenceName + " START WITH 2 INCREMENT BY 4\n");
 
try {
-   nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE 
alpha.beta START WITH 2 INCREMENT BY 4\n");
+   

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-15 Thread mujtaba
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 e45f1b274 -> 4348212a3


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 4348212a3b0fce03d4820cc415ff1b1e09db3de1
Parents: e45f1b2
Author: Mujtaba 
Authored: Fri Sep 15 10:59:19 2017 -0700
Committer: Mujtaba 
Committed: Fri Sep 15 10:59:19 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 896 ++-
 1 file changed, 461 insertions(+), 435 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4348212a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 10f465f..7a06bcd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -35,6 +35,7 @@ import java.util.Map;
 import java.util.Properties;
 
 import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.jdbc.PhoenixStatement;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
@@ -44,31 +45,41 @@ import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.SequenceUtil;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 
-public class SequenceIT extends BaseClientManagedTimeIT {
-private static final String NEXT_VAL_SQL = "SELECT NEXT VALUE FOR foo.bar 
FROM \"SYSTEM\".\"SEQUENCE\"";
-private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s FROM \"SYSTEM\".\"SEQUENCE\"";
+public class SequenceIT extends ParallelStatsDisabledIT {
+private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s";
 private static final long BATCH_SIZE = 3;

 private Connection conn;
 
+private static String generateNameWithSchema() {
+   return SchemaUtil.getTableName(generateUniqueName(), 
generateUniqueName());
+}
+
 @BeforeClass
-@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class)
+@Shadower(classBeingShadowed = ParallelStatsDisabledIT.class)
 public static void doSetup() throws Exception {
-Map props = getDefaultProps();
-// Must update config before starting server
+Map props = Maps.newHashMap();
 props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, 
Long.toString(BATCH_SIZE));
 setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
 }
 
+@Before
+public void init() throws Exception {
+   createConnection();
+}
+
 @After
 public void tearDown() throws Exception {
 // close any open connection between tests, so that connections are 
not leaked
@@ -79,20 +90,21 @@ public class SequenceIT extends BaseClientManagedTimeIT {
 
@Test
public void testSystemTable() throws Exception {
-   nextConnection();
+   conn.createStatement().execute("CREATE SEQUENCE " + 
generateNameWithSchema());
String query = "SELECT sequence_schema, sequence_name, 
current_value, increment_by FROM \"SYSTEM\".\"SEQUENCE\"";
ResultSet rs = conn.prepareStatement(query).executeQuery();
-   assertFalse(rs.next());
+   assertTrue(rs.next());
}
 
@Test
public void testDuplicateSequences() throws Exception {
-nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE alpha.beta 
START WITH 2 INCREMENT BY 4\n");
+String sequenceName = generateNameWithSchema();
+
+
+   conn.createStatement().execute("CREATE SEQUENCE " + 
sequenceName + " START WITH 2 INCREMENT BY 4\n");
 
try {
-   nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE 
alpha.beta START WITH 2 INCREMENT BY 4\n");
+ 

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-15 Thread mujtaba
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 78666ee40 -> b37ccb52d


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/4.x-HBase-1.2
Commit: b37ccb52d66cf9c5831439ee3b5d7b846c31a502
Parents: 78666ee
Author: Mujtaba 
Authored: Fri Sep 15 10:59:32 2017 -0700
Committer: Mujtaba 
Committed: Fri Sep 15 10:59:32 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 896 ++-
 1 file changed, 461 insertions(+), 435 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b37ccb52/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 10f465f..7a06bcd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -35,6 +35,7 @@ import java.util.Map;
 import java.util.Properties;
 
 import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.jdbc.PhoenixStatement;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
@@ -44,31 +45,41 @@ import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.SequenceUtil;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 
-public class SequenceIT extends BaseClientManagedTimeIT {
-private static final String NEXT_VAL_SQL = "SELECT NEXT VALUE FOR foo.bar 
FROM \"SYSTEM\".\"SEQUENCE\"";
-private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s FROM \"SYSTEM\".\"SEQUENCE\"";
+public class SequenceIT extends ParallelStatsDisabledIT {
+private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s";
 private static final long BATCH_SIZE = 3;

 private Connection conn;
 
+private static String generateNameWithSchema() {
+   return SchemaUtil.getTableName(generateUniqueName(), 
generateUniqueName());
+}
+
 @BeforeClass
-@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class)
+@Shadower(classBeingShadowed = ParallelStatsDisabledIT.class)
 public static void doSetup() throws Exception {
-Map props = getDefaultProps();
-// Must update config before starting server
+Map props = Maps.newHashMap();
 props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, 
Long.toString(BATCH_SIZE));
 setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
 }
 
+@Before
+public void init() throws Exception {
+   createConnection();
+}
+
 @After
 public void tearDown() throws Exception {
 // close any open connection between tests, so that connections are 
not leaked
@@ -79,20 +90,21 @@ public class SequenceIT extends BaseClientManagedTimeIT {
 
@Test
public void testSystemTable() throws Exception {
-   nextConnection();
+   conn.createStatement().execute("CREATE SEQUENCE " + 
generateNameWithSchema());
String query = "SELECT sequence_schema, sequence_name, 
current_value, increment_by FROM \"SYSTEM\".\"SEQUENCE\"";
ResultSet rs = conn.prepareStatement(query).executeQuery();
-   assertFalse(rs.next());
+   assertTrue(rs.next());
}
 
@Test
public void testDuplicateSequences() throws Exception {
-nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE alpha.beta 
START WITH 2 INCREMENT BY 4\n");
+String sequenceName = generateNameWithSchema();
+
+
+   conn.createStatement().execute("CREATE SEQUENCE " + 
sequenceName + " START WITH 2 INCREMENT BY 4\n");
 
try {
-   nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE 
alpha.beta START WITH 2 INCREMENT BY 4\n");
+ 

phoenix git commit: PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN

2017-09-15 Thread mujtaba
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 75901ed0f -> b46b735f0


PHOENIX-4199 Modify SequenceIT.java to not use CurrentSCN


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

Branch: refs/heads/4.x-HBase-0.98
Commit: b46b735f0b997c4640baade689bd0132327ba597
Parents: 75901ed
Author: Mujtaba 
Authored: Fri Sep 15 10:58:49 2017 -0700
Committer: Mujtaba 
Committed: Fri Sep 15 10:58:49 2017 -0700

--
 .../org/apache/phoenix/end2end/SequenceIT.java  | 896 ++-
 1 file changed, 461 insertions(+), 435 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b46b735f/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
index 10f465f..7a06bcd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceIT.java
@@ -35,6 +35,7 @@ import java.util.Map;
 import java.util.Properties;
 
 import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.jdbc.PhoenixStatement;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.SchemaNotFoundException;
@@ -44,31 +45,41 @@ import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.SequenceUtil;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 
-public class SequenceIT extends BaseClientManagedTimeIT {
-private static final String NEXT_VAL_SQL = "SELECT NEXT VALUE FOR foo.bar 
FROM \"SYSTEM\".\"SEQUENCE\"";
-private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s FROM \"SYSTEM\".\"SEQUENCE\"";
+public class SequenceIT extends ParallelStatsDisabledIT {
+private static final String SELECT_NEXT_VALUE_SQL = "SELECT NEXT VALUE FOR 
%s";
 private static final long BATCH_SIZE = 3;

 private Connection conn;
 
+private static String generateNameWithSchema() {
+   return SchemaUtil.getTableName(generateUniqueName(), 
generateUniqueName());
+}
+
 @BeforeClass
-@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class)
+@Shadower(classBeingShadowed = ParallelStatsDisabledIT.class)
 public static void doSetup() throws Exception {
-Map props = getDefaultProps();
-// Must update config before starting server
+Map props = Maps.newHashMap();
 props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, 
Long.toString(BATCH_SIZE));
 setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
 }
 
+@Before
+public void init() throws Exception {
+   createConnection();
+}
+
 @After
 public void tearDown() throws Exception {
 // close any open connection between tests, so that connections are 
not leaked
@@ -79,20 +90,21 @@ public class SequenceIT extends BaseClientManagedTimeIT {
 
@Test
public void testSystemTable() throws Exception {
-   nextConnection();
+   conn.createStatement().execute("CREATE SEQUENCE " + 
generateNameWithSchema());
String query = "SELECT sequence_schema, sequence_name, 
current_value, increment_by FROM \"SYSTEM\".\"SEQUENCE\"";
ResultSet rs = conn.prepareStatement(query).executeQuery();
-   assertFalse(rs.next());
+   assertTrue(rs.next());
}
 
@Test
public void testDuplicateSequences() throws Exception {
-nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE alpha.beta 
START WITH 2 INCREMENT BY 4\n");
+String sequenceName = generateNameWithSchema();
+
+
+   conn.createStatement().execute("CREATE SEQUENCE " + 
sequenceName + " START WITH 2 INCREMENT BY 4\n");
 
try {
-   nextConnection();
-   conn.createStatement().execute("CREATE SEQUENCE 
alpha.beta START WITH 2 INCREMENT BY 4\n");
+