[1/2] phoenix git commit: PHOENIX-2573 Pherf It test fails

2016-01-07 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 8d679084f -> 22d825766
  refs/heads/master 3f0a7566f -> 2b5863a51


PHOENIX-2573 Pherf It test fails


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

Branch: refs/heads/master
Commit: 2b5863a51dc7495573cbe78f2018b1891a3d3f70
Parents: 3f0a756
Author: Cody Marcel 
Authored: Thu Jan 7 12:19:02 2016 -0800
Committer: Cody Marcel 
Committed: Thu Jan 7 13:22:05 2016 -0800

--
 .../it/java/org/apache/phoenix/pherf/DataIngestIT.java  |  2 --
 .../java/org/apache/phoenix/pherf/SchemaReaderIT.java   | 12 +++-
 .../java/org/apache/phoenix/pherf/util/PhoenixUtil.java |  8 +---
 .../src/test/resources/datamodel/test_schema.sql|  4 ++--
 4 files changed, 10 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2b5863a5/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index e25b839..7b7ac29 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -62,7 +62,6 @@ public class DataIngestIT extends ResultBaseTestIT {
 }
 
 @Test
-@Ignore("Until PHOENIX-2573 is fixed")
 public void testColumnRulesApplied() {
 
 Scenario scenario = null;
@@ -115,7 +114,6 @@ public class DataIngestIT extends ResultBaseTestIT {
 }
 
 @Test
-@Ignore("Until PHOENIX-2573 is fixed")
 public void testRWWorkload() throws Exception {
 
 Connection connection = util.getConnection();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2b5863a5/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
index 7b4de79..4ff1fb5 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
@@ -26,6 +26,7 @@ import java.net.URL;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.sql.Connection;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -36,14 +37,12 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.schema.SchemaReader;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class SchemaReaderIT extends BaseHBaseManagedTimeIT {
 protected static PhoenixUtil util = PhoenixUtil.create(true);
 
 @Test 
-@Ignore("Until PHOENIX-2573 is fixed")
 public void testSchemaReader() {
 // Test for the unit test version of the schema files.
 assertApplySchemaTest();
@@ -57,10 +56,13 @@ public class SchemaReaderIT extends BaseHBaseManagedTimeIT {
 List resources = new ArrayList<>(reader.getResourceList());
 assertTrue("Could not pull list of schema files.", 
resources.size() > 0);
 assertNotNull("Could not read schema file.", 
this.getClass().getResourceAsStream(
-PherfConstants.RESOURCE_DATAMODEL + "/" + 
resources.get(0).getFileName()
-.toString()));
+PherfConstants.RESOURCE_DATAMODEL + "/" + 
resources.get(0).getFileName().toString()));
 assertNotNull("Could not read schema file.", 
reader.resourceToString(resources.get(0)));
-reader.applySchema();
+try {
+reader.applySchema();
+} catch (SQLException e) {
+fail("Failed to apply schema " + e.getMessage());
+}
 
 Connection connection = null;
 URL resourceUrl = 
getClass().getResource("/scenario/test_scenario.xml");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2b5863a5/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
index b778833..df18544 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/phe

[2/2] phoenix git commit: PHOENIX-2573 Pherf It test fails

2016-01-07 Thread codymarcel
PHOENIX-2573 Pherf It test fails


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 22d82576690399694cb7696bfd0e62c5a37119f5
Parents: 8d67908
Author: Cody Marcel 
Authored: Thu Jan 7 12:19:02 2016 -0800
Committer: Cody Marcel 
Committed: Thu Jan 7 13:23:09 2016 -0800

--
 .../it/java/org/apache/phoenix/pherf/DataIngestIT.java  |  2 --
 .../java/org/apache/phoenix/pherf/SchemaReaderIT.java   | 12 +++-
 .../java/org/apache/phoenix/pherf/util/PhoenixUtil.java |  8 +---
 .../src/test/resources/datamodel/test_schema.sql|  4 ++--
 4 files changed, 10 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index fced730..cb137ee 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -62,7 +62,6 @@ public class DataIngestIT extends ResultBaseTestIT {
 }
 
 @Test
-@Ignore("Until PHOENIX-2573 is fixed")
 public void testColumnRulesApplied() {
 
 Scenario scenario = null;
@@ -115,7 +114,6 @@ public class DataIngestIT extends ResultBaseTestIT {
 }
 
 @Test
-@Ignore("Until PHOENIX-2573 is fixed")
 public void testRWWorkload() throws Exception {
 
 Connection connection = util.getConnection();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
index 7b4de79..4ff1fb5 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/SchemaReaderIT.java
@@ -26,6 +26,7 @@ import java.net.URL;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.sql.Connection;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -36,14 +37,12 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.schema.SchemaReader;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class SchemaReaderIT extends BaseHBaseManagedTimeIT {
 protected static PhoenixUtil util = PhoenixUtil.create(true);
 
 @Test 
-@Ignore("Until PHOENIX-2573 is fixed")
 public void testSchemaReader() {
 // Test for the unit test version of the schema files.
 assertApplySchemaTest();
@@ -57,10 +56,13 @@ public class SchemaReaderIT extends BaseHBaseManagedTimeIT {
 List resources = new ArrayList<>(reader.getResourceList());
 assertTrue("Could not pull list of schema files.", 
resources.size() > 0);
 assertNotNull("Could not read schema file.", 
this.getClass().getResourceAsStream(
-PherfConstants.RESOURCE_DATAMODEL + "/" + 
resources.get(0).getFileName()
-.toString()));
+PherfConstants.RESOURCE_DATAMODEL + "/" + 
resources.get(0).getFileName().toString()));
 assertNotNull("Could not read schema file.", 
reader.resourceToString(resources.get(0)));
-reader.applySchema();
+try {
+reader.applySchema();
+} catch (SQLException e) {
+fail("Failed to apply schema " + e.getMessage());
+}
 
 Connection connection = null;
 URL resourceUrl = 
getClass().getResource("/scenario/test_scenario.xml");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/22d82576/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
index b778833..df18544 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
@@ -147,19 +147,13 @

[2/2] phoenix git commit: PHOENIX-2299 Added support for current date generation

2016-01-06 Thread codymarcel
PHOENIX-2299 Added support for current date generation


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

Branch: refs/heads/master
Commit: ddf24b5a06de0f9ec2a5cfb0aad8199306906aa4
Parents: 9357017
Author: Karan Singhal 
Authored: Wed Dec 23 19:10:01 2015 +0530
Committer: Cody Marcel 
Committed: Wed Jan 6 10:55:08 2016 -0800

--
 .../phoenix/pherf/configuration/Column.java | 10 +++
 .../apache/phoenix/pherf/rules/DataValue.java   | 11 
 .../phoenix/pherf/rules/RulesApplier.java   | 21 ++-
 .../phoenix/pherf/ConfigurationParserTest.java  | 16 +
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 66 
 .../test/resources/datamodel/test_schema.sql|  2 +
 .../test/resources/scenario/test_scenario.xml   | 27 
 7 files changed, 151 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ddf24b5a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
index a6b9d26..7c9e180 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
@@ -33,6 +33,7 @@ public class Column {
 private boolean userDefined;
 private List dataValues;
private DataTypeMapping type;
+private boolean useCurrentDate;
 
 public Column() {
 super();
@@ -44,6 +45,7 @@ public class Column {
 this.precision = Integer.MIN_VALUE;
 this.nullChance = Integer.MIN_VALUE;
 this.userDefined = false;
+this.useCurrentDate = false;
 }
 
 public Column(Column column) {
@@ -119,6 +121,10 @@ public class Column {
 this.precision = precision;
 }
 
+public void setUseCurrentDate(boolean useCurrentDate) { 
this.useCurrentDate = useCurrentDate; }
+
+public boolean getUseCurrentDate() { return useCurrentDate; }
+
 /**
  * Changes fields of this object to match existing fields from the passed 
Column
  * null object members are ignored.
@@ -167,6 +173,10 @@ public class Column {
 if (column.dataValues != null) {
setDataValues(column.getDataValues());
 }
+
+if(column.getUseCurrentDate()) {
+setUseCurrentDate(column.getUseCurrentDate());
+}
 }
 
 public int getNullChance() {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ddf24b5a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
index 9bfc0dd..8f5506f 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
@@ -28,6 +28,7 @@ public class DataValue {
 private String maxValue;
 private String minValue;
 private int distribution;
+private boolean useCurrentDate;
 
 public DataValue() {
 super();
@@ -37,6 +38,7 @@ public class DataValue {
 this.type = type;
 this.value = value;
 this.distribution = Integer.MIN_VALUE;
+this.useCurrentDate = false;
 }
 
 public DataValue(DataValue dataValue) {
@@ -44,6 +46,7 @@ public class DataValue {
 this.setDistribution(dataValue.getDistribution());
 this.setMinValue(dataValue.getMinValue());
 this.setMaxValue(dataValue.getMaxValue());
+this.setUseCurrentDate(dataValue.getUseCurrentDate());
 }
 
 public String getValue() {
@@ -86,4 +89,12 @@ public class DataValue {
 public void setMaxValue(String maxValue) {
 this.maxValue = maxValue;
 }
+
+public boolean getUseCurrentDate() {
+return useCurrentDate;
+}
+
+public void setUseCurrentDate(boolean useCurrentDate) {
+this.useCurrentDate = useCurrentDate;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ddf24b5a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 68791c

[1/2] phoenix git commit: PHOENIX-2299 Added support for current date generation

2016-01-06 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 d53792070 -> 6352fb71c
  refs/heads/master 935701778 -> ddf24b5a0


PHOENIX-2299 Added support for current date generation


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 6352fb71c615893aaac14e8ea81467749c3570c6
Parents: d537920
Author: Karan Singhal 
Authored: Wed Dec 23 19:10:01 2015 +0530
Committer: Cody Marcel 
Committed: Wed Jan 6 10:52:10 2016 -0800

--
 .../phoenix/pherf/configuration/Column.java | 10 +++
 .../apache/phoenix/pherf/rules/DataValue.java   | 11 
 .../phoenix/pherf/rules/RulesApplier.java   | 21 ++-
 .../phoenix/pherf/ConfigurationParserTest.java  | 16 +
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 66 
 .../test/resources/datamodel/test_schema.sql|  2 +
 .../test/resources/scenario/test_scenario.xml   | 27 
 7 files changed, 151 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6352fb71/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
index a6b9d26..7c9e180 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
@@ -33,6 +33,7 @@ public class Column {
 private boolean userDefined;
 private List dataValues;
private DataTypeMapping type;
+private boolean useCurrentDate;
 
 public Column() {
 super();
@@ -44,6 +45,7 @@ public class Column {
 this.precision = Integer.MIN_VALUE;
 this.nullChance = Integer.MIN_VALUE;
 this.userDefined = false;
+this.useCurrentDate = false;
 }
 
 public Column(Column column) {
@@ -119,6 +121,10 @@ public class Column {
 this.precision = precision;
 }
 
+public void setUseCurrentDate(boolean useCurrentDate) { 
this.useCurrentDate = useCurrentDate; }
+
+public boolean getUseCurrentDate() { return useCurrentDate; }
+
 /**
  * Changes fields of this object to match existing fields from the passed 
Column
  * null object members are ignored.
@@ -167,6 +173,10 @@ public class Column {
 if (column.dataValues != null) {
setDataValues(column.getDataValues());
 }
+
+if(column.getUseCurrentDate()) {
+setUseCurrentDate(column.getUseCurrentDate());
+}
 }
 
 public int getNullChance() {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6352fb71/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
index 9bfc0dd..8f5506f 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/DataValue.java
@@ -28,6 +28,7 @@ public class DataValue {
 private String maxValue;
 private String minValue;
 private int distribution;
+private boolean useCurrentDate;
 
 public DataValue() {
 super();
@@ -37,6 +38,7 @@ public class DataValue {
 this.type = type;
 this.value = value;
 this.distribution = Integer.MIN_VALUE;
+this.useCurrentDate = false;
 }
 
 public DataValue(DataValue dataValue) {
@@ -44,6 +46,7 @@ public class DataValue {
 this.setDistribution(dataValue.getDistribution());
 this.setMinValue(dataValue.getMinValue());
 this.setMaxValue(dataValue.getMaxValue());
+this.setUseCurrentDate(dataValue.getUseCurrentDate());
 }
 
 public String getValue() {
@@ -86,4 +89,12 @@ public class DataValue {
 public void setMaxValue(String maxValue) {
 this.maxValue = maxValue;
 }
+
+public boolean getUseCurrentDate() {
+return useCurrentDate;
+}
+
+public void setUseCurrentDate(boolean useCurrentDate) {
+this.useCurrentDate = useCurrentDate;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6352fb71/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java

phoenix git commit: PHOENIX-2529 Fixed date generation pattern [Forced Update!]

2016-01-06 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 7133294c9 -> d53792070 (forced update)
  refs/heads/4.x-HBase-1.0 5fb51ca5e -> 3e798008d (forced update)


PHOENIX-2529 Fixed date generation pattern


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

Branch: refs/heads/4.x-HBase-0.98
Commit: d53792070c55e60d38048a199c54b1100cba4913
Parents: b0f87aa
Author: Karan Singhal 
Authored: Wed Dec 23 16:21:09 2015 +0530
Committer: Cody Marcel 
Committed: Wed Jan 6 10:49:14 2016 -0800

--
 .../apache/phoenix/pherf/PherfConstants.java|  5 ++-
 .../phoenix/pherf/rules/RulesApplier.java   | 47 ++--
 .../test/resources/scenario/test_scenario.xml   |  6 +--
 3 files changed, 40 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d5379207/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
index c3a1200..42b5d21 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
@@ -18,6 +18,8 @@
 
 package org.apache.phoenix.pherf;
 
+import org.joda.time.DateTimeZone;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
@@ -38,7 +40,8 @@ public class PherfConstants {
 
 public static final int DEFAULT_THREAD_POOL_SIZE = 10;
 public static final int DEFAULT_BATCH_SIZE = 1000;
-public static final String DEFAULT_DATE_PATTERN = "-MM-dd 
HH:mm:ss.SSS";
+public static final String DEFAULT_DATE_PATTERN = "-MM-dd HH:mm:ss.SSS 
z";
+public static final DateTimeZone DEFAULT_TIME_ZONE = DateTimeZone.UTC;
 public static final String RESOURCE_SCENARIO = "/scenario";
 public static final String
 SCENARIO_ROOT_PATTERN =

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d5379207/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 2b1689a..68791ce 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
@@ -196,6 +196,8 @@ public class RulesApplier {
 case DATE:
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
 data = pickDataValueFromList(dataValues);
+// Check if date has right format or not
+data.setValue(checkDatePattern(data.getValue()));
 } else {
 int minYear = column.getMinValue();
 int maxYear = column.getMaxValue();
@@ -203,6 +205,8 @@ public class RulesApplier {
 
 String dt = generateRandomDate(minYear, maxYear);
 data = new DataValue(column.getType(), dt);
+data.setMaxValue(String.valueOf(minYear));
+data.setMinValue(String.valueOf(maxYear));
 }
 break;
 default:
@@ -213,28 +217,26 @@ public class RulesApplier {
 return data;
 }
 
-public String generateRandomDate(int min, int max) {
-int year = RandomUtils.nextInt(min, max);
-int month = RandomUtils.nextInt(0, 11);
-int day = RandomUtils.nextInt(0, 31);
-Calendar calendar = Calendar.getInstance();
-calendar.set(Calendar.YEAR, year);
-calendar.set(Calendar.MONTH, month);
-calendar.set(Calendar.DAY_OF_MONTH, day);
-SimpleDateFormat df = new SimpleDateFormat("-MM-dd HH:mm:ss.SSS 
z");
-
-return df.format(calendar.getTime());
+// Convert years into standard date format -MM-dd HH:mm:ss.SSS z
+public String generateRandomDate(int min, int max) throws Exception {
+String mindt = min + "-01-01 00:00:00.000"; // set min date as 
starting of min year
+String maxdt = max + "-12-31 23:59:59.999"; // set max date as end of 
max year
+return generateRandomDate(mindt, maxdt);
 }
 
 public String generateRandomDate(String min, String max) throws Exception {
 DateTimeFormatter fmtr = 
DateTimeFormat.forPattern(PherfC

phoenix git commit: PHOENIX-2529 Fixed date generation pattern

2016-01-06 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 3f9d5a87e -> 935701778


PHOENIX-2529 Fixed date generation pattern


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

Branch: refs/heads/master
Commit: 9357017787cdd721f42a4448902acc20514ee7fd
Parents: 3f9d5a8
Author: Karan Singhal 
Authored: Wed Dec 23 16:21:09 2015 +0530
Committer: Cody Marcel 
Committed: Wed Jan 6 10:33:34 2016 -0800

--
 .../apache/phoenix/pherf/PherfConstants.java|  5 ++-
 .../phoenix/pherf/rules/RulesApplier.java   | 47 ++--
 .../test/resources/scenario/test_scenario.xml   |  6 +--
 3 files changed, 40 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/93570177/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
index c3a1200..42b5d21 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
@@ -18,6 +18,8 @@
 
 package org.apache.phoenix.pherf;
 
+import org.joda.time.DateTimeZone;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
@@ -38,7 +40,8 @@ public class PherfConstants {
 
 public static final int DEFAULT_THREAD_POOL_SIZE = 10;
 public static final int DEFAULT_BATCH_SIZE = 1000;
-public static final String DEFAULT_DATE_PATTERN = "-MM-dd 
HH:mm:ss.SSS";
+public static final String DEFAULT_DATE_PATTERN = "-MM-dd HH:mm:ss.SSS 
z";
+public static final DateTimeZone DEFAULT_TIME_ZONE = DateTimeZone.UTC;
 public static final String RESOURCE_SCENARIO = "/scenario";
 public static final String
 SCENARIO_ROOT_PATTERN =

http://git-wip-us.apache.org/repos/asf/phoenix/blob/93570177/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 2b1689a..68791ce 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
@@ -196,6 +196,8 @@ public class RulesApplier {
 case DATE:
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
 data = pickDataValueFromList(dataValues);
+// Check if date has right format or not
+data.setValue(checkDatePattern(data.getValue()));
 } else {
 int minYear = column.getMinValue();
 int maxYear = column.getMaxValue();
@@ -203,6 +205,8 @@ public class RulesApplier {
 
 String dt = generateRandomDate(minYear, maxYear);
 data = new DataValue(column.getType(), dt);
+data.setMaxValue(String.valueOf(minYear));
+data.setMinValue(String.valueOf(maxYear));
 }
 break;
 default:
@@ -213,28 +217,26 @@ public class RulesApplier {
 return data;
 }
 
-public String generateRandomDate(int min, int max) {
-int year = RandomUtils.nextInt(min, max);
-int month = RandomUtils.nextInt(0, 11);
-int day = RandomUtils.nextInt(0, 31);
-Calendar calendar = Calendar.getInstance();
-calendar.set(Calendar.YEAR, year);
-calendar.set(Calendar.MONTH, month);
-calendar.set(Calendar.DAY_OF_MONTH, day);
-SimpleDateFormat df = new SimpleDateFormat("-MM-dd HH:mm:ss.SSS 
z");
-
-return df.format(calendar.getTime());
+// Convert years into standard date format -MM-dd HH:mm:ss.SSS z
+public String generateRandomDate(int min, int max) throws Exception {
+String mindt = min + "-01-01 00:00:00.000"; // set min date as 
starting of min year
+String maxdt = max + "-12-31 23:59:59.999"; // set max date as end of 
max year
+return generateRandomDate(mindt, maxdt);
 }
 
 public String generateRandomDate(String min, String max) throws Exception {
 DateTimeFormatter fmtr = 
DateTimeFormat.forPattern(PherfConstants.DEFAULT_DATE_PATTERN);
-DateTime minDt = fmtr.parseDateTime(min);
-DateTi

phoenix git commit: Fixed date generation pattern

2016-01-06 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 b0f87aaf4 -> 7133294c9


Fixed date generation pattern


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 7133294c91b07ee65ebd23d91e56527350684f3c
Parents: b0f87aa
Author: Karan Singhal 
Authored: Wed Dec 23 16:21:09 2015 +0530
Committer: Cody Marcel 
Committed: Wed Jan 6 10:17:52 2016 -0800

--
 .../apache/phoenix/pherf/PherfConstants.java|  5 ++-
 .../phoenix/pherf/rules/RulesApplier.java   | 47 ++--
 .../test/resources/scenario/test_scenario.xml   |  6 +--
 3 files changed, 40 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7133294c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
index c3a1200..42b5d21 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
@@ -18,6 +18,8 @@
 
 package org.apache.phoenix.pherf;
 
+import org.joda.time.DateTimeZone;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
@@ -38,7 +40,8 @@ public class PherfConstants {
 
 public static final int DEFAULT_THREAD_POOL_SIZE = 10;
 public static final int DEFAULT_BATCH_SIZE = 1000;
-public static final String DEFAULT_DATE_PATTERN = "-MM-dd 
HH:mm:ss.SSS";
+public static final String DEFAULT_DATE_PATTERN = "-MM-dd HH:mm:ss.SSS 
z";
+public static final DateTimeZone DEFAULT_TIME_ZONE = DateTimeZone.UTC;
 public static final String RESOURCE_SCENARIO = "/scenario";
 public static final String
 SCENARIO_ROOT_PATTERN =

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7133294c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 2b1689a..68791ce 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
@@ -196,6 +196,8 @@ public class RulesApplier {
 case DATE:
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
 data = pickDataValueFromList(dataValues);
+// Check if date has right format or not
+data.setValue(checkDatePattern(data.getValue()));
 } else {
 int minYear = column.getMinValue();
 int maxYear = column.getMaxValue();
@@ -203,6 +205,8 @@ public class RulesApplier {
 
 String dt = generateRandomDate(minYear, maxYear);
 data = new DataValue(column.getType(), dt);
+data.setMaxValue(String.valueOf(minYear));
+data.setMinValue(String.valueOf(maxYear));
 }
 break;
 default:
@@ -213,28 +217,26 @@ public class RulesApplier {
 return data;
 }
 
-public String generateRandomDate(int min, int max) {
-int year = RandomUtils.nextInt(min, max);
-int month = RandomUtils.nextInt(0, 11);
-int day = RandomUtils.nextInt(0, 31);
-Calendar calendar = Calendar.getInstance();
-calendar.set(Calendar.YEAR, year);
-calendar.set(Calendar.MONTH, month);
-calendar.set(Calendar.DAY_OF_MONTH, day);
-SimpleDateFormat df = new SimpleDateFormat("-MM-dd HH:mm:ss.SSS 
z");
-
-return df.format(calendar.getTime());
+// Convert years into standard date format -MM-dd HH:mm:ss.SSS z
+public String generateRandomDate(int min, int max) throws Exception {
+String mindt = min + "-01-01 00:00:00.000"; // set min date as 
starting of min year
+String maxdt = max + "-12-31 23:59:59.999"; // set max date as end of 
max year
+return generateRandomDate(mindt, maxdt);
 }
 
 public String generateRandomDate(String min, String max) throws Exception {
 DateTimeFormatter fmtr = 
DateTimeFormat.forPattern(PherfConstants.DEFAULT_DATE_PATTERN);
-DateTime minDt = fmtr.parseDateTime(min);
-Dat

phoenix git commit: PHOENIX-2366 - Pherf NPE on Data loader

2015-11-02 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 b8c1d6cea -> 3e798008d


PHOENIX-2366 - Pherf NPE on Data loader


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 3e798008dee23492bb1165226ce432a468a77dad
Parents: b8c1d6c
Author: Cody Marcel 
Authored: Mon Nov 2 16:15:02 2015 -0800
Committer: Cody Marcel 
Committed: Mon Nov 2 16:47:51 2015 -0800

--
 .../java/org/apache/phoenix/pherf/PherfConstants.java | 10 +-
 .../java/org/apache/phoenix/pherf/result/ResultUtil.java  |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3e798008/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
index 3acf5a5..3d504fd 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
@@ -78,12 +78,20 @@ public class PherfConstants {
 return instance;
 }
 
+/**
+ * Get a {@link Properties} object based on the file name
+ * @param fileName  Name of the file
+ * @param getDefaultTrue if you want to use the properties that may 
have been loaded into
+ *  the instance. use false if you want to reload the 
passed file.
+ * @return {@link Properties}
+ * @throws Exception
+ */
 public Properties getProperties(final String fileName, boolean getDefault) 
throws Exception {
 
 if (instanceProperties == null) {
 instanceProperties = loadProperties(fileName);
 } else {
-return getDefault ? loadProperties(fileName) : instanceProperties;
+return getDefault ? instanceProperties : loadProperties(fileName);
 }
 
 return instanceProperties;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3e798008/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index 04e6197..d16a2f9 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -51,8 +51,8 @@ public class ResultUtil {
 try {
 if (!dataLoadThreadTime.getThreadTime().isEmpty()) {
 writer = new CSVFileResultHandler();
-writer.setResultFileName("Data_Load_Details");
 writer.setResultFileDetails(ResultFileDetails.CSV);
+writer.setResultFileName("Data_Load_Details");
 
 for (WriteThreadTime writeThreadTime : 
dataLoadThreadTime.getThreadTime()) {
 List rowValues = new ArrayList<>();
@@ -86,8 +86,8 @@ public class ResultUtil {
 ResultFileDetails resultFileDetails = 
ResultFileDetails.CSV_AGGREGATE_DATA_LOAD;
 try {
 writer = new CSVFileResultHandler();
-writer.setResultFileName("Data_Load_Summary");
 writer.setResultFileDetails(resultFileDetails);
+writer.setResultFileName("Data_Load_Summary");
 
 for (TableLoadTime loadTime : dataLoadTime.getTableLoadTime()) {
 List rowValues = new ArrayList<>();



phoenix git commit: PHOENIX-2366 - Pherf NPE on Data loader

2015-11-02 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master c26cce503 -> a9a9b24c9


PHOENIX-2366 - Pherf NPE on Data loader


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

Branch: refs/heads/master
Commit: a9a9b24c904997b13fe966a9972793f1224a3564
Parents: c26cce5
Author: Cody Marcel 
Authored: Mon Nov 2 16:15:02 2015 -0800
Committer: Cody Marcel 
Committed: Mon Nov 2 16:46:45 2015 -0800

--
 .../java/org/apache/phoenix/pherf/PherfConstants.java | 10 +-
 .../java/org/apache/phoenix/pherf/result/ResultUtil.java  |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9a9b24c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
index 3acf5a5..3d504fd 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
@@ -78,12 +78,20 @@ public class PherfConstants {
 return instance;
 }
 
+/**
+ * Get a {@link Properties} object based on the file name
+ * @param fileName  Name of the file
+ * @param getDefaultTrue if you want to use the properties that may 
have been loaded into
+ *  the instance. use false if you want to reload the 
passed file.
+ * @return {@link Properties}
+ * @throws Exception
+ */
 public Properties getProperties(final String fileName, boolean getDefault) 
throws Exception {
 
 if (instanceProperties == null) {
 instanceProperties = loadProperties(fileName);
 } else {
-return getDefault ? loadProperties(fileName) : instanceProperties;
+return getDefault ? instanceProperties : loadProperties(fileName);
 }
 
 return instanceProperties;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9a9b24c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index 04e6197..d16a2f9 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -51,8 +51,8 @@ public class ResultUtil {
 try {
 if (!dataLoadThreadTime.getThreadTime().isEmpty()) {
 writer = new CSVFileResultHandler();
-writer.setResultFileName("Data_Load_Details");
 writer.setResultFileDetails(ResultFileDetails.CSV);
+writer.setResultFileName("Data_Load_Details");
 
 for (WriteThreadTime writeThreadTime : 
dataLoadThreadTime.getThreadTime()) {
 List rowValues = new ArrayList<>();
@@ -86,8 +86,8 @@ public class ResultUtil {
 ResultFileDetails resultFileDetails = 
ResultFileDetails.CSV_AGGREGATE_DATA_LOAD;
 try {
 writer = new CSVFileResultHandler();
-writer.setResultFileName("Data_Load_Summary");
 writer.setResultFileDetails(resultFileDetails);
+writer.setResultFileName("Data_Load_Summary");
 
 for (TableLoadTime loadTime : dataLoadTime.getTableLoadTime()) {
 List rowValues = new ArrayList<>();



phoenix git commit: PHOENIX-2366 - Pherf NPE on Data loader

2015-11-02 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 b8f7fac10 -> e7cdb9a5d


PHOENIX-2366 - Pherf NPE on Data loader


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

Branch: refs/heads/4.x-HBase-0.98
Commit: e7cdb9a5deec3cfe37c42b719c51312aa2666e37
Parents: b8f7fac
Author: Cody Marcel 
Authored: Mon Nov 2 16:15:02 2015 -0800
Committer: Cody Marcel 
Committed: Mon Nov 2 16:18:48 2015 -0800

--
 .../java/org/apache/phoenix/pherf/PherfConstants.java | 10 +-
 .../java/org/apache/phoenix/pherf/result/ResultUtil.java  |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e7cdb9a5/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
index 3acf5a5..3d504fd 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/PherfConstants.java
@@ -78,12 +78,20 @@ public class PherfConstants {
 return instance;
 }
 
+/**
+ * Get a {@link Properties} object based on the file name
+ * @param fileName  Name of the file
+ * @param getDefaultTrue if you want to use the properties that may 
have been loaded into
+ *  the instance. use false if you want to reload the 
passed file.
+ * @return {@link Properties}
+ * @throws Exception
+ */
 public Properties getProperties(final String fileName, boolean getDefault) 
throws Exception {
 
 if (instanceProperties == null) {
 instanceProperties = loadProperties(fileName);
 } else {
-return getDefault ? loadProperties(fileName) : instanceProperties;
+return getDefault ? instanceProperties : loadProperties(fileName);
 }
 
 return instanceProperties;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e7cdb9a5/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index 04e6197..d16a2f9 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -51,8 +51,8 @@ public class ResultUtil {
 try {
 if (!dataLoadThreadTime.getThreadTime().isEmpty()) {
 writer = new CSVFileResultHandler();
-writer.setResultFileName("Data_Load_Details");
 writer.setResultFileDetails(ResultFileDetails.CSV);
+writer.setResultFileName("Data_Load_Details");
 
 for (WriteThreadTime writeThreadTime : 
dataLoadThreadTime.getThreadTime()) {
 List rowValues = new ArrayList<>();
@@ -86,8 +86,8 @@ public class ResultUtil {
 ResultFileDetails resultFileDetails = 
ResultFileDetails.CSV_AGGREGATE_DATA_LOAD;
 try {
 writer = new CSVFileResultHandler();
-writer.setResultFileName("Data_Load_Summary");
 writer.setResultFileDetails(resultFileDetails);
+writer.setResultFileName("Data_Load_Summary");
 
 for (TableLoadTime loadTime : dataLoadTime.getTableLoadTime()) {
 List rowValues = new ArrayList<>();



phoenix git commit: PHOENIX-2345 - Pherf - ResultManager does not flush

2015-10-22 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 789c96c46 -> 606983425


PHOENIX-2345 - Pherf - ResultManager does not flush


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 6069834254d6ba4c88a2e1786ae9ed9c22a5397f
Parents: 789c96c
Author: cmarcel 
Authored: Thu Oct 22 12:46:31 2015 -0700
Committer: cmarcel 
Committed: Thu Oct 22 15:28:54 2015 -0700

--
 .../phoenix/pherf/result/ResultManager.java | 20 
 .../pherf/workload/MultiThreadedRunner.java |  4 
 .../phoenix/pherf/workload/QueryExecutor.java   |  1 +
 .../org/apache/phoenix/pherf/ResultTest.java|  1 +
 4 files changed, 26 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/60698342/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index f994621..4d4ca4a 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -24,11 +24,15 @@ import 
org.apache.phoenix.pherf.result.impl.CSVFileResultHandler;
 import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
 import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.util.InstanceResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class ResultManager {
+private static final Logger logger = 
LoggerFactory.getLogger(ResultManager.class);
+
 private final List resultHandlers;
 private final ResultUtil util;
 private static final List defaultHandlers;
@@ -134,6 +138,22 @@ public class ResultManager {
 }
 }
 
+/**
+ * Allows for flushing all the {@link 
org.apache.phoenix.pherf.result.ResultHandler}
+ * @throws Exception
+ */
+public synchronized void flush(){
+for (ResultHandler handler : resultHandlers) {
+try {
+handler.flush();
+} catch (Exception e) {
+e.printStackTrace();
+logger.warn("Could not flush handler: "
++ handler.getResultFileName() + " : " + 
e.getMessage());
+}
+}
+}
+
 public List getResultHandlers() {
 return resultHandlers;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/60698342/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
index de6cdaf..24c68dc 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
@@ -89,6 +89,10 @@ class MultiThreadedRunner implements Runnable {
 e.printStackTrace();
 }
 }
+
+// Make sure all result have been dumped before exiting
+resultManager.flush();
+
 logger.info("\n\nThread exiting." + threadName + "\n\n");
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/60698342/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 347e203..7f861f1 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -169,6 +169,7 @@ public class QueryExecutor implements Workload {
 resultManager.write(dataModelResult);
 }
 resultManager.write(dataModelResults);
+resultManager.flush();
 } catch (Exception e) {
 logger.warn("", e);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/60698342/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
--

phoenix git commit: PHOENIX-2345 - Pherf - ResultManager does not flush

2015-10-22 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 eb4cb9962 -> c804aa825


PHOENIX-2345 - Pherf - ResultManager does not flush


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

Branch: refs/heads/4.x-HBase-0.98
Commit: c804aa8253be193c1e02b0632c1d0b1d9330b191
Parents: eb4cb99
Author: cmarcel 
Authored: Thu Oct 22 12:46:31 2015 -0700
Committer: cmarcel 
Committed: Thu Oct 22 15:27:54 2015 -0700

--
 .../phoenix/pherf/result/ResultManager.java | 20 
 .../pherf/workload/MultiThreadedRunner.java |  4 
 .../phoenix/pherf/workload/QueryExecutor.java   |  1 +
 .../org/apache/phoenix/pherf/ResultTest.java|  1 +
 4 files changed, 26 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c804aa82/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index f994621..4d4ca4a 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -24,11 +24,15 @@ import 
org.apache.phoenix.pherf.result.impl.CSVFileResultHandler;
 import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
 import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.util.InstanceResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class ResultManager {
+private static final Logger logger = 
LoggerFactory.getLogger(ResultManager.class);
+
 private final List resultHandlers;
 private final ResultUtil util;
 private static final List defaultHandlers;
@@ -134,6 +138,22 @@ public class ResultManager {
 }
 }
 
+/**
+ * Allows for flushing all the {@link 
org.apache.phoenix.pherf.result.ResultHandler}
+ * @throws Exception
+ */
+public synchronized void flush(){
+for (ResultHandler handler : resultHandlers) {
+try {
+handler.flush();
+} catch (Exception e) {
+e.printStackTrace();
+logger.warn("Could not flush handler: "
++ handler.getResultFileName() + " : " + 
e.getMessage());
+}
+}
+}
+
 public List getResultHandlers() {
 return resultHandlers;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c804aa82/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
index de6cdaf..24c68dc 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
@@ -89,6 +89,10 @@ class MultiThreadedRunner implements Runnable {
 e.printStackTrace();
 }
 }
+
+// Make sure all result have been dumped before exiting
+resultManager.flush();
+
 logger.info("\n\nThread exiting." + threadName + "\n\n");
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c804aa82/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 347e203..7f861f1 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -169,6 +169,7 @@ public class QueryExecutor implements Workload {
 resultManager.write(dataModelResult);
 }
 resultManager.write(dataModelResults);
+resultManager.flush();
 } catch (Exception e) {
 logger.warn("", e);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c804aa82/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java

phoenix git commit: PHOENIX-2345 - Pherf - ResultManager does not flush

2015-10-22 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master caa0dbb46 -> 3cbebb8bd


PHOENIX-2345 - Pherf - ResultManager does not flush


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

Branch: refs/heads/master
Commit: 3cbebb8bdb373cc0ac5cb5be0b70b0a5ce061d90
Parents: caa0dbb
Author: cmarcel 
Authored: Thu Oct 22 12:46:31 2015 -0700
Committer: cmarcel 
Committed: Thu Oct 22 15:25:39 2015 -0700

--
 .../phoenix/pherf/result/ResultManager.java | 20 
 .../pherf/workload/MultiThreadedRunner.java |  4 
 .../phoenix/pherf/workload/QueryExecutor.java   |  1 +
 .../org/apache/phoenix/pherf/ResultTest.java|  1 +
 4 files changed, 26 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cbebb8b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index f994621..4d4ca4a 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -24,11 +24,15 @@ import 
org.apache.phoenix.pherf.result.impl.CSVFileResultHandler;
 import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
 import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.util.InstanceResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class ResultManager {
+private static final Logger logger = 
LoggerFactory.getLogger(ResultManager.class);
+
 private final List resultHandlers;
 private final ResultUtil util;
 private static final List defaultHandlers;
@@ -134,6 +138,22 @@ public class ResultManager {
 }
 }
 
+/**
+ * Allows for flushing all the {@link 
org.apache.phoenix.pherf.result.ResultHandler}
+ * @throws Exception
+ */
+public synchronized void flush(){
+for (ResultHandler handler : resultHandlers) {
+try {
+handler.flush();
+} catch (Exception e) {
+e.printStackTrace();
+logger.warn("Could not flush handler: "
++ handler.getResultFileName() + " : " + 
e.getMessage());
+}
+}
+}
+
 public List getResultHandlers() {
 return resultHandlers;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cbebb8b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
index de6cdaf..24c68dc 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultiThreadedRunner.java
@@ -89,6 +89,10 @@ class MultiThreadedRunner implements Runnable {
 e.printStackTrace();
 }
 }
+
+// Make sure all result have been dumped before exiting
+resultManager.flush();
+
 logger.info("\n\nThread exiting." + threadName + "\n\n");
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cbebb8b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 347e203..7f861f1 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -169,6 +169,7 @@ public class QueryExecutor implements Workload {
 resultManager.write(dataModelResult);
 }
 resultManager.write(dataModelResults);
+resultManager.flush();
 } catch (Exception e) {
 logger.warn("", e);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cbebb8b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java

phoenix git commit: PHOENIX-2337 - Pherf - Prefix values override rule values for writes

2015-10-20 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 60ef35e45 -> 789c96c46


PHOENIX-2337 - Pherf - Prefix values override rule values for writes


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 789c96c46c870c907eaa9145f157a28e4b1ce37e
Parents: 60ef35e
Author: Cody Marcel 
Authored: Mon Oct 19 13:25:15 2015 -0700
Committer: Cody Marcel 
Committed: Tue Oct 20 13:58:23 2015 -0700

--
 .../phoenix/pherf/rules/RulesApplier.java   | 70 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 23 +++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 51 --
 .../test/resources/datamodel/test_schema.sql|  1 +
 .../test/resources/scenario/test_scenario.xml   | 14 +++-
 5 files changed, 116 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/789c96c4/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 4801081..06a046d 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
@@ -19,6 +19,7 @@
 package org.apache.phoenix.pherf.rules;
 
 import com.google.common.base.Preconditions;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.math3.random.RandomDataGenerator;
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.commons.lang.RandomStringUtils;
@@ -97,13 +98,6 @@ public class RulesApplier {
 Column columnRule = getColumnForRule(ruleList, phxMetaColumn);
 
 value = getDataValue(columnRule);
-synchronized (value) {
-// Add the prefix to the value if it exists.
-if (columnRule.getPrefix() != null) {
-value.setValue(columnRule.getPrefix() + 
value.getValue());
-}
-}
-
 } else {
 logger.warn("Attempted to apply rule to data, but could not 
find a rule to match type:"
 + phxMetaColumn.getType()
@@ -122,46 +116,55 @@ public class RulesApplier {
  */
 public DataValue getDataValue(Column column) throws Exception{
 DataValue data = null;
+String prefix = "";
 int length = column.getLength();
 int nullChance = column.getNullChance();
 List dataValues = column.getDataValues();
 
-// Return an empty value if we we fall within the configured 
probability
+// Return an empty value if we fall within the configured probability 
of null
 if ((nullChance != Integer.MIN_VALUE) && (isValueNull(nullChance))) {
 return new DataValue(column.getType(), "");
 }
 
+if (column.getPrefix() != null) {
+prefix = column.getPrefix();
+}
+
+if (prefix.length() >= length) {
+logger.warn("You are attempting to generate data with a prefix (" 
+ prefix + ") "
++ "That is longer than expected overall field length (" + 
length + "). "
++ "This will certainly lead to unexpected data values.");
+}
+
 switch (column.getType()) {
 case VARCHAR:
 // Use the specified data values from configs if they exist
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
-data = generateDataValue(dataValues);
+data = pickDataValueFromList(dataValues);
 } else {
 Preconditions.checkArgument(length > 0, "length needs to 
be > 0");
 if (column.getDataSequence() == DataSequence.SEQUENTIAL) {
 data = getSequentialDataValue(column);
 } else {
-String varchar = 
RandomStringUtils.randomAlphanumeric(length);
-data = new DataValue(column.getType(), varchar);
+data = getRandomDataValue(column);
 }
 }
 break;
 case CHAR:
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
-data = generateDataValue(dataValues);
+data = pickDataValueFromList(dataValues);

phoenix git commit: PHOENIX-2337 - Pherf - Prefix values override rule values for writes

2015-10-20 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 ac2d04481 -> eb4cb9962


PHOENIX-2337 - Pherf - Prefix values override rule values for writes


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

Branch: refs/heads/4.x-HBase-0.98
Commit: eb4cb99629276cbca6bbe7ce0d292484a8edca4b
Parents: ac2d044
Author: Cody Marcel 
Authored: Mon Oct 19 13:25:15 2015 -0700
Committer: Cody Marcel 
Committed: Tue Oct 20 13:57:33 2015 -0700

--
 .../phoenix/pherf/rules/RulesApplier.java   | 70 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 23 +++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 51 --
 .../test/resources/datamodel/test_schema.sql|  1 +
 .../test/resources/scenario/test_scenario.xml   | 14 +++-
 5 files changed, 116 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/eb4cb996/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 4801081..06a046d 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
@@ -19,6 +19,7 @@
 package org.apache.phoenix.pherf.rules;
 
 import com.google.common.base.Preconditions;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.math3.random.RandomDataGenerator;
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.commons.lang.RandomStringUtils;
@@ -97,13 +98,6 @@ public class RulesApplier {
 Column columnRule = getColumnForRule(ruleList, phxMetaColumn);
 
 value = getDataValue(columnRule);
-synchronized (value) {
-// Add the prefix to the value if it exists.
-if (columnRule.getPrefix() != null) {
-value.setValue(columnRule.getPrefix() + 
value.getValue());
-}
-}
-
 } else {
 logger.warn("Attempted to apply rule to data, but could not 
find a rule to match type:"
 + phxMetaColumn.getType()
@@ -122,46 +116,55 @@ public class RulesApplier {
  */
 public DataValue getDataValue(Column column) throws Exception{
 DataValue data = null;
+String prefix = "";
 int length = column.getLength();
 int nullChance = column.getNullChance();
 List dataValues = column.getDataValues();
 
-// Return an empty value if we we fall within the configured 
probability
+// Return an empty value if we fall within the configured probability 
of null
 if ((nullChance != Integer.MIN_VALUE) && (isValueNull(nullChance))) {
 return new DataValue(column.getType(), "");
 }
 
+if (column.getPrefix() != null) {
+prefix = column.getPrefix();
+}
+
+if (prefix.length() >= length) {
+logger.warn("You are attempting to generate data with a prefix (" 
+ prefix + ") "
++ "That is longer than expected overall field length (" + 
length + "). "
++ "This will certainly lead to unexpected data values.");
+}
+
 switch (column.getType()) {
 case VARCHAR:
 // Use the specified data values from configs if they exist
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
-data = generateDataValue(dataValues);
+data = pickDataValueFromList(dataValues);
 } else {
 Preconditions.checkArgument(length > 0, "length needs to 
be > 0");
 if (column.getDataSequence() == DataSequence.SEQUENTIAL) {
 data = getSequentialDataValue(column);
 } else {
-String varchar = 
RandomStringUtils.randomAlphanumeric(length);
-data = new DataValue(column.getType(), varchar);
+data = getRandomDataValue(column);
 }
 }
 break;
 case CHAR:
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
-data = generateDataValue(dataValues);
+data = pickDataValueFromList(dataValues);
  

phoenix git commit: PHOENIX-2337 - Pherf - Prefix values override rule values for writes

2015-10-20 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 28007f804 -> caa0dbb46


PHOENIX-2337 - Pherf - Prefix values override rule values for writes


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

Branch: refs/heads/master
Commit: caa0dbb46a47945eaa384b31f7a2ba8e9c7a6c08
Parents: 28007f8
Author: Cody Marcel 
Authored: Mon Oct 19 13:25:15 2015 -0700
Committer: Cody Marcel 
Committed: Tue Oct 20 13:55:12 2015 -0700

--
 .../phoenix/pherf/rules/RulesApplier.java   | 70 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 23 +++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 51 --
 .../test/resources/datamodel/test_schema.sql|  1 +
 .../test/resources/scenario/test_scenario.xml   | 14 +++-
 5 files changed, 116 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/caa0dbb4/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
index 4801081..06a046d 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/rules/RulesApplier.java
@@ -19,6 +19,7 @@
 package org.apache.phoenix.pherf.rules;
 
 import com.google.common.base.Preconditions;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.math3.random.RandomDataGenerator;
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.commons.lang.RandomStringUtils;
@@ -97,13 +98,6 @@ public class RulesApplier {
 Column columnRule = getColumnForRule(ruleList, phxMetaColumn);
 
 value = getDataValue(columnRule);
-synchronized (value) {
-// Add the prefix to the value if it exists.
-if (columnRule.getPrefix() != null) {
-value.setValue(columnRule.getPrefix() + 
value.getValue());
-}
-}
-
 } else {
 logger.warn("Attempted to apply rule to data, but could not 
find a rule to match type:"
 + phxMetaColumn.getType()
@@ -122,46 +116,55 @@ public class RulesApplier {
  */
 public DataValue getDataValue(Column column) throws Exception{
 DataValue data = null;
+String prefix = "";
 int length = column.getLength();
 int nullChance = column.getNullChance();
 List dataValues = column.getDataValues();
 
-// Return an empty value if we we fall within the configured 
probability
+// Return an empty value if we fall within the configured probability 
of null
 if ((nullChance != Integer.MIN_VALUE) && (isValueNull(nullChance))) {
 return new DataValue(column.getType(), "");
 }
 
+if (column.getPrefix() != null) {
+prefix = column.getPrefix();
+}
+
+if (prefix.length() >= length) {
+logger.warn("You are attempting to generate data with a prefix (" 
+ prefix + ") "
++ "That is longer than expected overall field length (" + 
length + "). "
++ "This will certainly lead to unexpected data values.");
+}
+
 switch (column.getType()) {
 case VARCHAR:
 // Use the specified data values from configs if they exist
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
-data = generateDataValue(dataValues);
+data = pickDataValueFromList(dataValues);
 } else {
 Preconditions.checkArgument(length > 0, "length needs to 
be > 0");
 if (column.getDataSequence() == DataSequence.SEQUENTIAL) {
 data = getSequentialDataValue(column);
 } else {
-String varchar = 
RandomStringUtils.randomAlphanumeric(length);
-data = new DataValue(column.getType(), varchar);
+data = getRandomDataValue(column);
 }
 }
 break;
 case CHAR:
 if ((column.getDataValues() != null) && 
(column.getDataValues().size() > 0)) {
-data = generateDataValue(dataValues);
+data = pickDataValueFromList(dataValues);
 } else {

[4/4] phoenix git commit: PHOENIX-2252 - QueryExecutor creates a Differ for performance test

2015-09-11 Thread codymarcel
PHOENIX-2252 - QueryExecutor creates a Differ for performance test


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 4530613ee6eb104429e4ef7528be6e5d4da53749
Parents: 1a8f522
Author: Cody Marcel 
Authored: Fri Sep 11 10:04:06 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 11:05:43 2015 -0700

--
 .../org/apache/phoenix/pherf/workload/QueryExecutor.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4530613e/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 5a7c49f..50d7190 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -260,13 +260,13 @@ public class QueryExecutor implements Workload {
 Runnable thread;
 if (workloadExecutor.isPerformance()) {
 thread =
-new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
-querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
-} else {
-thread =
 new MultiThreadedRunner(threadTime.getThreadName(), 
queryResult,
 dataModelResult, threadTime, 
querySet.getNumberOfExecutions(),
 querySet.getExecutionDurationInMs());
+} else {
+thread =
+new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
+querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
 }
 return thread;
 }



[2/4] phoenix git commit: PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be executed before a scenario is run to support dynamically creating multi-tenant views we are goi

2015-09-11 Thread codymarcel
PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be 
executed before a scenario is run to support dynamically creating multi-tenant 
views we are going to write and read from


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

Branch: refs/heads/4.x-HBase-1.0
Commit: a3f6f268072b45a9e112ed072dd20a8aad393030
Parents: 9d587cd
Author: Jan 
Authored: Thu Sep 3 17:48:18 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 11:05:13 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 31 
 .../phoenix/pherf/configuration/Scenario.java   | 13 
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 21 +
 .../phoenix/pherf/workload/WriteWorkload.java   |  5 +++-
 .../test/resources/scenario/test_scenario.xml   |  6 
 5 files changed, 69 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a3f6f268/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 4f527fc..33f8a53 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,10 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
-
-import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -34,6 +30,9 @@ import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -70,7 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 scenario.getTableNameWithoutSchemaName(), 
util.getConnection());
 assertTrue("Could not get phoenix columns.", 
columnListFromPhoenix.size() > 0);
 
-WriteWorkload loader = new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO);
+WriteWorkload loader = new WriteWorkload(util, parser, scenario, 
PherfConstants.GeneratePhoenixStats.NO);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
 executor.get();
@@ -158,7 +157,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 // Arrange
 Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
 WorkloadExecutor executor = new WorkloadExecutor();
-executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+executor.add(new WriteWorkload(util, parser, scenario, 
PherfConstants.GeneratePhoenixStats.NO));
 
 // Act
 try {
@@ -174,6 +173,26 @@ public class DataIngestIT extends ResultBaseTestIT {
 
 }
 
+
+@Test
+public void testMultiTenantScenarioRunBeforeWriteWorkload() throws 
Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTDdlWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
PherfConstants.GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
 private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
 SQLException {
 Connection connection = util.getConnection(scenario.getTenantId());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a3f6f268/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 6c949d8..200fdc5 100644
--- 
a/phoenix-pherf/src/main/java/o

[1/4] phoenix git commit: PHOENIX-2184 - Pherf - Add plugable custom result writer

2015-09-11 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 ba2c879c1 -> 4530613ee


PHOENIX-2184 - Pherf - Add plugable custom result writer


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 9d587cdc82ef11af42418f32a265a0b513405966
Parents: ba2c879
Author: Cody Marcel 
Authored: Mon Aug 3 15:10:58 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 11:03:18 2015 -0700

--
 .../apache/phoenix/util/InstanceResolver.java   |  26 ++-
 phoenix-pherf/config/pherf.properties   |   3 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |   8 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   2 +-
 .../java/org/apache/phoenix/pherf/Pherf.java|  14 +-
 .../apache/phoenix/pherf/PherfConstants.java|  35 ++--
 .../phoenix/pherf/jmx/MonitorManager.java   |  14 +-
 .../phoenix/pherf/result/QueryResult.java   |  31 +--
 .../phoenix/pherf/result/ResultHandler.java |   6 +
 .../phoenix/pherf/result/ResultManager.java |  61 --
 .../apache/phoenix/pherf/result/ResultUtil.java |  34 ++-
 .../pherf/result/file/ResultFileDetails.java|   5 +
 .../pherf/result/impl/CSVFileResultHandler.java |  89 
 .../pherf/result/impl/CSVResultHandler.java | 108 ++
 .../pherf/result/impl/DefaultResultHandler.java |  67 ++
 .../pherf/result/impl/ImageResultHandler.java   |  50 ++---
 .../pherf/result/impl/XMLResultHandler.java |  44 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 209 ++-
 .../pherf/workload/MultiThreadedRunner.java |   5 +-
 .../phoenix/pherf/workload/QueryExecutor.java   |  37 ++--
 .../pherf/workload/WorkloadExecutor.java|  17 +-
 .../phoenix/pherf/workload/WriteWorkload.java   |   3 +-
 .../org/apache/phoenix/pherf/PherfTest.java |   2 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   5 +-
 .../org/apache/phoenix/pherf/ResultTest.java|  97 +
 25 files changed, 570 insertions(+), 402 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d587cdc/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
index e238c64..dd99d1e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
@@ -17,6 +17,10 @@
  */
 package org.apache.phoenix.util;
 
+import org.apache.commons.collections.IteratorUtils;
+
+import java.util.Iterator;
+import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -52,7 +56,27 @@ public class InstanceResolver {
 }
 return (T)obj;
 }
-
+
+/**
+ * Resolves all instances of a specified class and add it to the list of 
default implementations
+ * @param clazz Type of the instance to resolve
+ * @param defaultInstances {@link List} of instances that match the type 
clazz
+ * @param  Type of class passed
+ * @return {@link List} of instance of the specified class. Newly found 
instances will be added
+ *  to the existing contents of defaultInstances
+ */
+@SuppressWarnings("unchecked")
+public static  List get(Class clazz, List defaultInstances) {
+Iterator iterator = ServiceLoader.load(clazz).iterator();
+if (defaultInstances != null) {
+defaultInstances.addAll(IteratorUtils.toList(iterator));
+} else {
+defaultInstances = IteratorUtils.toList(iterator);
+}
+
+return defaultInstances;
+}
+
 private synchronized static  T resolveSingleton(Class clazz, T 
defaultInstance) {
 ServiceLoader loader = ServiceLoader.load(clazz);
 // returns the first registered instance found

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d587cdc/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 1142f9b5..152e09c 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -30,5 +30,4 @@ pherf.default.dataloader.threadpool=0
 pherf.default.dataloader.batchsize=1000
 
 # Directory where results from a scenario run will be written
-pherf.default.results.dir=RESULTS
-
+pherf.default.results.dir=RESULTS
\ No newline at end of file

http://git-wip-u

[3/4] phoenix git commit: PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.

2015-09-11 Thread codymarcel
PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 1a8f522b57de7d183464a04d075a48b7cb3fb3ce
Parents: a3f6f26
Author: Jan 
Authored: Fri Sep 4 13:17:32 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 11:05:13 2015 -0700

--
 .../src/test/resources/scenario/test_scenario.xml  | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a8f522b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
--
diff --git a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml 
b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
index 735e690..50a603e 100644
--- a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
+++ b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
@@ -220,10 +220,23 @@
 
 
 
-
+
 
 
-
+
 



[2/4] phoenix git commit: PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be executed before a scenario is run to support dynamically creating multi-tenant views we are goi

2015-09-11 Thread codymarcel
PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be 
executed before a scenario is run to support dynamically creating multi-tenant 
views we are going to write and read from


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 6789fe7e36062793a1d03871347b146f7e6d5357
Parents: f9a5a92
Author: Jan 
Authored: Thu Sep 3 17:48:18 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:58:20 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 21 +++-
 .../phoenix/pherf/configuration/Scenario.java   | 13 
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 21 
 .../phoenix/pherf/workload/WriteWorkload.java   |  5 -
 .../test/resources/scenario/test_scenario.xml   |  6 ++
 5 files changed, 64 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6789fe7e/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b821c7b..1098799 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.pherf;
 
 import com.jcabi.jdbc.JdbcSession;
 import com.jcabi.jdbc.Outcome;
-
 import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
@@ -173,6 +172,26 @@ public class DataIngestIT extends ResultBaseTestIT {
 
 }
 
+
+@Test
+public void testMultiTenantScenarioRunBeforeWriteWorkload() throws 
Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTDdlWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
 private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
 SQLException {
 Connection connection = util.getConnection(scenario.getTenantId());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6789fe7e/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 6c949d8..200fdc5 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -39,6 +39,7 @@ public class Scenario {
 private WriteParams writeParams;
 private String name;
 private String tenantId;
+private String ddl;
 
 public Scenario() {
 writeParams = new WriteParams();
@@ -178,6 +179,18 @@ public class Scenario {
 this.tenantId = tenantId;
 }
 
+/**
+ * Scenario level DDL that is executed before running the scenario.
+ */
+@XmlAttribute
+public String getDdl() {
+return ddl;
+}
+
+public void setDdl(String ddl) {
+this.ddl = ddl;
+}
+
 public WriteParams getWriteParams() {
 return writeParams;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6789fe7e/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
index fad06a1..57858a3 100644
--- a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
+++ b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
@@ -243,6 +243,27 @@ public class PhoenixUtil {
 }
 }
 }
+
+/**
+ * Executes any ddl defined 

[1/4] phoenix git commit: PHOENIX-2184 - Pherf - Add plugable custom result writer

2015-09-11 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 18ec7d6a4 -> 2af5f8cb4


PHOENIX-2184 - Pherf - Add plugable custom result writer


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

Branch: refs/heads/4.x-HBase-0.98
Commit: f9a5a9251bd63eed7083ba6d6ac82f570b13d426
Parents: 18ec7d6
Author: Cody Marcel 
Authored: Mon Aug 3 15:10:58 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:57:04 2015 -0700

--
 .../apache/phoenix/util/InstanceResolver.java   |  26 ++-
 phoenix-pherf/config/pherf.properties   |   3 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |   7 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   2 +-
 .../java/org/apache/phoenix/pherf/Pherf.java|  14 +-
 .../apache/phoenix/pherf/PherfConstants.java|  35 ++--
 .../phoenix/pherf/jmx/MonitorManager.java   |  14 +-
 .../phoenix/pherf/result/QueryResult.java   |  31 +--
 .../phoenix/pherf/result/ResultHandler.java |   6 +
 .../phoenix/pherf/result/ResultManager.java |  61 --
 .../apache/phoenix/pherf/result/ResultUtil.java |  34 ++-
 .../pherf/result/file/ResultFileDetails.java|   5 +
 .../pherf/result/impl/CSVFileResultHandler.java |  89 
 .../pherf/result/impl/CSVResultHandler.java | 108 ++
 .../pherf/result/impl/DefaultResultHandler.java |  67 ++
 .../pherf/result/impl/ImageResultHandler.java   |  50 ++---
 .../pherf/result/impl/XMLResultHandler.java |  44 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 209 ++-
 .../pherf/workload/MultiThreadedRunner.java |   5 +-
 .../phoenix/pherf/workload/QueryExecutor.java   |  37 ++--
 .../pherf/workload/WorkloadExecutor.java|  17 +-
 .../phoenix/pherf/workload/WriteWorkload.java   |   3 +-
 .../org/apache/phoenix/pherf/PherfTest.java |   2 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   5 +-
 .../org/apache/phoenix/pherf/ResultTest.java|  97 +
 25 files changed, 570 insertions(+), 401 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f9a5a925/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
index e238c64..dd99d1e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
@@ -17,6 +17,10 @@
  */
 package org.apache.phoenix.util;
 
+import org.apache.commons.collections.IteratorUtils;
+
+import java.util.Iterator;
+import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -52,7 +56,27 @@ public class InstanceResolver {
 }
 return (T)obj;
 }
-
+
+/**
+ * Resolves all instances of a specified class and add it to the list of 
default implementations
+ * @param clazz Type of the instance to resolve
+ * @param defaultInstances {@link List} of instances that match the type 
clazz
+ * @param  Type of class passed
+ * @return {@link List} of instance of the specified class. Newly found 
instances will be added
+ *  to the existing contents of defaultInstances
+ */
+@SuppressWarnings("unchecked")
+public static  List get(Class clazz, List defaultInstances) {
+Iterator iterator = ServiceLoader.load(clazz).iterator();
+if (defaultInstances != null) {
+defaultInstances.addAll(IteratorUtils.toList(iterator));
+} else {
+defaultInstances = IteratorUtils.toList(iterator);
+}
+
+return defaultInstances;
+}
+
 private synchronized static  T resolveSingleton(Class clazz, T 
defaultInstance) {
 ServiceLoader loader = ServiceLoader.load(clazz);
 // returns the first registered instance found

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f9a5a925/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 1142f9b5..152e09c 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -30,5 +30,4 @@ pherf.default.dataloader.threadpool=0
 pherf.default.dataloader.batchsize=1000
 
 # Directory where results from a scenario run will be written
-pherf.default.results.dir=RESULTS
-
+pherf.default.results.dir=RESULTS
\ No newline at end of file

http://git-wip

[3/4] phoenix git commit: PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.

2015-09-11 Thread codymarcel
PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 120426b6e8ef279b52fed14f7b767c024dd089e8
Parents: 6789fe7
Author: Jan 
Authored: Fri Sep 4 13:17:32 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:58:20 2015 -0700

--
 .../src/test/resources/scenario/test_scenario.xml  | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/120426b6/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
--
diff --git a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml 
b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
index 735e690..50a603e 100644
--- a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
+++ b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
@@ -220,10 +220,23 @@
 
 
 
-
+
 
 
-
+
 



[4/4] phoenix git commit: PHOENIX-2252 - QueryExecutor creates a Differ for performance test

2015-09-11 Thread codymarcel
PHOENIX-2252 - QueryExecutor creates a Differ for performance test


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 2af5f8cb403a1b1a0046c2a13f94973c2c2508c8
Parents: 120426b
Author: Cody Marcel 
Authored: Fri Sep 11 10:04:06 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:58:43 2015 -0700

--
 .../org/apache/phoenix/pherf/workload/QueryExecutor.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2af5f8cb/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 5a7c49f..50d7190 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -260,13 +260,13 @@ public class QueryExecutor implements Workload {
 Runnable thread;
 if (workloadExecutor.isPerformance()) {
 thread =
-new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
-querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
-} else {
-thread =
 new MultiThreadedRunner(threadTime.getThreadName(), 
queryResult,
 dataModelResult, threadTime, 
querySet.getNumberOfExecutions(),
 querySet.getExecutionDurationInMs());
+} else {
+thread =
+new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
+querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
 }
 return thread;
 }



phoenix git commit: PHOENIX-2252 - QueryExecutor creates a Differ for performance test

2015-09-11 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.1 d7c918f27 -> 24cd96d9a


PHOENIX-2252 - QueryExecutor creates a Differ for performance test


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

Branch: refs/heads/4.5-HBase-1.1
Commit: 24cd96d9a70b0ad4a21e2517b9b0cbb822ff1a0a
Parents: d7c918f
Author: Cody Marcel 
Authored: Fri Sep 11 10:04:06 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:41:28 2015 -0700

--
 .../org/apache/phoenix/pherf/workload/QueryExecutor.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/24cd96d9/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 5a7c49f..50d7190 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -260,13 +260,13 @@ public class QueryExecutor implements Workload {
 Runnable thread;
 if (workloadExecutor.isPerformance()) {
 thread =
-new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
-querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
-} else {
-thread =
 new MultiThreadedRunner(threadTime.getThreadName(), 
queryResult,
 dataModelResult, threadTime, 
querySet.getNumberOfExecutions(),
 querySet.getExecutionDurationInMs());
+} else {
+thread =
+new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
+querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
 }
 return thread;
 }



phoenix git commit: PHOENIX-2252 - QueryExecutor creates a Differ for performance test

2015-09-11 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.0 4d8b5d28b -> c7d017144


PHOENIX-2252 - QueryExecutor creates a Differ for performance test


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

Branch: refs/heads/4.5-HBase-1.0
Commit: c7d0171445b5bba41eec82155534435419fc18b5
Parents: 4d8b5d2
Author: Cody Marcel 
Authored: Fri Sep 11 10:04:06 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:39:44 2015 -0700

--
 .../org/apache/phoenix/pherf/workload/QueryExecutor.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c7d01714/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 5a7c49f..50d7190 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -260,13 +260,13 @@ public class QueryExecutor implements Workload {
 Runnable thread;
 if (workloadExecutor.isPerformance()) {
 thread =
-new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
-querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
-} else {
-thread =
 new MultiThreadedRunner(threadTime.getThreadName(), 
queryResult,
 dataModelResult, threadTime, 
querySet.getNumberOfExecutions(),
 querySet.getExecutionDurationInMs());
+} else {
+thread =
+new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
+querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
 }
 return thread;
 }



phoenix git commit: PHOENIX-2252 - QueryExecutor creates a Differ for performance test

2015-09-11 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-0.98 e345a36ee -> 75bb1a5ef


PHOENIX-2252 - QueryExecutor creates a Differ for performance test


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

Branch: refs/heads/4.5-HBase-0.98
Commit: 75bb1a5ef2a55b901ab35c66c62bc25c3eebe708
Parents: e345a36
Author: Cody Marcel 
Authored: Fri Sep 11 10:04:06 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:38:38 2015 -0700

--
 .../org/apache/phoenix/pherf/workload/QueryExecutor.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/75bb1a5e/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 5a7c49f..50d7190 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -260,13 +260,13 @@ public class QueryExecutor implements Workload {
 Runnable thread;
 if (workloadExecutor.isPerformance()) {
 thread =
-new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
-querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
-} else {
-thread =
 new MultiThreadedRunner(threadTime.getThreadName(), 
queryResult,
 dataModelResult, threadTime, 
querySet.getNumberOfExecutions(),
 querySet.getExecutionDurationInMs());
+} else {
+thread =
+new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
+querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
 }
 return thread;
 }



phoenix git commit: PHOENIX-2252 - QueryExecutor creates a Differ for performance test

2015-09-11 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master f76062c90 -> 29535f342


PHOENIX-2252 - QueryExecutor creates a Differ for performance test


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

Branch: refs/heads/master
Commit: 29535f342ff53dbdef03dc5822a5e7583be32cbb
Parents: f76062c
Author: Cody Marcel 
Authored: Fri Sep 11 10:04:06 2015 -0700
Committer: Cody Marcel 
Committed: Fri Sep 11 10:04:06 2015 -0700

--
 .../org/apache/phoenix/pherf/workload/QueryExecutor.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/29535f34/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
index 5a7c49f..50d7190 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryExecutor.java
@@ -260,13 +260,13 @@ public class QueryExecutor implements Workload {
 Runnable thread;
 if (workloadExecutor.isPerformance()) {
 thread =
-new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
-querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
-} else {
-thread =
 new MultiThreadedRunner(threadTime.getThreadName(), 
queryResult,
 dataModelResult, threadTime, 
querySet.getNumberOfExecutions(),
 querySet.getExecutionDurationInMs());
+} else {
+thread =
+new MultithreadedDiffer(threadTime.getThreadName(), 
queryResult, threadTime,
+querySet.getNumberOfExecutions(), 
querySet.getExecutionDurationInMs());
 }
 return thread;
 }



phoenix git commit: PHOENIX-2184 - Pherf - Add plugable custom result writer

2015-09-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.1 946fa1a38 -> d7c918f27


PHOENIX-2184 - Pherf - Add plugable custom result writer


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

Branch: refs/heads/4.5-HBase-1.1
Commit: d7c918f272a3503244e72900b545efcd4967c9f1
Parents: 946fa1a
Author: Cody Marcel 
Authored: Mon Aug 3 15:10:58 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 14:22:24 2015 -0700

--
 .../apache/phoenix/util/InstanceResolver.java   |  26 ++-
 phoenix-pherf/config/pherf.properties   |   3 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  10 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   2 +-
 .../java/org/apache/phoenix/pherf/Pherf.java|  14 +-
 .../apache/phoenix/pherf/PherfConstants.java|  35 ++--
 .../phoenix/pherf/jmx/MonitorManager.java   |  14 +-
 .../phoenix/pherf/result/QueryResult.java   |  31 +--
 .../phoenix/pherf/result/ResultHandler.java |   6 +
 .../phoenix/pherf/result/ResultManager.java |  61 --
 .../apache/phoenix/pherf/result/ResultUtil.java |  34 ++-
 .../pherf/result/file/ResultFileDetails.java|   5 +
 .../pherf/result/impl/CSVFileResultHandler.java |  89 
 .../pherf/result/impl/CSVResultHandler.java | 108 ++
 .../pherf/result/impl/DefaultResultHandler.java |  67 ++
 .../pherf/result/impl/ImageResultHandler.java   |  50 ++---
 .../pherf/result/impl/XMLResultHandler.java |  44 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 209 ++-
 .../pherf/workload/MultiThreadedRunner.java |   5 +-
 .../phoenix/pherf/workload/QueryExecutor.java   |  37 ++--
 .../pherf/workload/WorkloadExecutor.java|  17 +-
 .../phoenix/pherf/workload/WriteWorkload.java   |   3 +-
 .../org/apache/phoenix/pherf/PherfTest.java |   2 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   5 +-
 .../org/apache/phoenix/pherf/ResultTest.java|  97 +
 25 files changed, 572 insertions(+), 402 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d7c918f2/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
index e238c64..dd99d1e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
@@ -17,6 +17,10 @@
  */
 package org.apache.phoenix.util;
 
+import org.apache.commons.collections.IteratorUtils;
+
+import java.util.Iterator;
+import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -52,7 +56,27 @@ public class InstanceResolver {
 }
 return (T)obj;
 }
-
+
+/**
+ * Resolves all instances of a specified class and add it to the list of 
default implementations
+ * @param clazz Type of the instance to resolve
+ * @param defaultInstances {@link List} of instances that match the type 
clazz
+ * @param  Type of class passed
+ * @return {@link List} of instance of the specified class. Newly found 
instances will be added
+ *  to the existing contents of defaultInstances
+ */
+@SuppressWarnings("unchecked")
+public static  List get(Class clazz, List defaultInstances) {
+Iterator iterator = ServiceLoader.load(clazz).iterator();
+if (defaultInstances != null) {
+defaultInstances.addAll(IteratorUtils.toList(iterator));
+} else {
+defaultInstances = IteratorUtils.toList(iterator);
+}
+
+return defaultInstances;
+}
+
 private synchronized static  T resolveSingleton(Class clazz, T 
defaultInstance) {
 ServiceLoader loader = ServiceLoader.load(clazz);
 // returns the first registered instance found

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d7c918f2/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 1142f9b5..152e09c 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -30,5 +30,4 @@ pherf.default.dataloader.threadpool=0
 pherf.default.dataloader.batchsize=1000
 
 # Directory where results from a scenario run will be written
-pherf.default.results.dir=RESULTS
-
+pherf.default.results.dir=RESULTS
\ No newline at end of file

http://git-wip-u

phoenix git commit: PHOENIX-2184 - Pherf - Add plugable custom result writer

2015-09-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.0 cf87af3df -> 4d8b5d28b


PHOENIX-2184 - Pherf - Add plugable custom result writer


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

Branch: refs/heads/4.5-HBase-1.0
Commit: 4d8b5d28bbe4a01ab6d17a28b6d11a8fe3aa8f6b
Parents: cf87af3
Author: Cody Marcel 
Authored: Mon Aug 3 15:10:58 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 14:19:02 2015 -0700

--
 .../apache/phoenix/util/InstanceResolver.java   |  26 ++-
 phoenix-pherf/config/pherf.properties   |   3 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  10 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   2 +-
 .../java/org/apache/phoenix/pherf/Pherf.java|  14 +-
 .../apache/phoenix/pherf/PherfConstants.java|  35 ++--
 .../phoenix/pherf/jmx/MonitorManager.java   |  14 +-
 .../phoenix/pherf/result/QueryResult.java   |  31 +--
 .../phoenix/pherf/result/ResultHandler.java |   6 +
 .../phoenix/pherf/result/ResultManager.java |  61 --
 .../apache/phoenix/pherf/result/ResultUtil.java |  34 ++-
 .../pherf/result/file/ResultFileDetails.java|   5 +
 .../pherf/result/impl/CSVFileResultHandler.java |  89 
 .../pherf/result/impl/CSVResultHandler.java | 108 ++
 .../pherf/result/impl/DefaultResultHandler.java |  67 ++
 .../pherf/result/impl/ImageResultHandler.java   |  50 ++---
 .../pherf/result/impl/XMLResultHandler.java |  44 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 209 ++-
 .../pherf/workload/MultiThreadedRunner.java |   5 +-
 .../phoenix/pherf/workload/QueryExecutor.java   |  37 ++--
 .../pherf/workload/WorkloadExecutor.java|  17 +-
 .../phoenix/pherf/workload/WriteWorkload.java   |   3 +-
 .../org/apache/phoenix/pherf/PherfTest.java |   2 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   5 +-
 .../org/apache/phoenix/pherf/ResultTest.java|  97 +
 25 files changed, 572 insertions(+), 402 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d8b5d28/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
index e238c64..dd99d1e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
@@ -17,6 +17,10 @@
  */
 package org.apache.phoenix.util;
 
+import org.apache.commons.collections.IteratorUtils;
+
+import java.util.Iterator;
+import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -52,7 +56,27 @@ public class InstanceResolver {
 }
 return (T)obj;
 }
-
+
+/**
+ * Resolves all instances of a specified class and add it to the list of 
default implementations
+ * @param clazz Type of the instance to resolve
+ * @param defaultInstances {@link List} of instances that match the type 
clazz
+ * @param  Type of class passed
+ * @return {@link List} of instance of the specified class. Newly found 
instances will be added
+ *  to the existing contents of defaultInstances
+ */
+@SuppressWarnings("unchecked")
+public static  List get(Class clazz, List defaultInstances) {
+Iterator iterator = ServiceLoader.load(clazz).iterator();
+if (defaultInstances != null) {
+defaultInstances.addAll(IteratorUtils.toList(iterator));
+} else {
+defaultInstances = IteratorUtils.toList(iterator);
+}
+
+return defaultInstances;
+}
+
 private synchronized static  T resolveSingleton(Class clazz, T 
defaultInstance) {
 ServiceLoader loader = ServiceLoader.load(clazz);
 // returns the first registered instance found

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d8b5d28/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 1142f9b5..152e09c 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -30,5 +30,4 @@ pherf.default.dataloader.threadpool=0
 pherf.default.dataloader.batchsize=1000
 
 # Directory where results from a scenario run will be written
-pherf.default.results.dir=RESULTS
-
+pherf.default.results.dir=RESULTS
\ No newline at end of file

http://git-wip-u

phoenix git commit: PHOENIX-2184 - Pherf - Add plugable custom result writer

2015-09-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-0.98 14280fef3 -> e345a36ee


PHOENIX-2184 - Pherf - Add plugable custom result writer


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

Branch: refs/heads/4.5-HBase-0.98
Commit: e345a36ee90deeb70fc37e80113eacabce104514
Parents: 14280fe
Author: Cody Marcel 
Authored: Mon Aug 3 15:10:58 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 14:15:44 2015 -0700

--
 .../coprocessor/BaseScannerRegionObserver.java  |   2 +-
 .../apache/phoenix/util/InstanceResolver.java   |  26 ++-
 phoenix-pherf/config/pherf.properties   |   3 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  10 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   2 +-
 .../java/org/apache/phoenix/pherf/Pherf.java|  14 +-
 .../apache/phoenix/pherf/PherfConstants.java|  35 ++--
 .../phoenix/pherf/jmx/MonitorManager.java   |  14 +-
 .../phoenix/pherf/result/QueryResult.java   |  31 +--
 .../phoenix/pherf/result/ResultHandler.java |   6 +
 .../phoenix/pherf/result/ResultManager.java |  61 --
 .../apache/phoenix/pherf/result/ResultUtil.java |  34 ++-
 .../pherf/result/file/ResultFileDetails.java|   5 +
 .../pherf/result/impl/CSVFileResultHandler.java |  89 
 .../pherf/result/impl/CSVResultHandler.java | 108 ++
 .../pherf/result/impl/DefaultResultHandler.java |  67 ++
 .../pherf/result/impl/ImageResultHandler.java   |  50 ++---
 .../pherf/result/impl/XMLResultHandler.java |  44 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 209 ++-
 .../pherf/workload/MultiThreadedRunner.java |   5 +-
 .../phoenix/pherf/workload/QueryExecutor.java   |  37 ++--
 .../pherf/workload/WorkloadExecutor.java|  17 +-
 .../phoenix/pherf/workload/WriteWorkload.java   |   3 +-
 .../org/apache/phoenix/pherf/PherfTest.java |   2 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   5 +-
 .../org/apache/phoenix/pherf/ResultTest.java|  97 +
 26 files changed, 573 insertions(+), 403 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e345a36e/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
index 8e94c78..ab1b6b4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
@@ -87,7 +87,7 @@ abstract public class BaseScannerRegionObserver extends 
BaseRegionObserver {
 public static final String ANALYZE_TABLE = "_ANALYZETABLE";
 public static final String GUIDEPOST_WIDTH_BYTES = 
"_GUIDEPOST_WIDTH_BYTES";
 public static final String GUIDEPOST_PER_REGION = "_GUIDEPOST_PER_REGION";
-public static final String UPGRADE_DESC_ROW_KEY = "_UPGRADE_DESC_ROW_KEY";
+public static final String UPGRADE_DESC_ROW_KEY = "_UPGRADE_DESnC_ROW_KEY";
 
 /**
  * Attribute name used to pass custom annotations in Scans and Mutations 
(later). Custom annotations

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e345a36e/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
index e238c64..dd99d1e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
@@ -17,6 +17,10 @@
  */
 package org.apache.phoenix.util;
 
+import org.apache.commons.collections.IteratorUtils;
+
+import java.util.Iterator;
+import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -52,7 +56,27 @@ public class InstanceResolver {
 }
 return (T)obj;
 }
-
+
+/**
+ * Resolves all instances of a specified class and add it to the list of 
default implementations
+ * @param clazz Type of the instance to resolve
+ * @param defaultInstances {@link List} of instances that match the type 
clazz
+ * @param  Type of class passed
+ * @return {@link List} of instance of the specified class. Newly found 
instances will be added
+ *  to the existing contents of de

[1/2] phoenix git commit: PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.

2015-09-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.1 9c0ef4515 -> 946fa1a38


PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.


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

Branch: refs/heads/4.5-HBase-1.1
Commit: 946fa1a38ed3c7404efe3554b5d4bc3d4f9c6e4a
Parents: 7eb0dcf
Author: Jan 
Authored: Fri Sep 4 13:17:32 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 13:47:56 2015 -0700

--
 .../src/test/resources/scenario/test_scenario.xml  | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/946fa1a3/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
--
diff --git a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml 
b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
index 735e690..50a603e 100644
--- a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
+++ b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
@@ -220,10 +220,23 @@
 
 
 
-
+
 
 
-
+
 



[2/2] phoenix git commit: PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be executed before a scenario is run to support dynamically creating multi-tenant views we are goi

2015-09-10 Thread codymarcel
PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be 
executed before a scenario is run to support dynamically creating multi-tenant 
views we are going to write and read from


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

Branch: refs/heads/4.5-HBase-1.1
Commit: 7eb0dcf1a98b6f3dc77ed17231c71660b2719a0b
Parents: 9c0ef45
Author: Jan 
Authored: Thu Sep 3 17:48:18 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 13:47:56 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 25 
 .../phoenix/pherf/configuration/Scenario.java   | 13 ++
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 21 
 .../phoenix/pherf/workload/WriteWorkload.java   |  5 +++-
 .../test/resources/scenario/test_scenario.xml   |  6 +
 5 files changed, 65 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7eb0dcf1/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 297f882..4fb5ccd 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,10 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
-
-import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -35,6 +31,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -177,6 +174,26 @@ public class DataIngestIT extends ResultBaseTestIT {
 assertExpectedNumberOfRecordsWritten(scenario);
 }
 
+
+@Test
+public void testMultiTenantScenarioRunBeforeWriteWorkload() throws 
Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTDdlWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
 private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
 SQLException {
 Connection connection = util.getConnection(scenario.getTenantId());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7eb0dcf1/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 6c949d8..200fdc5 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -39,6 +39,7 @@ public class Scenario {
 private WriteParams writeParams;
 private String name;
 private String tenantId;
+private String ddl;
 
 public Scenario() {
 writeParams = new WriteParams();
@@ -178,6 +179,18 @@ public class Scenario {
 this.tenantId = tenantId;
 }
 
+/**
+ * Scenario level DDL that is executed before running the scenario.
+ */
+@XmlAttribute
+public String getDdl() {
+return ddl;
+}
+
+public void setDdl(String ddl) {
+this.ddl = ddl;
+}
+
 public WriteParams getWriteParams() {
 return writeParams;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7eb0dcf1/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/

[2/2] phoenix git commit: PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be executed before a scenario is run to support dynamically creating multi-tenant views we are goi

2015-09-10 Thread codymarcel
PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be 
executed before a scenario is run to support dynamically creating multi-tenant 
views we are going to write and read from


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

Branch: refs/heads/4.5-HBase-1.0
Commit: e4b3705472cb70bcf8eb38870077aa87cafe23e4
Parents: b75ae76
Author: Jan 
Authored: Thu Sep 3 17:48:18 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 13:42:24 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 25 
 .../phoenix/pherf/configuration/Scenario.java   | 13 ++
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 21 
 .../phoenix/pherf/workload/WriteWorkload.java   |  5 +++-
 .../test/resources/scenario/test_scenario.xml   |  6 +
 5 files changed, 65 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e4b37054/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 297f882..4fb5ccd 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,10 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
-
-import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -35,6 +31,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -177,6 +174,26 @@ public class DataIngestIT extends ResultBaseTestIT {
 assertExpectedNumberOfRecordsWritten(scenario);
 }
 
+
+@Test
+public void testMultiTenantScenarioRunBeforeWriteWorkload() throws 
Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTDdlWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
 private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
 SQLException {
 Connection connection = util.getConnection(scenario.getTenantId());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e4b37054/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 6c949d8..200fdc5 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -39,6 +39,7 @@ public class Scenario {
 private WriteParams writeParams;
 private String name;
 private String tenantId;
+private String ddl;
 
 public Scenario() {
 writeParams = new WriteParams();
@@ -178,6 +179,18 @@ public class Scenario {
 this.tenantId = tenantId;
 }
 
+/**
+ * Scenario level DDL that is executed before running the scenario.
+ */
+@XmlAttribute
+public String getDdl() {
+return ddl;
+}
+
+public void setDdl(String ddl) {
+this.ddl = ddl;
+}
+
 public WriteParams getWriteParams() {
 return writeParams;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e4b37054/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/

[1/2] phoenix git commit: PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.

2015-09-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.0 b75ae76d6 -> cf87af3df


PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.


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

Branch: refs/heads/4.5-HBase-1.0
Commit: cf87af3df7648a644d98aceed884c49044c6784c
Parents: e4b3705
Author: Jan 
Authored: Fri Sep 4 13:17:32 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 13:42:24 2015 -0700

--
 .../src/test/resources/scenario/test_scenario.xml  | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cf87af3d/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
--
diff --git a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml 
b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
index 735e690..50a603e 100644
--- a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
+++ b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
@@ -220,10 +220,23 @@
 
 
 
-
+
 
 
-
+
 



[2/2] phoenix git commit: PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be executed before a scenario is run to support dynamically creating multi-tenant views we are goi

2015-09-10 Thread codymarcel
PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be 
executed before a scenario is run to support dynamically creating multi-tenant 
views we are going to write and read from


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

Branch: refs/heads/4.5-HBase-0.98
Commit: b715e5d9c41c342d01f1448ea6f31b99690d75db
Parents: a7621e5
Author: Jan 
Authored: Thu Sep 3 17:48:18 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 13:15:50 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 25 
 .../phoenix/pherf/configuration/Scenario.java   | 13 ++
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 21 
 .../phoenix/pherf/workload/WriteWorkload.java   |  5 +++-
 .../test/resources/scenario/test_scenario.xml   |  6 +
 5 files changed, 65 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b715e5d9/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 297f882..4fb5ccd 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,10 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
-
-import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -35,6 +31,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -177,6 +174,26 @@ public class DataIngestIT extends ResultBaseTestIT {
 assertExpectedNumberOfRecordsWritten(scenario);
 }
 
+
+@Test
+public void testMultiTenantScenarioRunBeforeWriteWorkload() throws 
Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTDdlWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
 private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
 SQLException {
 Connection connection = util.getConnection(scenario.getTenantId());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b715e5d9/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 6c949d8..200fdc5 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -39,6 +39,7 @@ public class Scenario {
 private WriteParams writeParams;
 private String name;
 private String tenantId;
+private String ddl;
 
 public Scenario() {
 writeParams = new WriteParams();
@@ -178,6 +179,18 @@ public class Scenario {
 this.tenantId = tenantId;
 }
 
+/**
+ * Scenario level DDL that is executed before running the scenario.
+ */
+@XmlAttribute
+public String getDdl() {
+return ddl;
+}
+
+public void setDdl(String ddl) {
+this.ddl = ddl;
+}
+
 public WriteParams getWriteParams() {
 return writeParams;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b715e5d9/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util

[1/2] phoenix git commit: PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.

2015-09-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-0.98 a7621e533 -> 1a851591c


PHOENIX-2227 Adding comments to test_scenario.xml to explain new features added.


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

Branch: refs/heads/4.5-HBase-0.98
Commit: 1a851591c649744d32ed0beab817636d75285fd7
Parents: b715e5d
Author: Jan 
Authored: Fri Sep 4 13:17:32 2015 -0700
Committer: Cody Marcel 
Committed: Thu Sep 10 13:15:50 2015 -0700

--
 .../src/test/resources/scenario/test_scenario.xml  | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a851591/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
--
diff --git a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml 
b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
index 735e690..50a603e 100644
--- a/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
+++ b/phoenix-pherf/src/test/resources/scenario/test_scenario.xml
@@ -220,10 +220,23 @@
 
 
 
-
+
 
 
-
+
 



[1/2] phoenix git commit: PHOENIX-2184 - Pherf - Add plugable custom result writer

2015-09-09 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 2acb38a9c -> 926bc72c4


PHOENIX-2184 - Pherf - Add plugable custom result writer


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

Branch: refs/heads/master
Commit: ebebf58910ba03aaab9e515ddb0cd36ea469515d
Parents: 2acb38a
Author: Cody Marcel 
Authored: Mon Aug 3 15:10:58 2015 -0700
Committer: Cody Marcel 
Committed: Wed Sep 9 15:49:02 2015 -0700

--
 .../apache/phoenix/util/InstanceResolver.java   |  26 ++-
 phoenix-pherf/config/pherf.properties   |   3 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |   8 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   2 +-
 .../java/org/apache/phoenix/pherf/Pherf.java|  14 +-
 .../apache/phoenix/pherf/PherfConstants.java|  35 ++--
 .../phoenix/pherf/jmx/MonitorManager.java   |  14 +-
 .../phoenix/pherf/result/QueryResult.java   |  31 +--
 .../phoenix/pherf/result/ResultHandler.java |   6 +
 .../phoenix/pherf/result/ResultManager.java |  61 --
 .../apache/phoenix/pherf/result/ResultUtil.java |  34 ++-
 .../pherf/result/file/ResultFileDetails.java|   5 +
 .../pherf/result/impl/CSVFileResultHandler.java |  89 
 .../pherf/result/impl/CSVResultHandler.java | 108 ++
 .../pherf/result/impl/DefaultResultHandler.java |  67 ++
 .../pherf/result/impl/ImageResultHandler.java   |  50 ++---
 .../pherf/result/impl/XMLResultHandler.java |  44 ++--
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 209 ++-
 .../pherf/workload/MultiThreadedRunner.java |   5 +-
 .../phoenix/pherf/workload/QueryExecutor.java   |  37 ++--
 .../pherf/workload/WorkloadExecutor.java|  17 +-
 .../phoenix/pherf/workload/WriteWorkload.java   |   3 +-
 .../org/apache/phoenix/pherf/PherfTest.java |   2 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   5 +-
 .../org/apache/phoenix/pherf/ResultTest.java|  97 +
 25 files changed, 570 insertions(+), 402 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ebebf589/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
index e238c64..dd99d1e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/InstanceResolver.java
@@ -17,6 +17,10 @@
  */
 package org.apache.phoenix.util;
 
+import org.apache.commons.collections.IteratorUtils;
+
+import java.util.Iterator;
+import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -52,7 +56,27 @@ public class InstanceResolver {
 }
 return (T)obj;
 }
-
+
+/**
+ * Resolves all instances of a specified class and add it to the list of 
default implementations
+ * @param clazz Type of the instance to resolve
+ * @param defaultInstances {@link List} of instances that match the type 
clazz
+ * @param  Type of class passed
+ * @return {@link List} of instance of the specified class. Newly found 
instances will be added
+ *  to the existing contents of defaultInstances
+ */
+@SuppressWarnings("unchecked")
+public static  List get(Class clazz, List defaultInstances) {
+Iterator iterator = ServiceLoader.load(clazz).iterator();
+if (defaultInstances != null) {
+defaultInstances.addAll(IteratorUtils.toList(iterator));
+} else {
+defaultInstances = IteratorUtils.toList(iterator);
+}
+
+return defaultInstances;
+}
+
 private synchronized static  T resolveSingleton(Class clazz, T 
defaultInstance) {
 ServiceLoader loader = ServiceLoader.load(clazz);
 // returns the first registered instance found

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ebebf589/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 1142f9b5..152e09c 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -30,5 +30,4 @@ pherf.default.dataloader.threadpool=0
 pherf.default.dataloader.batchsize=1000
 
 # Directory where results from a scenario run will be written
-pherf.default.results.dir=RESULTS
-
+pherf.default.results.dir=RESULTS
\ No newline at end of file

http://git-wip-us.apache.org/re

[2/2] phoenix git commit: PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be executed before a scenario is run to support dynamically creating multi-tenant views we are goi

2015-09-09 Thread codymarcel
PHOENIX-2227 Added the ability to Pherf to define a DDL statement that will be 
executed before a scenario is run to support dynamically creating multi-tenant 
views we are going to write and read from


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

Branch: refs/heads/master
Commit: 926bc72c45f8e55c9767c2d3406a76a50f9eac32
Parents: ebebf58
Author: Jan 
Authored: Thu Sep 3 17:48:18 2015 -0700
Committer: Cody Marcel 
Committed: Wed Sep 9 16:10:59 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 27 +---
 .../phoenix/pherf/configuration/Scenario.java   | 13 ++
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 21 +++
 .../phoenix/pherf/workload/WriteWorkload.java   |  5 +++-
 .../test/resources/scenario/test_scenario.xml   | 21 ++-
 5 files changed, 81 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/926bc72c/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 1defcf5..f2a1a07 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,10 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
-
-import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -35,6 +31,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
+import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -173,6 +172,26 @@ public class DataIngestIT extends ResultBaseTestIT {
 assertExpectedNumberOfRecordsWritten(scenario);
 }
 
+
+@Test
+public void testMultiTenantScenarioRunBeforeWriteWorkload() throws 
Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTDdlWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
 private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
 SQLException {
 Connection connection = util.getConnection(scenario.getTenantId());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/926bc72c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 6c949d8..200fdc5 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -39,6 +39,7 @@ public class Scenario {
 private WriteParams writeParams;
 private String name;
 private String tenantId;
+private String ddl;
 
 public Scenario() {
 writeParams = new WriteParams();
@@ -178,6 +179,18 @@ public class Scenario {
 this.tenantId = tenantId;
 }
 
+/**
+ * Scenario level DDL that is executed before running the scenario.
+ */
+@XmlAttribute
+public String getDdl() {
+return ddl;
+}
+
+public void setDdl(String ddl) {
+this.ddl = ddl;
+}
+
 public WriteParams getWriteParams() {
 return writeParams;
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/926bc72c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java
--
dif

phoenix git commit: PHOENIX-1994 - TestIndexWriter#testFailureOnRunningUpdateAbortsPending() deadlocks on JDK 8

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master c811cf687 -> d401fa3a6


PHOENIX-1994 - TestIndexWriter#testFailureOnRunningUpdateAbortsPending() 
deadlocks on JDK 8


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

Branch: refs/heads/master
Commit: d401fa3a6f5ec9787b120643881a389b9af7b19f
Parents: c811cf6
Author: Cody Marcel 
Authored: Mon Aug 10 12:08:07 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 12:08:07 2015 -0700

--
 .../java/org/apache/phoenix/hbase/index/write/TestIndexWriter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d401fa3a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/TestIndexWriter.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/TestIndexWriter.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/TestIndexWriter.java
index 37a8cf4..8f576cf 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/TestIndexWriter.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/TestIndexWriter.java
@@ -145,7 +145,7 @@ public class TestIndexWriter {
 Abortable abort = new StubAbortable();
 Stoppable stop = Mockito.mock(Stoppable.class);
 // single thread factory so the older request gets queued
-ExecutorService exec = Executors.newFixedThreadPool(1);
+ExecutorService exec = Executors.newFixedThreadPool(3);
 Map tables = new 
HashMap();
 FakeTableFactory factory = new FakeTableFactory(tables);
 



phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.1 b7cd7e505 -> 93bd2c33c


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.5-HBase-1.1
Commit: 93bd2c33ccfa9fca0d6f52a76d7e3c4d14637109
Parents: b7cd7e5
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 11:22:46 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 74 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 +--
 .../pherf/configuration/XMLConfigParser.java| 23 +++---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 28 +---
 .../phoenix/pherf/workload/WriteWorkload.java   | 36 +-
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 ++
 8 files changed, 187 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/93bd2c33/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 8a340b3..2b9d309 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,8 +18,19 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -33,15 +44,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -144,4 +148,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+
+
 }

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.0 083998f15 -> d21ee23ed


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.5-HBase-1.0
Commit: d21ee23ed80b333c98d3a3e7117c6d4e23a4c4d5
Parents: 083998f
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 11:19:21 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 74 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 +--
 .../pherf/configuration/XMLConfigParser.java| 23 +++---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 28 +---
 .../phoenix/pherf/workload/WriteWorkload.java   | 36 +-
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 ++
 8 files changed, 187 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d21ee23e/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 8a340b3..2b9d309 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,8 +18,19 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -33,15 +44,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -144,4 +148,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+
+
 }

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-0.98 26ba0159e -> e9d8c01c8


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.5-HBase-0.98
Commit: e9d8c01c8141a2f402bd8466ebb71ed5418a1638
Parents: 26ba015
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 11:16:34 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 74 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 +--
 .../pherf/configuration/XMLConfigParser.java| 23 +++---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 28 +---
 .../phoenix/pherf/workload/WriteWorkload.java   | 36 +-
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 ++
 8 files changed, 187 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e9d8c01c/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 8a340b3..2b9d309 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,8 +18,19 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -33,15 +44,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -144,4 +148,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+
+
 

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 0a247822a -> e1c92a2a1


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.x-HBase-1.0
Commit: e1c92a2a13e0fa692a9be80598d75c0d56a8e1ea
Parents: 0a24782
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 11:10:46 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 67 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 ++--
 .../pherf/configuration/XMLConfigParser.java| 23 ---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 30 +
 .../phoenix/pherf/workload/WriteWorkload.java   | 48 +-
 .../datamodel/test_schema_mt_table.sql  | 31 +
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 +++
 8 files changed, 197 insertions(+), 50 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e1c92a2a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 1defbb1..345f8e9 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -22,6 +22,18 @@ import com.jcabi.jdbc.JdbcSession;
 import com.jcabi.jdbc.Outcome;
 
 import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -35,15 +47,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -146,4 +151,48 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 b985a4a3f -> 2114f8180


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 2114f81809828a41120d2b5deae8a9e945bd9ec4
Parents: b985a4a
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 11:06:05 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 51 
 .../phoenix/pherf/configuration/Scenario.java   | 25 --
 .../pherf/configuration/XMLConfigParser.java| 23 +
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 30 +++-
 .../phoenix/pherf/workload/WriteWorkload.java   | 48 --
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 +
 8 files changed, 190 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2114f818/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 1defbb1..2b900df 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -35,6 +35,9 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
+
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -146,4 +149,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2114f818/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index 7de96cc..6c949d8 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -18,15 +18,16 @@
 
 package org.apache.phoenix.pherf.configuration;
 
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import java.util.ArrayList;
+import j

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 1b9c7ea9a -> 3718da181


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.4-HBase-1.1
Commit: 3718da18195dc4b5d35cd8e9b0f1b8a6b488faec
Parents: 1b9c7ea
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 10:39:56 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 74 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 +--
 .../pherf/configuration/XMLConfigParser.java| 23 +++---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 28 +---
 .../phoenix/pherf/workload/WriteWorkload.java   | 36 +-
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 ++
 8 files changed, 187 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3718da18/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 8a340b3..2b9d309 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,8 +18,19 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -33,15 +44,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -144,4 +148,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+
+
 }

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.0 ea349f083 -> 94e095083


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/4.4-HBase-1.0
Commit: 94e095083714e244d03c048b7f8409eaf725eb92
Parents: ea349f0
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 10:37:45 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 74 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 +--
 .../pherf/configuration/XMLConfigParser.java| 23 +++---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 28 +---
 .../phoenix/pherf/workload/WriteWorkload.java   | 36 +-
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 ++
 8 files changed, 187 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/94e09508/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 8a340b3..2b9d309 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,8 +18,19 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -33,15 +44,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -144,4 +148,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+
+
 }

phoenix git commit: PHOENIX-1791 : Pherf - Support data creation to multi-tenant views (Jan Fernando)

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-0.98 358a83a55 -> 975b8fe77


PHOENIX-1791 : Pherf - Support data creation to multi-tenant views (Jan 
Fernando)


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

Branch: refs/heads/4.4-HBase-0.98
Commit: 975b8fe77dda5686a375e48924af366af29f643f
Parents: 358a83a
Author: Cody Marcel 
Authored: Mon Aug 10 10:19:19 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 10:21:33 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 74 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 +--
 .../pherf/configuration/XMLConfigParser.java| 23 +++---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 28 +---
 .../phoenix/pherf/workload/WriteWorkload.java   | 36 +-
 .../datamodel/test_schema_mt_table.sql  | 31 
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 ++
 8 files changed, 187 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/975b8fe7/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 8a340b3..2b9d309 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,8 +18,19 @@
 
 package org.apache.phoenix.pherf;
 
-import com.jcabi.jdbc.JdbcSession;
-import com.jcabi.jdbc.Outcome;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -33,15 +44,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -144,4 +148,52 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+// Assert
+assertExpectedNumberOfRecordsWritten(scenario);
+
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertTrue("Could not query any rows for in " + 
scenario.getTableName(), count > 0);
+assertEquals("Expected 100 rows to have been inserted", 
scenario.getRowCount(), count.intValue());
+}
+
+
+

phoenix git commit: PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a multi-tenant view.

2015-08-10 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 60500f253 -> c811cf687


PHOENIX-1791. Adding ability for Pherf Write Workloads to write to a 
multi-tenant view.


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

Branch: refs/heads/master
Commit: c811cf68752b91585fc9c12741f3be005fefbe2f
Parents: 60500f2
Author: Jan 
Authored: Thu Aug 6 11:12:52 2015 -0700
Committer: Cody Marcel 
Committed: Mon Aug 10 10:02:18 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 67 +---
 .../phoenix/pherf/configuration/Scenario.java   | 25 ++--
 .../pherf/configuration/XMLConfigParser.java| 23 ---
 .../apache/phoenix/pherf/util/PhoenixUtil.java  | 30 +
 .../phoenix/pherf/workload/WriteWorkload.java   | 49 +-
 .../datamodel/test_schema_mt_table.sql  | 31 +
 .../resources/datamodel/test_schema_mt_view.sql |  1 +
 .../test/resources/scenario/test_scenario.xml   | 22 +++
 8 files changed, 198 insertions(+), 50 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c811cf68/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 1defbb1..297f882 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -22,6 +22,19 @@ import com.jcabi.jdbc.JdbcSession;
 import com.jcabi.jdbc.Outcome;
 
 import org.apache.phoenix.pherf.PherfConstants.GeneratePhoenixStats;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataModel;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
@@ -35,15 +48,8 @@ import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
+import com.jcabi.jdbc.JdbcSession;
+import com.jcabi.jdbc.Outcome;
 
 public class DataIngestIT extends ResultBaseTestIT {
 
@@ -146,4 +152,47 @@ public class DataIngestIT extends ResultBaseTestIT {
 fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
 }
 }
+
+
+@Test
+/**
+ * Validates that Pherf can write data to a Multi-Tenant View in addition 
to 
+ * standard Phoenix tables.
+ */
+public void testMultiTenantViewWriteWorkload() throws Exception {
+// Arrange
+Scenario scenario = parser.getScenarioByName("testMTWriteScenario");
+WorkloadExecutor executor = new WorkloadExecutor();
+executor.add(new WriteWorkload(util, parser, scenario, 
GeneratePhoenixStats.NO));
+
+// Act
+try {
+// Wait for data to load up.
+executor.get();
+executor.shutdown();
+} catch (Exception e) {
+fail("Failed to load data. An exception was thrown: " + 
e.getMessage());
+}
+
+assertExpectedNumberOfRecordsWritten(scenario);
+}
+
+private void assertExpectedNumberOfRecordsWritten(Scenario scenario) 
throws Exception,
+SQLException {
+Connection connection = util.getConnection(scenario.getTenantId());
+String sql = "select count(*) from " + scenario.getTableName();
+Integer count = new JdbcSession(connection).sql(sql).select(new 
Outcome() {
+@Override public Integer handle(ResultSet resultSet, Statement 
statement)
+throws SQLException {
+while (resultSet.next()) {
+return resultSet.getInt(1);
+}
+return null;
+}
+});
+assertNotNull("Could not retrieve count. " + count);
+assertEquals("Expected 100 rows to have been inserted",
+scenario.getRowCount(), count.intValue());
+}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c811

phoenix git commit: PHOENIX-2109 - Joda time version conflict between phoenix and pherf

2015-07-13 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 35b7776e7 -> 8d003ad64


PHOENIX-2109 - Joda time version conflict between phoenix and pherf


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 8d003ad6465b39fea8e09cee97703601d5a57503
Parents: 35b7776
Author: Cody Marcel 
Authored: Mon Jul 13 14:32:28 2015 -0700
Committer: Cody Marcel 
Committed: Mon Jul 13 14:32:28 2015 -0700

--
 phoenix-pherf/pom.xml| 2 +-
 .../src/it/java/org/apache/phoenix/pherf/DataIngestIT.java   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8d003ad6/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 577ace9..f3482eb 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -219,7 +219,7 @@
 
 joda-time
 joda-time
-1.6.2
+${jodatime.version}
 
 
 com.googlecode.java-diff-utils

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8d003ad6/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 828ac38..8a340b3 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -27,6 +27,7 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
 import org.apache.phoenix.pherf.workload.QueryExecutor;
+import org.apache.phoenix.pherf.workload.Workload;
 import org.apache.phoenix.pherf.workload.WorkloadExecutor;
 import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
@@ -68,6 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 WriteWorkload loader = new WriteWorkload(util, parser, scenario);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
+executor.get();
 
 RulesApplier rulesApplier = loader.getRulesApplier();
 List modelList = rulesApplier.getModelList();
@@ -90,6 +92,12 @@ public class DataIngestIT extends ResultBaseTestIT {
 data.getDistribution() == Integer.MIN_VALUE);
 }
 }
+
+// Run some queries
+Workload query = new QueryExecutor(parser, util, 
executor.getPool());
+executor.add(query);
+executor.get();
+
 } catch (Exception e) {
 fail("We had an exception: " + e.getMessage());
 }



phoenix git commit: PHOENIX-2109 - Joda time version conflict between phoenix and pherf

2015-07-13 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 54e98aa4a -> fae7ee04a


PHOENIX-2109 - Joda time version conflict between phoenix and pherf


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

Branch: refs/heads/4.x-HBase-0.98
Commit: fae7ee04a50460c8b2255f26340510f3120f26c9
Parents: 54e98aa
Author: Cody Marcel 
Authored: Mon Jul 13 14:31:07 2015 -0700
Committer: Cody Marcel 
Committed: Mon Jul 13 14:31:07 2015 -0700

--
 phoenix-pherf/pom.xml| 2 +-
 .../src/it/java/org/apache/phoenix/pherf/DataIngestIT.java   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/fae7ee04/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index bc4a07a..9bdd583 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -218,7 +218,7 @@
 
 joda-time
 joda-time
-1.6.2
+${jodatime.version}
 
 
 com.googlecode.java-diff-utils

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fae7ee04/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 828ac38..8a340b3 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -27,6 +27,7 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
 import org.apache.phoenix.pherf.workload.QueryExecutor;
+import org.apache.phoenix.pherf.workload.Workload;
 import org.apache.phoenix.pherf.workload.WorkloadExecutor;
 import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
@@ -68,6 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 WriteWorkload loader = new WriteWorkload(util, parser, scenario);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
+executor.get();
 
 RulesApplier rulesApplier = loader.getRulesApplier();
 List modelList = rulesApplier.getModelList();
@@ -90,6 +92,12 @@ public class DataIngestIT extends ResultBaseTestIT {
 data.getDistribution() == Integer.MIN_VALUE);
 }
 }
+
+// Run some queries
+Workload query = new QueryExecutor(parser, util, 
executor.getPool());
+executor.add(query);
+executor.get();
+
 } catch (Exception e) {
 fail("We had an exception: " + e.getMessage());
 }



phoenix git commit: PHOENIX-2109 - Joda time version conflict between phoenix and pherf

2015-07-13 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 26e8cf244 -> eeefd6d12


PHOENIX-2109 - Joda time version conflict between phoenix and pherf


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

Branch: refs/heads/4.4-HBase-1.1
Commit: eeefd6d12fd3a6ffc58e1674ddacec6986307c38
Parents: 26e8cf2
Author: Cody Marcel 
Authored: Mon Jul 13 14:28:14 2015 -0700
Committer: Cody Marcel 
Committed: Mon Jul 13 14:28:14 2015 -0700

--
 phoenix-pherf/pom.xml| 2 +-
 .../src/it/java/org/apache/phoenix/pherf/DataIngestIT.java   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/eeefd6d1/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index a852a85..b6b9130 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -219,7 +219,7 @@
 
 joda-time
 joda-time
-1.6.2
+${jodatime.version}
 
 
 com.googlecode.java-diff-utils

http://git-wip-us.apache.org/repos/asf/phoenix/blob/eeefd6d1/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 828ac38..8a340b3 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -27,6 +27,7 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
 import org.apache.phoenix.pherf.workload.QueryExecutor;
+import org.apache.phoenix.pherf.workload.Workload;
 import org.apache.phoenix.pherf.workload.WorkloadExecutor;
 import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
@@ -68,6 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 WriteWorkload loader = new WriteWorkload(util, parser, scenario);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
+executor.get();
 
 RulesApplier rulesApplier = loader.getRulesApplier();
 List modelList = rulesApplier.getModelList();
@@ -90,6 +92,12 @@ public class DataIngestIT extends ResultBaseTestIT {
 data.getDistribution() == Integer.MIN_VALUE);
 }
 }
+
+// Run some queries
+Workload query = new QueryExecutor(parser, util, 
executor.getPool());
+executor.add(query);
+executor.get();
+
 } catch (Exception e) {
 fail("We had an exception: " + e.getMessage());
 }



phoenix git commit: PHOENIX-2109 - Joda time version conflict between phoenix and pherf

2015-07-13 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.0 4ffdcdeea -> d226c6a63


PHOENIX-2109 - Joda time version conflict between phoenix and pherf


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

Branch: refs/heads/4.4-HBase-1.0
Commit: d226c6a63d118da109299aa8d9f82001c4d8d61f
Parents: 4ffdcde
Author: Cody Marcel 
Authored: Mon Jul 13 14:27:09 2015 -0700
Committer: Cody Marcel 
Committed: Mon Jul 13 14:27:09 2015 -0700

--
 phoenix-pherf/pom.xml| 2 +-
 .../src/it/java/org/apache/phoenix/pherf/DataIngestIT.java   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d226c6a6/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index dc03af4..f987a8c 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -219,7 +219,7 @@
 
 joda-time
 joda-time
-1.6.2
+${jodatime.version}
 
 
 com.googlecode.java-diff-utils

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d226c6a6/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 828ac38..8a340b3 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -27,6 +27,7 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
 import org.apache.phoenix.pherf.workload.QueryExecutor;
+import org.apache.phoenix.pherf.workload.Workload;
 import org.apache.phoenix.pherf.workload.WorkloadExecutor;
 import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
@@ -68,6 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 WriteWorkload loader = new WriteWorkload(util, parser, scenario);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
+executor.get();
 
 RulesApplier rulesApplier = loader.getRulesApplier();
 List modelList = rulesApplier.getModelList();
@@ -90,6 +92,12 @@ public class DataIngestIT extends ResultBaseTestIT {
 data.getDistribution() == Integer.MIN_VALUE);
 }
 }
+
+// Run some queries
+Workload query = new QueryExecutor(parser, util, 
executor.getPool());
+executor.add(query);
+executor.get();
+
 } catch (Exception e) {
 fail("We had an exception: " + e.getMessage());
 }



phoenix git commit: PHOENIX-2109 - Joda time version conflict between phoenix and pherf

2015-07-13 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-0.98 7fa989ad2 -> 421f851dc


PHOENIX-2109 - Joda time version conflict between phoenix and pherf


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

Branch: refs/heads/4.4-HBase-0.98
Commit: 421f851dc4b5352527cae0413f207ca13c28cd25
Parents: 7fa989a
Author: Cody Marcel 
Authored: Mon Jul 13 14:25:58 2015 -0700
Committer: Cody Marcel 
Committed: Mon Jul 13 14:25:58 2015 -0700

--
 phoenix-pherf/pom.xml| 2 +-
 .../src/it/java/org/apache/phoenix/pherf/DataIngestIT.java   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/421f851d/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 9319a7d..1b3f0a1 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -219,7 +219,7 @@
 
 joda-time
 joda-time
-1.6.2
+${jodatime.version}
 
 
 com.googlecode.java-diff-utils

http://git-wip-us.apache.org/repos/asf/phoenix/blob/421f851d/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 828ac38..8a340b3 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -27,6 +27,7 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
 import org.apache.phoenix.pherf.workload.QueryExecutor;
+import org.apache.phoenix.pherf.workload.Workload;
 import org.apache.phoenix.pherf.workload.WorkloadExecutor;
 import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
@@ -68,6 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 WriteWorkload loader = new WriteWorkload(util, parser, scenario);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
+executor.get();
 
 RulesApplier rulesApplier = loader.getRulesApplier();
 List modelList = rulesApplier.getModelList();
@@ -90,6 +92,12 @@ public class DataIngestIT extends ResultBaseTestIT {
 data.getDistribution() == Integer.MIN_VALUE);
 }
 }
+
+// Run some queries
+Workload query = new QueryExecutor(parser, util, 
executor.getPool());
+executor.add(query);
+executor.get();
+
 } catch (Exception e) {
 fail("We had an exception: " + e.getMessage());
 }



phoenix git commit: PHOENIX-2109 - Joda time version conflict between phoenix and pherf

2015-07-13 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 70c542d8e -> a772a4a0c


PHOENIX-2109 - Joda time version conflict between phoenix and pherf


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

Branch: refs/heads/master
Commit: a772a4a0ca3c9ac98335ce2148eb2b34d3ce1369
Parents: 70c542d
Author: Cody Marcel 
Authored: Mon Jul 13 14:23:53 2015 -0700
Committer: Cody Marcel 
Committed: Mon Jul 13 14:23:53 2015 -0700

--
 phoenix-pherf/pom.xml| 2 +-
 .../src/it/java/org/apache/phoenix/pherf/DataIngestIT.java   | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a772a4a0/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 0facbde..4d27305 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -219,7 +219,7 @@
 
 joda-time
 joda-time
-1.6.2
+${jodatime.version}
 
 
 com.googlecode.java-diff-utils

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a772a4a0/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 828ac38..8a340b3 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -27,6 +27,7 @@ import org.apache.phoenix.pherf.configuration.Scenario;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
 import org.apache.phoenix.pherf.workload.QueryExecutor;
+import org.apache.phoenix.pherf.workload.Workload;
 import org.apache.phoenix.pherf.workload.WorkloadExecutor;
 import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.junit.Before;
@@ -68,6 +69,7 @@ public class DataIngestIT extends ResultBaseTestIT {
 WriteWorkload loader = new WriteWorkload(util, parser, scenario);
 WorkloadExecutor executor = new WorkloadExecutor();
 executor.add(loader);
+executor.get();
 
 RulesApplier rulesApplier = loader.getRulesApplier();
 List modelList = rulesApplier.getModelList();
@@ -90,6 +92,12 @@ public class DataIngestIT extends ResultBaseTestIT {
 data.getDistribution() == Integer.MIN_VALUE);
 }
 }
+
+// Run some queries
+Workload query = new QueryExecutor(parser, util, 
executor.getPool());
+executor.add(query);
+executor.get();
+
 } catch (Exception e) {
 fail("We had an exception: " + e.getMessage());
 }



phoenix git commit: PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 f76b92fd8 -> f2c4964f3


PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module


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

Branch: refs/heads/4.x-HBase-0.98
Commit: f2c4964f3623d4726f6cd16601f78da4bee1e201
Parents: f76b92f
Author: cmarcel 
Authored: Fri Jun 26 10:18:28 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 10:18:28 2015 -0700

--
 .../pherf/workload/MultithreadedDiffer.java |  7 ++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 26 ++--
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f2c4964f/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
index 1735754..91189e2 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
@@ -21,20 +21,18 @@ package org.apache.phoenix.pherf.workload;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.configuration.Query;
 import org.apache.phoenix.pherf.result.RunTime;
 import org.apache.phoenix.pherf.result.ThreadTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class MultithreadedDiffer implements Runnable {
 private static final Logger logger = 
LoggerFactory.getLogger(MultiThreadedRunner.class);
 private Thread t;
 private Query query;
 private ThreadTime threadTime;
-private String threadName;
 private long numberOfExecutions;
 private long executionDurationInMs;
 private QueryVerifier queryVerifier = new QueryVerifier(true);
@@ -72,7 +70,6 @@ class MultithreadedDiffer implements Runnable {
 MultithreadedDiffer(String threadName, Query query, ThreadTime threadTime,
 long numberOfExecutions, long executionDurationInMs) {
 this.query = query;
-this.threadName = threadName;
 this.threadTime = threadTime;
 this.numberOfExecutions = numberOfExecutions;
 this.executionDurationInMs = executionDurationInMs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f2c4964f/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
index 92604d4..936eedb 100644
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
+++ 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
@@ -18,22 +18,32 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.pherf.configuration.*;
-import org.apache.phoenix.pherf.workload.WriteWorkload;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataModel;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.junit.Test;
 
-import java.util.*;
-
-import static org.junit.Assert.*;
-
 public class RuleGeneratorTest {
-private static PhoenixUtil util = PhoenixUtil.create(true);
 private static final String matcherScenario = 
PherfConstants.SCENARIO_ROOT_PATTERN + ".xml";
 
 @Test



[2/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads - port form paster

2015-06-26 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/f76b92fd/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index fd960d1..07dfa86 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -22,15 +22,16 @@ import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.PherfConstants.RunMode;
 import org.apache.phoenix.pherf.result.file.ResultFileDetails;
 import org.apache.phoenix.pherf.result.impl.CSVResultHandler;
-import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
-import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
 import java.text.Format;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class ResultUtil {
 
@@ -54,7 +55,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 
rowValues.addAll(writeThreadTime.getCsvRepresentation(this));
-Result result = new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE, "ZK," + 
dataLoadThreadTime.getCsvTitle(), rowValues);
+Result
+result =
+new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE,
+"ZK," + dataLoadThreadTime.getCsvTitle(), 
rowValues);
 writer.write(result);
 }
 }
@@ -83,7 +87,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 rowValues.addAll(loadTime.getCsvRepresentation(this));
-Result result = new Result(resultFileDetails, 
resultFileDetails.getHeader().toString(), rowValues);
+Result
+result =
+new Result(resultFileDetails, 
resultFileDetails.getHeader().toString(),
+rowValues);
 writer.write(result);
 }
 } finally {
@@ -94,23 +101,29 @@ public class ResultUtil {
 }
 }
 
-public synchronized void write(ResultHandler resultHandler, 
DataModelResult dataModelResult, RunMode runMode) throws Exception {
+public synchronized void write(ResultHandler resultHandler, 
DataModelResult dataModelResult,
+RunMode runMode) throws Exception {
 ResultFileDetails resultFileDetails = 
resultHandler.getResultFileDetails();
 switch (resultFileDetails) {
-case CSV_AGGREGATE_PERFORMANCE:
-case CSV_DETAILED_PERFORMANCE:
-case CSV_DETAILED_FUNCTIONAL:
-List> rowDetails = 
getCSVResults(dataModelResult, resultFileDetails, runMode);
-for (List row : rowDetails) {
-Result result = new Result(resultFileDetails, 
resultFileDetails.getHeader().toString(), row);
-resultHandler.write(result);
-}
-break;
-default:
-List resultValue = new ArrayList();
-resultValue.add(new ResultValue<>(dataModelResult));
-resultHandler.write(new Result(resultFileDetails, null, 
resultValue));
-break;
+case CSV_AGGREGATE_PERFORMANCE:
+case CSV_DETAILED_PERFORMANCE:
+case CSV_DETAILED_FUNCTIONAL:
+List>
+rowDetails =
+getCSVResults(dataModelResult, resultFileDetails, runMode);
+for (List row : rowDetails) {
+Result
+result =
+new Result(resultFileDetails, 
resultFileDetails.getHeader().toString(),
+row);
+resultHandler.write(result);
+}
+break;
+default:
+List resultValue = new ArrayList();
+resultValue.add(new ResultValue<>(dataModelResult));
+resultHandler.write(new Result(resultFileDetails, null, 
resultValue));
+break;
 }
 }
 
@@ -146,40 +159,47 @@ public class ResultUtil {
 return str;
 }
 
-private List> getCSVResults(DataModelResult 
dataModelResult, ResultFileDetails resultFileDetails, RunMode runMode) {
+private List> getCSVResults(DataModelResult 
dataModelResult,
+Resu

[3/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads - port form paster

2015-06-26 Thread codymarcel
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads - port form paster


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

Branch: refs/heads/4.x-HBase-0.98
Commit: f76b92fd8571b83e9529116ad69c7f8353778944
Parents: 65361f3
Author: cmarcel 
Authored: Fri Jun 26 10:15:31 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 10:15:31 2015 -0700

--
 phoenix-pherf/pom.xml   |   9 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 134 --
 .../org/apache/phoenix/pherf/PherfMainIT.java   |  36 ++
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |  31 +-
 .../apache/phoenix/pherf/SchemaReaderIT.java|  17 +-
 .../java/org/apache/phoenix/pherf/Pherf.java| 179 +---
 .../apache/phoenix/pherf/PherfConstants.java|   8 +-
 .../phoenix/pherf/configuration/DataModel.java  |  10 -
 .../phoenix/pherf/configuration/Scenario.java   |  12 +-
 .../pherf/configuration/WriteParams.java|  72 +++
 .../pherf/configuration/XMLConfigParser.java|  25 +-
 .../phoenix/pherf/jmx/MonitorManager.java   | 153 ---
 .../phoenix/pherf/loaddata/DataLoader.java  | 332 --
 .../pherf/result/DataLoadThreadTime.java|  87 ++--
 .../pherf/result/DataLoadTimeSummary.java   |  54 +--
 .../phoenix/pherf/result/DataModelResult.java   |  68 ++-
 .../phoenix/pherf/result/QueryResult.java   |  17 +-
 .../phoenix/pherf/result/QuerySetResult.java|  40 +-
 .../org/apache/phoenix/pherf/result/Result.java |  11 +-
 .../phoenix/pherf/result/ResultHandler.java |   5 +
 .../phoenix/pherf/result/ResultManager.java |  19 +-
 .../apache/phoenix/pherf/result/ResultUtil.java | 119 +++--
 .../phoenix/pherf/result/ResultValue.java   |   4 +-
 .../apache/phoenix/pherf/result/RunTime.java| 179 
 .../phoenix/pherf/result/ScenarioResult.java|  44 +-
 .../apache/phoenix/pherf/result/ThreadTime.java |  34 +-
 .../phoenix/pherf/result/file/Extension.java|   3 +-
 .../phoenix/pherf/result/file/Header.java   |  11 +-
 .../pherf/result/impl/CSVResultHandler.java |  47 +-
 .../pherf/result/impl/ImageResultHandler.java   |  58 +--
 .../pherf/result/impl/XMLResultHandler.java |  36 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   2 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  64 ++-
 .../pherf/workload/MultiThreadedRunner.java | 153 +++
 .../pherf/workload/MultithreadedDiffer.java | 131 +++---
 .../pherf/workload/MultithreadedRunner.java | 170 ---
 .../phoenix/pherf/workload/QueryExecutor.java   | 459 ++-
 .../phoenix/pherf/workload/QueryVerifier.java   | 265 +--
 .../apache/phoenix/pherf/workload/Workload.java |  10 +
 .../pherf/workload/WorkloadExecutor.java| 109 ++---
 .../phoenix/pherf/workload/WriteWorkload.java   | 403 
 .../scenario/prod_test_unsalted_scenario.xml|  35 ++
 .../phoenix/pherf/ConfigurationParserTest.java  | 102 +++--
 .../org/apache/phoenix/pherf/ResultTest.java|   5 +-
 .../apache/phoenix/pherf/RuleGeneratorTest.java |  15 +-
 .../test/resources/scenario/test_scenario.xml   |  58 ++-
 46 files changed, 2168 insertions(+), 1667 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f76b92fd/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 5146f4d..bc4a07a 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -15,8 +15,8 @@
   ~   See the License for the specific language governing permissions and
   ~   limitations under the License.
   -->
-
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
@@ -233,6 +233,11 @@
 
 
 
+com.jcabi
+jcabi-jdbc
+0.15
+
+
 junit
 junit
 4.11

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f76b92fd/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index 2b56f43..828ac38 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pher

[1/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads - port form paster

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 65361f357 -> f76b92fd8


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f76b92fd/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
index 78f18ca..c9333a0 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
@@ -43,153 +43,160 @@ import difflib.DiffUtils;
 import difflib.Patch;
 
 public class QueryVerifier {
-   private PhoenixUtil pUtil = new PhoenixUtil();
-   private static final Logger logger = LoggerFactory
-   .getLogger(QueryVerifier.class);
-   private boolean useTemporaryOutput;
-   private String directoryLocation;
-
-   public QueryVerifier(boolean useTemporaryOutput) {
-   this.useTemporaryOutput = useTemporaryOutput;
-   this.directoryLocation = this.useTemporaryOutput ? 
-   PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
-   
-   ensureBaseDirExists();
-   }
-   
-   /***
-* Export query resultSet to CSV file
-* @param query
-* @throws Exception
-*/
-   public String exportCSV(Query query) throws Exception {
-   Connection conn = null;
-   PreparedStatement statement = null;
-   ResultSet rs = null;
-   String fileName = getFileName(query);
-   FileOutputStream fos = new FileOutputStream(fileName);
-   try {
-   conn = pUtil.getConnection(query.getTenantId());
-   statement = conn.prepareStatement(query.getStatement());
-   boolean isQuery = statement.execute();
-   if (isQuery) {
-   rs = statement.executeQuery();
-   int columnCount = 
rs.getMetaData().getColumnCount();
-   while (rs.next()) {
-   for (int columnNum = 1; columnNum <= 
columnCount; columnNum++) {
-   
fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER).getBytes());
-   }
-   
fos.write(PherfConstants.NEW_LINE.getBytes());
-   }
-   } else {
-   conn.commit();
-   }
-   } catch (Exception e) {
-   e.printStackTrace();
-   } finally {
-   if (rs != null) rs.close();
-   if (statement != null) statement.close();
-   if (conn != null) conn.close();
-   fos.flush();
-   fos.close();
-   }
-   return fileName;
-   }
-   
-   /***
-* Do a diff between exported query results and temporary CSV file
-* @param query
-* @param newCSV
-* @return
-*/
-   public boolean doDiff(Query query, String newCSV) {
+private PhoenixUtil pUtil = PhoenixUtil.create();
+private static final Logger logger = 
LoggerFactory.getLogger(QueryVerifier.class);
+private boolean useTemporaryOutput;
+private String directoryLocation;
+
+public QueryVerifier(boolean useTemporaryOutput) {
+this.useTemporaryOutput = useTemporaryOutput;
+this.directoryLocation =
+this.useTemporaryOutput ? PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
+
+ensureBaseDirExists();
+}
+
+/**
+ * Export query resultSet to CSV file
+ *
+ * @param query
+ * @throws Exception
+ */
+public String exportCSV(Query query) throws Exception {
+Connection conn = null;
+PreparedStatement statement = null;
+ResultSet rs = null;
+String fileName = getFileName(query);
+FileOutputStream fos = new FileOutputStream(fileName);
+try {
+conn = pUtil.getConnection(query.getTenantId());
+statement = conn.prepareStatement(query.getStatement());
+boolean isQuery = statement.execute();
+if (isQuery) {
+rs = statement.executeQuery();
+int columnCount = rs.getMetaData().getColumnCount();
+while (rs.next()) {
+for (int columnNum = 1; columnNum <= columnCount; 
columnNum++) {
+fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER)
+ 

phoenix git commit: PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 bc3de5a3b -> a60436521


PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module


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

Branch: refs/heads/4.x-HBase-1.0
Commit: a60436521165b68f80b540ef8f3361e1a0ab22ec
Parents: bc3de5a
Author: cmarcel 
Authored: Fri Jun 26 09:20:56 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 09:20:56 2015 -0700

--
 .../pherf/workload/MultithreadedDiffer.java |  7 ++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 26 ++--
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a6043652/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
index 1735754..91189e2 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
@@ -21,20 +21,18 @@ package org.apache.phoenix.pherf.workload;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.configuration.Query;
 import org.apache.phoenix.pherf.result.RunTime;
 import org.apache.phoenix.pherf.result.ThreadTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class MultithreadedDiffer implements Runnable {
 private static final Logger logger = 
LoggerFactory.getLogger(MultiThreadedRunner.class);
 private Thread t;
 private Query query;
 private ThreadTime threadTime;
-private String threadName;
 private long numberOfExecutions;
 private long executionDurationInMs;
 private QueryVerifier queryVerifier = new QueryVerifier(true);
@@ -72,7 +70,6 @@ class MultithreadedDiffer implements Runnable {
 MultithreadedDiffer(String threadName, Query query, ThreadTime threadTime,
 long numberOfExecutions, long executionDurationInMs) {
 this.query = query;
-this.threadName = threadName;
 this.threadTime = threadTime;
 this.numberOfExecutions = numberOfExecutions;
 this.executionDurationInMs = executionDurationInMs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a6043652/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
index 92604d4..936eedb 100644
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
+++ 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
@@ -18,22 +18,32 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.pherf.configuration.*;
-import org.apache.phoenix.pherf.workload.WriteWorkload;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataModel;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.junit.Test;
 
-import java.util.*;
-
-import static org.junit.Assert.*;
-
 public class RuleGeneratorTest {
-private static PhoenixUtil util = PhoenixUtil.create(true);
 private static final String matcherScenario = 
PherfConstants.SCENARIO_ROOT_PATTERN + ".xml";
 
 @Test



phoenix git commit: PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 4852cee55 -> 319bc7c55


PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module


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

Branch: refs/heads/4.4-HBase-1.1
Commit: 319bc7c55442392e95ff2923085942060e8805d5
Parents: 4852cee
Author: cmarcel 
Authored: Fri Jun 26 09:14:43 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 09:14:43 2015 -0700

--
 .../pherf/workload/MultithreadedDiffer.java |  7 ++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 26 ++--
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/319bc7c5/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
index 1735754..91189e2 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
@@ -21,20 +21,18 @@ package org.apache.phoenix.pherf.workload;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.configuration.Query;
 import org.apache.phoenix.pherf.result.RunTime;
 import org.apache.phoenix.pherf.result.ThreadTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class MultithreadedDiffer implements Runnable {
 private static final Logger logger = 
LoggerFactory.getLogger(MultiThreadedRunner.class);
 private Thread t;
 private Query query;
 private ThreadTime threadTime;
-private String threadName;
 private long numberOfExecutions;
 private long executionDurationInMs;
 private QueryVerifier queryVerifier = new QueryVerifier(true);
@@ -72,7 +70,6 @@ class MultithreadedDiffer implements Runnable {
 MultithreadedDiffer(String threadName, Query query, ThreadTime threadTime,
 long numberOfExecutions, long executionDurationInMs) {
 this.query = query;
-this.threadName = threadName;
 this.threadTime = threadTime;
 this.numberOfExecutions = numberOfExecutions;
 this.executionDurationInMs = executionDurationInMs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/319bc7c5/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
index 92604d4..936eedb 100644
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
+++ 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
@@ -18,22 +18,32 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.pherf.configuration.*;
-import org.apache.phoenix.pherf.workload.WriteWorkload;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataModel;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.junit.Test;
 
-import java.util.*;
-
-import static org.junit.Assert.*;
-
 public class RuleGeneratorTest {
-private static PhoenixUtil util = PhoenixUtil.create(true);
 private static final String matcherScenario = 
PherfConstants.SCENARIO_ROOT_PATTERN + ".xml";
 
 @Test



phoenix git commit: PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.0 cbd63ca2e -> 70da90617


PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module


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

Branch: refs/heads/4.4-HBase-1.0
Commit: 70da9061731d429818e4948cdb4bae73ee949875
Parents: cbd63ca
Author: cmarcel 
Authored: Fri Jun 26 09:13:35 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 09:13:35 2015 -0700

--
 .../pherf/workload/MultithreadedDiffer.java |  7 ++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 26 ++--
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/70da9061/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
index 1735754..91189e2 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
@@ -21,20 +21,18 @@ package org.apache.phoenix.pherf.workload;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.configuration.Query;
 import org.apache.phoenix.pherf.result.RunTime;
 import org.apache.phoenix.pherf.result.ThreadTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class MultithreadedDiffer implements Runnable {
 private static final Logger logger = 
LoggerFactory.getLogger(MultiThreadedRunner.class);
 private Thread t;
 private Query query;
 private ThreadTime threadTime;
-private String threadName;
 private long numberOfExecutions;
 private long executionDurationInMs;
 private QueryVerifier queryVerifier = new QueryVerifier(true);
@@ -72,7 +70,6 @@ class MultithreadedDiffer implements Runnable {
 MultithreadedDiffer(String threadName, Query query, ThreadTime threadTime,
 long numberOfExecutions, long executionDurationInMs) {
 this.query = query;
-this.threadName = threadName;
 this.threadTime = threadTime;
 this.numberOfExecutions = numberOfExecutions;
 this.executionDurationInMs = executionDurationInMs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/70da9061/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
index 92604d4..936eedb 100644
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
+++ 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
@@ -18,22 +18,32 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.pherf.configuration.*;
-import org.apache.phoenix.pherf.workload.WriteWorkload;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataModel;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.junit.Test;
 
-import java.util.*;
-
-import static org.junit.Assert.*;
-
 public class RuleGeneratorTest {
-private static PhoenixUtil util = PhoenixUtil.create(true);
 private static final String matcherScenario = 
PherfConstants.SCENARIO_ROOT_PATTERN + ".xml";
 
 @Test



phoenix git commit: PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-0.98 78f5915f9 -> dd5e565ec


PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module


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

Branch: refs/heads/4.4-HBase-0.98
Commit: dd5e565ecc11583ca71f87bd2b09bc483435379f
Parents: 78f5915
Author: cmarcel 
Authored: Fri Jun 26 09:12:14 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 09:12:14 2015 -0700

--
 .../pherf/workload/MultithreadedDiffer.java |  7 ++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 26 ++--
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dd5e565e/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
index 1735754..91189e2 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
@@ -21,20 +21,18 @@ package org.apache.phoenix.pherf.workload;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.configuration.Query;
 import org.apache.phoenix.pherf.result.RunTime;
 import org.apache.phoenix.pherf.result.ThreadTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class MultithreadedDiffer implements Runnable {
 private static final Logger logger = 
LoggerFactory.getLogger(MultiThreadedRunner.class);
 private Thread t;
 private Query query;
 private ThreadTime threadTime;
-private String threadName;
 private long numberOfExecutions;
 private long executionDurationInMs;
 private QueryVerifier queryVerifier = new QueryVerifier(true);
@@ -72,7 +70,6 @@ class MultithreadedDiffer implements Runnable {
 MultithreadedDiffer(String threadName, Query query, ThreadTime threadTime,
 long numberOfExecutions, long executionDurationInMs) {
 this.query = query;
-this.threadName = threadName;
 this.threadTime = threadTime;
 this.numberOfExecutions = numberOfExecutions;
 this.executionDurationInMs = executionDurationInMs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/dd5e565e/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
index 92604d4..936eedb 100644
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
+++ 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
@@ -18,22 +18,32 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.pherf.configuration.*;
-import org.apache.phoenix.pherf.workload.WriteWorkload;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataModel;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.junit.Test;
 
-import java.util.*;
-
-import static org.junit.Assert.*;
-
 public class RuleGeneratorTest {
-private static PhoenixUtil util = PhoenixUtil.create(true);
 private static final String matcherScenario = 
PherfConstants.SCENARIO_ROOT_PATTERN + ".xml";
 
 @Test



phoenix git commit: PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module

2015-06-26 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 3e4933982 -> c1e57235b


PHOENIX-2072 - (James Taylor) Fix Eclipse compiler errors in pherf module


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

Branch: refs/heads/master
Commit: c1e57235b81af4fe847394f8288c9b679ee2d54f
Parents: 3e49339
Author: cmarcel 
Authored: Fri Jun 26 09:07:00 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 26 09:07:00 2015 -0700

--
 .../pherf/workload/MultithreadedDiffer.java |  7 ++
 .../apache/phoenix/pherf/RuleGeneratorTest.java | 26 ++--
 2 files changed, 20 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c1e57235/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
index 1735754..91189e2 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
@@ -21,20 +21,18 @@ package org.apache.phoenix.pherf.workload;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.configuration.Query;
 import org.apache.phoenix.pherf.result.RunTime;
 import org.apache.phoenix.pherf.result.ThreadTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class MultithreadedDiffer implements Runnable {
 private static final Logger logger = 
LoggerFactory.getLogger(MultiThreadedRunner.class);
 private Thread t;
 private Query query;
 private ThreadTime threadTime;
-private String threadName;
 private long numberOfExecutions;
 private long executionDurationInMs;
 private QueryVerifier queryVerifier = new QueryVerifier(true);
@@ -72,7 +70,6 @@ class MultithreadedDiffer implements Runnable {
 MultithreadedDiffer(String threadName, Query query, ThreadTime threadTime,
 long numberOfExecutions, long executionDurationInMs) {
 this.query = query;
-this.threadName = threadName;
 this.threadTime = threadTime;
 this.numberOfExecutions = numberOfExecutions;
 this.executionDurationInMs = executionDurationInMs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c1e57235/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
index 92604d4..936eedb 100644
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
+++ 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/RuleGeneratorTest.java
@@ -18,22 +18,32 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.pherf.configuration.*;
-import org.apache.phoenix.pherf.workload.WriteWorkload;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataModel;
+import org.apache.phoenix.pherf.configuration.DataSequence;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
 import org.apache.phoenix.pherf.rules.DataValue;
 import org.apache.phoenix.pherf.rules.RulesApplier;
-import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.apache.phoenix.pherf.workload.WriteWorkload;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.junit.Test;
 
-import java.util.*;
-
-import static org.junit.Assert.*;
-
 public class RuleGeneratorTest {
-private static PhoenixUtil util = PhoenixUtil.create(true);
 private static final String matcherScenario = 
PherfConstants.SCENARIO_ROOT_PATTERN + ".xml";
 
 @Test



phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads. Fixing version back in pom.

2015-06-23 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 6749d4469 -> ee9764f9c


PHOENIX-1920 - Pherf - Add support for mixed r/w workloads. Fixing version back 
in pom.


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

Branch: refs/heads/4.x-HBase-1.0
Commit: ee9764f9c5cad1ad87c7df14ad51aa7cb503b14c
Parents: 6749d44
Author: cmarcel 
Authored: Tue Jun 23 16:01:20 2015 -0700
Committer: cmarcel 
Committed: Tue Jun 23 16:01:20 2015 -0700

--
 phoenix-pherf/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ee9764f9/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 0facbde..577ace9 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.phoenix
 phoenix
-4.5.0-SNAPSHOT
+4.5.0-HBase-1.0-SNAPSHOT
 
 
 phoenix-pherf



[1/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-23 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 855c88ab6 -> 6749d4469


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6749d446/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
index 78f18ca..c9333a0 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
@@ -43,153 +43,160 @@ import difflib.DiffUtils;
 import difflib.Patch;
 
 public class QueryVerifier {
-   private PhoenixUtil pUtil = new PhoenixUtil();
-   private static final Logger logger = LoggerFactory
-   .getLogger(QueryVerifier.class);
-   private boolean useTemporaryOutput;
-   private String directoryLocation;
-
-   public QueryVerifier(boolean useTemporaryOutput) {
-   this.useTemporaryOutput = useTemporaryOutput;
-   this.directoryLocation = this.useTemporaryOutput ? 
-   PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
-   
-   ensureBaseDirExists();
-   }
-   
-   /***
-* Export query resultSet to CSV file
-* @param query
-* @throws Exception
-*/
-   public String exportCSV(Query query) throws Exception {
-   Connection conn = null;
-   PreparedStatement statement = null;
-   ResultSet rs = null;
-   String fileName = getFileName(query);
-   FileOutputStream fos = new FileOutputStream(fileName);
-   try {
-   conn = pUtil.getConnection(query.getTenantId());
-   statement = conn.prepareStatement(query.getStatement());
-   boolean isQuery = statement.execute();
-   if (isQuery) {
-   rs = statement.executeQuery();
-   int columnCount = 
rs.getMetaData().getColumnCount();
-   while (rs.next()) {
-   for (int columnNum = 1; columnNum <= 
columnCount; columnNum++) {
-   
fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER).getBytes());
-   }
-   
fos.write(PherfConstants.NEW_LINE.getBytes());
-   }
-   } else {
-   conn.commit();
-   }
-   } catch (Exception e) {
-   e.printStackTrace();
-   } finally {
-   if (rs != null) rs.close();
-   if (statement != null) statement.close();
-   if (conn != null) conn.close();
-   fos.flush();
-   fos.close();
-   }
-   return fileName;
-   }
-   
-   /***
-* Do a diff between exported query results and temporary CSV file
-* @param query
-* @param newCSV
-* @return
-*/
-   public boolean doDiff(Query query, String newCSV) {
+private PhoenixUtil pUtil = PhoenixUtil.create();
+private static final Logger logger = 
LoggerFactory.getLogger(QueryVerifier.class);
+private boolean useTemporaryOutput;
+private String directoryLocation;
+
+public QueryVerifier(boolean useTemporaryOutput) {
+this.useTemporaryOutput = useTemporaryOutput;
+this.directoryLocation =
+this.useTemporaryOutput ? PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
+
+ensureBaseDirExists();
+}
+
+/**
+ * Export query resultSet to CSV file
+ *
+ * @param query
+ * @throws Exception
+ */
+public String exportCSV(Query query) throws Exception {
+Connection conn = null;
+PreparedStatement statement = null;
+ResultSet rs = null;
+String fileName = getFileName(query);
+FileOutputStream fos = new FileOutputStream(fileName);
+try {
+conn = pUtil.getConnection(query.getTenantId());
+statement = conn.prepareStatement(query.getStatement());
+boolean isQuery = statement.execute();
+if (isQuery) {
+rs = statement.executeQuery();
+int columnCount = rs.getMetaData().getColumnCount();
+while (rs.next()) {
+for (int columnNum = 1; columnNum <= columnCount; 
columnNum++) {
+fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER)
+  

[2/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-23 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/6749d446/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index 523feb4..39d6a9c 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -33,17 +33,13 @@ public class ResultManager {
 private final ResultUtil util;
 private final PherfConstants.RunMode runMode;
 
-
 public ResultManager(String fileNameSeed, PherfConstants.RunMode runMode) {
-this(runMode, Arrays.asList(
-new XMLResultHandler(fileNameSeed, ResultFileDetails.XML),
+this(runMode, Arrays.asList(new XMLResultHandler(fileNameSeed, 
ResultFileDetails.XML),
 new ImageResultHandler(fileNameSeed, ResultFileDetails.IMAGE),
-   new CSVResultHandler(
-   fileNameSeed,
-   runMode == 
RunMode.PERFORMANCE ? ResultFileDetails.CSV_DETAILED_PERFORMANCE
-   
: ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
-new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)
-));
+new CSVResultHandler(fileNameSeed, runMode == 
RunMode.PERFORMANCE ?
+ResultFileDetails.CSV_DETAILED_PERFORMANCE :
+ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
+new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)));
 }
 
 public ResultManager(PherfConstants.RunMode runMode, List 
resultHandlers) {
@@ -81,6 +77,7 @@ public class ResultManager {
 
 /**
  * Write a combined set of results for each result in the list.
+ *
  * @param dataModelResults List<{@link DataModelResult > }
  * @throws Exception
  */
@@ -89,7 +86,9 @@ public class ResultManager {
 
 CSVResultHandler detailsCSVWriter = null;
 try {
-detailsCSVWriter = new 
CSVResultHandler(PherfConstants.COMBINED_FILE_NAME, 
ResultFileDetails.CSV_DETAILED_PERFORMANCE);
+detailsCSVWriter =
+new CSVResultHandler(PherfConstants.COMBINED_FILE_NAME,
+ResultFileDetails.CSV_DETAILED_PERFORMANCE);
 for (DataModelResult dataModelResult : dataModelResults) {
 util.write(detailsCSVWriter, dataModelResult, runMode);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6749d446/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index fd960d1..07dfa86 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -22,15 +22,16 @@ import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.PherfConstants.RunMode;
 import org.apache.phoenix.pherf.result.file.ResultFileDetails;
 import org.apache.phoenix.pherf.result.impl.CSVResultHandler;
-import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
-import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
 import java.text.Format;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class ResultUtil {
 
@@ -54,7 +55,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 
rowValues.addAll(writeThreadTime.getCsvRepresentation(this));
-Result result = new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE, "ZK," + 
dataLoadThreadTime.getCsvTitle(), rowValues);
+Result
+result =
+new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE,
+"ZK," + dataLoadThreadTime.getCsvTitle(), 
rowValues);
 writer.write(result);
 }
 }
@@ -83,7 +87,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
   

[3/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-23 Thread codymarcel
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 6749d44694a2d757d47a3ff5293022f0ad33a019
Parents: 855c88a
Author: cmarcel 
Authored: Tue Jun 23 15:50:13 2015 -0700
Committer: cmarcel 
Committed: Tue Jun 23 15:50:13 2015 -0700

--
 phoenix-pherf/pom.xml   |  12 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 134 --
 .../org/apache/phoenix/pherf/PherfMainIT.java   |  36 ++
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |  31 +-
 .../apache/phoenix/pherf/SchemaReaderIT.java|  17 +-
 .../java/org/apache/phoenix/pherf/Pherf.java| 179 +---
 .../apache/phoenix/pherf/PherfConstants.java|   8 +-
 .../phoenix/pherf/configuration/DataModel.java  |  10 -
 .../phoenix/pherf/configuration/Scenario.java   |  12 +-
 .../pherf/configuration/WriteParams.java|  72 +++
 .../pherf/configuration/XMLConfigParser.java|  25 +-
 .../phoenix/pherf/jmx/MonitorManager.java   | 153 ---
 .../phoenix/pherf/loaddata/DataLoader.java  | 332 --
 .../pherf/result/DataLoadThreadTime.java|  87 ++--
 .../pherf/result/DataLoadTimeSummary.java   |  54 +--
 .../phoenix/pherf/result/DataModelResult.java   |  68 ++-
 .../phoenix/pherf/result/QueryResult.java   |  17 +-
 .../phoenix/pherf/result/QuerySetResult.java|  40 +-
 .../org/apache/phoenix/pherf/result/Result.java |  11 +-
 .../phoenix/pherf/result/ResultHandler.java |   5 +
 .../phoenix/pherf/result/ResultManager.java |  19 +-
 .../apache/phoenix/pherf/result/ResultUtil.java | 119 +++--
 .../phoenix/pherf/result/ResultValue.java   |   4 +-
 .../apache/phoenix/pherf/result/RunTime.java| 179 
 .../phoenix/pherf/result/ScenarioResult.java|  44 +-
 .../apache/phoenix/pherf/result/ThreadTime.java |  34 +-
 .../phoenix/pherf/result/file/Extension.java|   3 +-
 .../phoenix/pherf/result/file/Header.java   |  11 +-
 .../pherf/result/impl/CSVResultHandler.java |  47 +-
 .../pherf/result/impl/ImageResultHandler.java   |  58 +--
 .../pherf/result/impl/XMLResultHandler.java |  36 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   2 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  64 ++-
 .../pherf/workload/MultiThreadedRunner.java | 153 +++
 .../pherf/workload/MultithreadedDiffer.java | 131 +++---
 .../pherf/workload/MultithreadedRunner.java | 170 ---
 .../phoenix/pherf/workload/QueryExecutor.java   | 459 ++-
 .../phoenix/pherf/workload/QueryVerifier.java   | 265 +--
 .../apache/phoenix/pherf/workload/Workload.java |  10 +
 .../pherf/workload/WorkloadExecutor.java| 109 ++---
 .../phoenix/pherf/workload/WriteWorkload.java   | 403 
 .../scenario/prod_test_unsalted_scenario.xml|  35 ++
 .../phoenix/pherf/ConfigurationParserTest.java  | 102 +++--
 .../org/apache/phoenix/pherf/ResultTest.java|   5 +-
 .../apache/phoenix/pherf/RuleGeneratorTest.java |  15 +-
 .../test/resources/scenario/test_scenario.xml   |  58 ++-
 46 files changed, 2170 insertions(+), 1668 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6749d446/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index bfbaf0c..0facbde 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -16,13 +16,14 @@
   ~   limitations under the License.
   -->
 
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
 org.apache.phoenix
 phoenix
-4.5.0-HBase-1.0-SNAPSHOT
+4.5.0-SNAPSHOT
 
 
 phoenix-pherf
@@ -30,7 +31,7 @@
 Phoenix - Pherf
 
 
-  ${project.basedir}/..
+${project.basedir}/..
 
 
 
@@ -233,6 +234,11 @@
 
 
 
+com.jcabi
+jcabi-jdbc
+0.15
+
+
 junit
 junit
 4.11

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6749d446/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
in

[2/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-22 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/9165edb2/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index 523feb4..39d6a9c 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -33,17 +33,13 @@ public class ResultManager {
 private final ResultUtil util;
 private final PherfConstants.RunMode runMode;
 
-
 public ResultManager(String fileNameSeed, PherfConstants.RunMode runMode) {
-this(runMode, Arrays.asList(
-new XMLResultHandler(fileNameSeed, ResultFileDetails.XML),
+this(runMode, Arrays.asList(new XMLResultHandler(fileNameSeed, 
ResultFileDetails.XML),
 new ImageResultHandler(fileNameSeed, ResultFileDetails.IMAGE),
-   new CSVResultHandler(
-   fileNameSeed,
-   runMode == 
RunMode.PERFORMANCE ? ResultFileDetails.CSV_DETAILED_PERFORMANCE
-   
: ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
-new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)
-));
+new CSVResultHandler(fileNameSeed, runMode == 
RunMode.PERFORMANCE ?
+ResultFileDetails.CSV_DETAILED_PERFORMANCE :
+ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
+new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)));
 }
 
 public ResultManager(PherfConstants.RunMode runMode, List 
resultHandlers) {
@@ -81,6 +77,7 @@ public class ResultManager {
 
 /**
  * Write a combined set of results for each result in the list.
+ *
  * @param dataModelResults List<{@link DataModelResult > }
  * @throws Exception
  */
@@ -89,7 +86,9 @@ public class ResultManager {
 
 CSVResultHandler detailsCSVWriter = null;
 try {
-detailsCSVWriter = new 
CSVResultHandler(PherfConstants.COMBINED_FILE_NAME, 
ResultFileDetails.CSV_DETAILED_PERFORMANCE);
+detailsCSVWriter =
+new CSVResultHandler(PherfConstants.COMBINED_FILE_NAME,
+ResultFileDetails.CSV_DETAILED_PERFORMANCE);
 for (DataModelResult dataModelResult : dataModelResults) {
 util.write(detailsCSVWriter, dataModelResult, runMode);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9165edb2/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index fd960d1..07dfa86 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -22,15 +22,16 @@ import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.PherfConstants.RunMode;
 import org.apache.phoenix.pherf.result.file.ResultFileDetails;
 import org.apache.phoenix.pherf.result.impl.CSVResultHandler;
-import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
-import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
 import java.text.Format;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class ResultUtil {
 
@@ -54,7 +55,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 
rowValues.addAll(writeThreadTime.getCsvRepresentation(this));
-Result result = new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE, "ZK," + 
dataLoadThreadTime.getCsvTitle(), rowValues);
+Result
+result =
+new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE,
+"ZK," + dataLoadThreadTime.getCsvTitle(), 
rowValues);
 writer.write(result);
 }
 }
@@ -83,7 +87,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
   

[1/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-22 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 763e57056 -> 9165edb2a


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9165edb2/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
index 78f18ca..c9333a0 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
@@ -43,153 +43,160 @@ import difflib.DiffUtils;
 import difflib.Patch;
 
 public class QueryVerifier {
-   private PhoenixUtil pUtil = new PhoenixUtil();
-   private static final Logger logger = LoggerFactory
-   .getLogger(QueryVerifier.class);
-   private boolean useTemporaryOutput;
-   private String directoryLocation;
-
-   public QueryVerifier(boolean useTemporaryOutput) {
-   this.useTemporaryOutput = useTemporaryOutput;
-   this.directoryLocation = this.useTemporaryOutput ? 
-   PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
-   
-   ensureBaseDirExists();
-   }
-   
-   /***
-* Export query resultSet to CSV file
-* @param query
-* @throws Exception
-*/
-   public String exportCSV(Query query) throws Exception {
-   Connection conn = null;
-   PreparedStatement statement = null;
-   ResultSet rs = null;
-   String fileName = getFileName(query);
-   FileOutputStream fos = new FileOutputStream(fileName);
-   try {
-   conn = pUtil.getConnection(query.getTenantId());
-   statement = conn.prepareStatement(query.getStatement());
-   boolean isQuery = statement.execute();
-   if (isQuery) {
-   rs = statement.executeQuery();
-   int columnCount = 
rs.getMetaData().getColumnCount();
-   while (rs.next()) {
-   for (int columnNum = 1; columnNum <= 
columnCount; columnNum++) {
-   
fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER).getBytes());
-   }
-   
fos.write(PherfConstants.NEW_LINE.getBytes());
-   }
-   } else {
-   conn.commit();
-   }
-   } catch (Exception e) {
-   e.printStackTrace();
-   } finally {
-   if (rs != null) rs.close();
-   if (statement != null) statement.close();
-   if (conn != null) conn.close();
-   fos.flush();
-   fos.close();
-   }
-   return fileName;
-   }
-   
-   /***
-* Do a diff between exported query results and temporary CSV file
-* @param query
-* @param newCSV
-* @return
-*/
-   public boolean doDiff(Query query, String newCSV) {
+private PhoenixUtil pUtil = PhoenixUtil.create();
+private static final Logger logger = 
LoggerFactory.getLogger(QueryVerifier.class);
+private boolean useTemporaryOutput;
+private String directoryLocation;
+
+public QueryVerifier(boolean useTemporaryOutput) {
+this.useTemporaryOutput = useTemporaryOutput;
+this.directoryLocation =
+this.useTemporaryOutput ? PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
+
+ensureBaseDirExists();
+}
+
+/**
+ * Export query resultSet to CSV file
+ *
+ * @param query
+ * @throws Exception
+ */
+public String exportCSV(Query query) throws Exception {
+Connection conn = null;
+PreparedStatement statement = null;
+ResultSet rs = null;
+String fileName = getFileName(query);
+FileOutputStream fos = new FileOutputStream(fileName);
+try {
+conn = pUtil.getConnection(query.getTenantId());
+statement = conn.prepareStatement(query.getStatement());
+boolean isQuery = statement.execute();
+if (isQuery) {
+rs = statement.executeQuery();
+int columnCount = rs.getMetaData().getColumnCount();
+while (rs.next()) {
+for (int columnNum = 1; columnNum <= columnCount; 
columnNum++) {
+fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER)
+  

[3/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-22 Thread codymarcel
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads


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

Branch: refs/heads/4.4-HBase-1.1
Commit: 9165edb2af911f2be2e010323cb99ac22cdc15ad
Parents: 763e570
Author: cmarcel 
Authored: Mon Jun 22 09:08:52 2015 -0700
Committer: cmarcel 
Committed: Mon Jun 22 09:08:52 2015 -0700

--
 phoenix-pherf/cluster/pherf.sh  |   2 +-
 phoenix-pherf/pom.xml   |   9 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 134 --
 .../org/apache/phoenix/pherf/PherfMainIT.java   |  36 ++
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |  31 +-
 .../apache/phoenix/pherf/SchemaReaderIT.java|  17 +-
 .../java/org/apache/phoenix/pherf/Pherf.java| 179 +---
 .../apache/phoenix/pherf/PherfConstants.java|   8 +-
 .../phoenix/pherf/configuration/DataModel.java  |  10 -
 .../phoenix/pherf/configuration/Scenario.java   |  12 +-
 .../pherf/configuration/WriteParams.java|  72 +++
 .../pherf/configuration/XMLConfigParser.java|  25 +-
 .../phoenix/pherf/jmx/MonitorManager.java   | 156 ---
 .../phoenix/pherf/loaddata/DataLoader.java  | 332 --
 .../pherf/result/DataLoadThreadTime.java|  87 ++--
 .../pherf/result/DataLoadTimeSummary.java   |  54 +--
 .../phoenix/pherf/result/DataModelResult.java   |  68 ++-
 .../phoenix/pherf/result/QueryResult.java   |  17 +-
 .../phoenix/pherf/result/QuerySetResult.java|  40 +-
 .../org/apache/phoenix/pherf/result/Result.java |  11 +-
 .../phoenix/pherf/result/ResultHandler.java |   5 +
 .../phoenix/pherf/result/ResultManager.java |  19 +-
 .../apache/phoenix/pherf/result/ResultUtil.java | 119 +++--
 .../phoenix/pherf/result/ResultValue.java   |   4 +-
 .../apache/phoenix/pherf/result/RunTime.java| 179 
 .../phoenix/pherf/result/ScenarioResult.java|  44 +-
 .../apache/phoenix/pherf/result/ThreadTime.java |  34 +-
 .../phoenix/pherf/result/file/Extension.java|   3 +-
 .../phoenix/pherf/result/file/Header.java   |  11 +-
 .../pherf/result/impl/CSVResultHandler.java |  47 +-
 .../pherf/result/impl/ImageResultHandler.java   |  58 +--
 .../pherf/result/impl/XMLResultHandler.java |  36 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   2 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  64 ++-
 .../pherf/workload/MultiThreadedRunner.java | 153 +++
 .../pherf/workload/MultithreadedDiffer.java | 131 +++---
 .../pherf/workload/MultithreadedRunner.java | 170 ---
 .../phoenix/pherf/workload/QueryExecutor.java   | 459 ++-
 .../phoenix/pherf/workload/QueryVerifier.java   | 265 +--
 .../apache/phoenix/pherf/workload/Workload.java |  10 +
 .../pherf/workload/WorkloadExecutor.java| 109 ++---
 .../phoenix/pherf/workload/WriteWorkload.java   | 403 
 .../scenario/prod_test_unsalted_scenario.xml|  35 ++
 .../phoenix/pherf/ConfigurationParserTest.java  | 102 +++--
 .../org/apache/phoenix/pherf/ResultTest.java|   9 +-
 .../apache/phoenix/pherf/RuleGeneratorTest.java |  15 +-
 .../test/resources/scenario/test_scenario.xml   |  58 ++-
 phoenix-pherf/standalone/pherf.sh   |   2 +-
 48 files changed, 2174 insertions(+), 1672 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9165edb2/phoenix-pherf/cluster/pherf.sh
--
diff --git a/phoenix-pherf/cluster/pherf.sh b/phoenix-pherf/cluster/pherf.sh
index aeff856..8d58dfe 100755
--- a/phoenix-pherf/cluster/pherf.sh
+++ b/phoenix-pherf/cluster/pherf.sh
@@ -28,6 +28,6 @@ for f in $PHERF_HOME/lib/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CMD="time $}JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
+CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
 
 eval $CMD
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9165edb2/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index e94d4cf..a852a85 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -16,7 +16,8 @@
   ~   limitations under the License.
   -->
 
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 

[3/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-22 Thread codymarcel
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads


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

Branch: refs/heads/4.4-HBase-1.0
Commit: ac7dc675ec496f232091651925a62a6afc57ffa6
Parents: b72ce4c
Author: cmarcel 
Authored: Mon Jun 22 08:58:45 2015 -0700
Committer: cmarcel 
Committed: Mon Jun 22 08:58:45 2015 -0700

--
 phoenix-pherf/cluster/pherf.sh  |   2 +-
 phoenix-pherf/pom.xml   |   9 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 134 --
 .../org/apache/phoenix/pherf/PherfMainIT.java   |  36 ++
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |  31 +-
 .../apache/phoenix/pherf/SchemaReaderIT.java|  17 +-
 .../java/org/apache/phoenix/pherf/Pherf.java| 179 +---
 .../apache/phoenix/pherf/PherfConstants.java|   8 +-
 .../phoenix/pherf/configuration/DataModel.java  |  10 -
 .../phoenix/pherf/configuration/Scenario.java   |  12 +-
 .../pherf/configuration/WriteParams.java|  72 +++
 .../pherf/configuration/XMLConfigParser.java|  25 +-
 .../phoenix/pherf/jmx/MonitorManager.java   | 156 ---
 .../phoenix/pherf/loaddata/DataLoader.java  | 332 --
 .../pherf/result/DataLoadThreadTime.java|  87 ++--
 .../pherf/result/DataLoadTimeSummary.java   |  54 +--
 .../phoenix/pherf/result/DataModelResult.java   |  68 ++-
 .../phoenix/pherf/result/QueryResult.java   |  17 +-
 .../phoenix/pherf/result/QuerySetResult.java|  40 +-
 .../org/apache/phoenix/pherf/result/Result.java |  11 +-
 .../phoenix/pherf/result/ResultHandler.java |   5 +
 .../phoenix/pherf/result/ResultManager.java |  19 +-
 .../apache/phoenix/pherf/result/ResultUtil.java | 119 +++--
 .../phoenix/pherf/result/ResultValue.java   |   4 +-
 .../apache/phoenix/pherf/result/RunTime.java| 179 
 .../phoenix/pherf/result/ScenarioResult.java|  44 +-
 .../apache/phoenix/pherf/result/ThreadTime.java |  34 +-
 .../phoenix/pherf/result/file/Extension.java|   3 +-
 .../phoenix/pherf/result/file/Header.java   |  11 +-
 .../pherf/result/impl/CSVResultHandler.java |  47 +-
 .../pherf/result/impl/ImageResultHandler.java   |  58 +--
 .../pherf/result/impl/XMLResultHandler.java |  36 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   2 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  64 ++-
 .../pherf/workload/MultiThreadedRunner.java | 153 +++
 .../pherf/workload/MultithreadedDiffer.java | 131 +++---
 .../pherf/workload/MultithreadedRunner.java | 170 ---
 .../phoenix/pherf/workload/QueryExecutor.java   | 459 ++-
 .../phoenix/pherf/workload/QueryVerifier.java   | 265 +--
 .../apache/phoenix/pherf/workload/Workload.java |  10 +
 .../pherf/workload/WorkloadExecutor.java| 109 ++---
 .../phoenix/pherf/workload/WriteWorkload.java   | 403 
 .../scenario/prod_test_unsalted_scenario.xml|  35 ++
 .../phoenix/pherf/ConfigurationParserTest.java  | 102 +++--
 .../org/apache/phoenix/pherf/ResultTest.java|   9 +-
 .../apache/phoenix/pherf/RuleGeneratorTest.java |  15 +-
 .../test/resources/scenario/test_scenario.xml   |  58 ++-
 phoenix-pherf/standalone/pherf.sh   |   2 +-
 48 files changed, 2174 insertions(+), 1672 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ac7dc675/phoenix-pherf/cluster/pherf.sh
--
diff --git a/phoenix-pherf/cluster/pherf.sh b/phoenix-pherf/cluster/pherf.sh
index aeff856..8d58dfe 100755
--- a/phoenix-pherf/cluster/pherf.sh
+++ b/phoenix-pherf/cluster/pherf.sh
@@ -28,6 +28,6 @@ for f in $PHERF_HOME/lib/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CMD="time $}JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
+CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
 
 eval $CMD
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ac7dc675/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index bbbe3a9..dc03af4 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -16,7 +16,8 @@
   ~   limitations under the License.
   -->
 
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 

[1/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-22 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.0 b72ce4ce3 -> ac7dc675e


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ac7dc675/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
index 78f18ca..c9333a0 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
@@ -43,153 +43,160 @@ import difflib.DiffUtils;
 import difflib.Patch;
 
 public class QueryVerifier {
-   private PhoenixUtil pUtil = new PhoenixUtil();
-   private static final Logger logger = LoggerFactory
-   .getLogger(QueryVerifier.class);
-   private boolean useTemporaryOutput;
-   private String directoryLocation;
-
-   public QueryVerifier(boolean useTemporaryOutput) {
-   this.useTemporaryOutput = useTemporaryOutput;
-   this.directoryLocation = this.useTemporaryOutput ? 
-   PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
-   
-   ensureBaseDirExists();
-   }
-   
-   /***
-* Export query resultSet to CSV file
-* @param query
-* @throws Exception
-*/
-   public String exportCSV(Query query) throws Exception {
-   Connection conn = null;
-   PreparedStatement statement = null;
-   ResultSet rs = null;
-   String fileName = getFileName(query);
-   FileOutputStream fos = new FileOutputStream(fileName);
-   try {
-   conn = pUtil.getConnection(query.getTenantId());
-   statement = conn.prepareStatement(query.getStatement());
-   boolean isQuery = statement.execute();
-   if (isQuery) {
-   rs = statement.executeQuery();
-   int columnCount = 
rs.getMetaData().getColumnCount();
-   while (rs.next()) {
-   for (int columnNum = 1; columnNum <= 
columnCount; columnNum++) {
-   
fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER).getBytes());
-   }
-   
fos.write(PherfConstants.NEW_LINE.getBytes());
-   }
-   } else {
-   conn.commit();
-   }
-   } catch (Exception e) {
-   e.printStackTrace();
-   } finally {
-   if (rs != null) rs.close();
-   if (statement != null) statement.close();
-   if (conn != null) conn.close();
-   fos.flush();
-   fos.close();
-   }
-   return fileName;
-   }
-   
-   /***
-* Do a diff between exported query results and temporary CSV file
-* @param query
-* @param newCSV
-* @return
-*/
-   public boolean doDiff(Query query, String newCSV) {
+private PhoenixUtil pUtil = PhoenixUtil.create();
+private static final Logger logger = 
LoggerFactory.getLogger(QueryVerifier.class);
+private boolean useTemporaryOutput;
+private String directoryLocation;
+
+public QueryVerifier(boolean useTemporaryOutput) {
+this.useTemporaryOutput = useTemporaryOutput;
+this.directoryLocation =
+this.useTemporaryOutput ? PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
+
+ensureBaseDirExists();
+}
+
+/**
+ * Export query resultSet to CSV file
+ *
+ * @param query
+ * @throws Exception
+ */
+public String exportCSV(Query query) throws Exception {
+Connection conn = null;
+PreparedStatement statement = null;
+ResultSet rs = null;
+String fileName = getFileName(query);
+FileOutputStream fos = new FileOutputStream(fileName);
+try {
+conn = pUtil.getConnection(query.getTenantId());
+statement = conn.prepareStatement(query.getStatement());
+boolean isQuery = statement.execute();
+if (isQuery) {
+rs = statement.executeQuery();
+int columnCount = rs.getMetaData().getColumnCount();
+while (rs.next()) {
+for (int columnNum = 1; columnNum <= columnCount; 
columnNum++) {
+fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER)
+  

[2/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-22 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/ac7dc675/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index 523feb4..39d6a9c 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -33,17 +33,13 @@ public class ResultManager {
 private final ResultUtil util;
 private final PherfConstants.RunMode runMode;
 
-
 public ResultManager(String fileNameSeed, PherfConstants.RunMode runMode) {
-this(runMode, Arrays.asList(
-new XMLResultHandler(fileNameSeed, ResultFileDetails.XML),
+this(runMode, Arrays.asList(new XMLResultHandler(fileNameSeed, 
ResultFileDetails.XML),
 new ImageResultHandler(fileNameSeed, ResultFileDetails.IMAGE),
-   new CSVResultHandler(
-   fileNameSeed,
-   runMode == 
RunMode.PERFORMANCE ? ResultFileDetails.CSV_DETAILED_PERFORMANCE
-   
: ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
-new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)
-));
+new CSVResultHandler(fileNameSeed, runMode == 
RunMode.PERFORMANCE ?
+ResultFileDetails.CSV_DETAILED_PERFORMANCE :
+ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
+new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)));
 }
 
 public ResultManager(PherfConstants.RunMode runMode, List 
resultHandlers) {
@@ -81,6 +77,7 @@ public class ResultManager {
 
 /**
  * Write a combined set of results for each result in the list.
+ *
  * @param dataModelResults List<{@link DataModelResult > }
  * @throws Exception
  */
@@ -89,7 +86,9 @@ public class ResultManager {
 
 CSVResultHandler detailsCSVWriter = null;
 try {
-detailsCSVWriter = new 
CSVResultHandler(PherfConstants.COMBINED_FILE_NAME, 
ResultFileDetails.CSV_DETAILED_PERFORMANCE);
+detailsCSVWriter =
+new CSVResultHandler(PherfConstants.COMBINED_FILE_NAME,
+ResultFileDetails.CSV_DETAILED_PERFORMANCE);
 for (DataModelResult dataModelResult : dataModelResults) {
 util.write(detailsCSVWriter, dataModelResult, runMode);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ac7dc675/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index fd960d1..07dfa86 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -22,15 +22,16 @@ import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.PherfConstants.RunMode;
 import org.apache.phoenix.pherf.result.file.ResultFileDetails;
 import org.apache.phoenix.pherf.result.impl.CSVResultHandler;
-import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
-import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
 import java.text.Format;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class ResultUtil {
 
@@ -54,7 +55,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 
rowValues.addAll(writeThreadTime.getCsvRepresentation(this));
-Result result = new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE, "ZK," + 
dataLoadThreadTime.getCsvTitle(), rowValues);
+Result
+result =
+new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE,
+"ZK," + dataLoadThreadTime.getCsvTitle(), 
rowValues);
 writer.write(result);
 }
 }
@@ -83,7 +87,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
   

[2/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-19 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/18070ccc/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index 523feb4..39d6a9c 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -33,17 +33,13 @@ public class ResultManager {
 private final ResultUtil util;
 private final PherfConstants.RunMode runMode;
 
-
 public ResultManager(String fileNameSeed, PherfConstants.RunMode runMode) {
-this(runMode, Arrays.asList(
-new XMLResultHandler(fileNameSeed, ResultFileDetails.XML),
+this(runMode, Arrays.asList(new XMLResultHandler(fileNameSeed, 
ResultFileDetails.XML),
 new ImageResultHandler(fileNameSeed, ResultFileDetails.IMAGE),
-   new CSVResultHandler(
-   fileNameSeed,
-   runMode == 
RunMode.PERFORMANCE ? ResultFileDetails.CSV_DETAILED_PERFORMANCE
-   
: ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
-new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)
-));
+new CSVResultHandler(fileNameSeed, runMode == 
RunMode.PERFORMANCE ?
+ResultFileDetails.CSV_DETAILED_PERFORMANCE :
+ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
+new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)));
 }
 
 public ResultManager(PherfConstants.RunMode runMode, List 
resultHandlers) {
@@ -81,6 +77,7 @@ public class ResultManager {
 
 /**
  * Write a combined set of results for each result in the list.
+ *
  * @param dataModelResults List<{@link DataModelResult > }
  * @throws Exception
  */
@@ -89,7 +86,9 @@ public class ResultManager {
 
 CSVResultHandler detailsCSVWriter = null;
 try {
-detailsCSVWriter = new 
CSVResultHandler(PherfConstants.COMBINED_FILE_NAME, 
ResultFileDetails.CSV_DETAILED_PERFORMANCE);
+detailsCSVWriter =
+new CSVResultHandler(PherfConstants.COMBINED_FILE_NAME,
+ResultFileDetails.CSV_DETAILED_PERFORMANCE);
 for (DataModelResult dataModelResult : dataModelResults) {
 util.write(detailsCSVWriter, dataModelResult, runMode);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/18070ccc/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index fd960d1..07dfa86 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -22,15 +22,16 @@ import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.PherfConstants.RunMode;
 import org.apache.phoenix.pherf.result.file.ResultFileDetails;
 import org.apache.phoenix.pherf.result.impl.CSVResultHandler;
-import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
-import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
 import java.text.Format;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class ResultUtil {
 
@@ -54,7 +55,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 
rowValues.addAll(writeThreadTime.getCsvRepresentation(this));
-Result result = new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE, "ZK," + 
dataLoadThreadTime.getCsvTitle(), rowValues);
+Result
+result =
+new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE,
+"ZK," + dataLoadThreadTime.getCsvTitle(), 
rowValues);
 writer.write(result);
 }
 }
@@ -83,7 +87,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
   

[3/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-19 Thread codymarcel
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads


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

Branch: refs/heads/4.4-HBase-0.98
Commit: 18070ccc12fb0448e82f088577ef6ab9b71a3f65
Parents: 1f5022c
Author: cmarcel 
Authored: Fri Jun 19 17:23:53 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 19 17:23:53 2015 -0700

--
 phoenix-pherf/cluster/pherf.sh  |   2 +-
 phoenix-pherf/pom.xml   |  11 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 134 --
 .../org/apache/phoenix/pherf/PherfMainIT.java   |  36 ++
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |  31 +-
 .../apache/phoenix/pherf/SchemaReaderIT.java|  17 +-
 .../java/org/apache/phoenix/pherf/Pherf.java| 179 +---
 .../apache/phoenix/pherf/PherfConstants.java|   8 +-
 .../phoenix/pherf/configuration/DataModel.java  |  10 -
 .../phoenix/pherf/configuration/Scenario.java   |  12 +-
 .../pherf/configuration/WriteParams.java|  72 +++
 .../pherf/configuration/XMLConfigParser.java|  25 +-
 .../phoenix/pherf/jmx/MonitorManager.java   | 156 ---
 .../phoenix/pherf/loaddata/DataLoader.java  | 332 --
 .../pherf/result/DataLoadThreadTime.java|  87 ++--
 .../pherf/result/DataLoadTimeSummary.java   |  54 +--
 .../phoenix/pherf/result/DataModelResult.java   |  68 ++-
 .../phoenix/pherf/result/QueryResult.java   |  17 +-
 .../phoenix/pherf/result/QuerySetResult.java|  40 +-
 .../org/apache/phoenix/pherf/result/Result.java |  11 +-
 .../phoenix/pherf/result/ResultHandler.java |   5 +
 .../phoenix/pherf/result/ResultManager.java |  19 +-
 .../apache/phoenix/pherf/result/ResultUtil.java | 119 +++--
 .../phoenix/pherf/result/ResultValue.java   |   4 +-
 .../apache/phoenix/pherf/result/RunTime.java| 179 
 .../phoenix/pherf/result/ScenarioResult.java|  44 +-
 .../apache/phoenix/pherf/result/ThreadTime.java |  34 +-
 .../phoenix/pherf/result/file/Extension.java|   3 +-
 .../phoenix/pherf/result/file/Header.java   |  11 +-
 .../pherf/result/impl/CSVResultHandler.java |  47 +-
 .../pherf/result/impl/ImageResultHandler.java   |  58 +--
 .../pherf/result/impl/XMLResultHandler.java |  36 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   2 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  64 ++-
 .../pherf/workload/MultiThreadedRunner.java | 153 +++
 .../pherf/workload/MultithreadedDiffer.java | 131 +++---
 .../pherf/workload/MultithreadedRunner.java | 170 ---
 .../phoenix/pherf/workload/QueryExecutor.java   | 459 ++-
 .../phoenix/pherf/workload/QueryVerifier.java   | 265 +--
 .../apache/phoenix/pherf/workload/Workload.java |  10 +
 .../pherf/workload/WorkloadExecutor.java| 109 ++---
 .../phoenix/pherf/workload/WriteWorkload.java   | 403 
 .../scenario/prod_test_unsalted_scenario.xml|  35 ++
 .../phoenix/pherf/ConfigurationParserTest.java  | 102 +++--
 .../org/apache/phoenix/pherf/ResultTest.java|   9 +-
 .../apache/phoenix/pherf/RuleGeneratorTest.java |  15 +-
 .../test/resources/scenario/test_scenario.xml   |  58 ++-
 phoenix-pherf/standalone/pherf.sh   |   2 +-
 48 files changed, 2175 insertions(+), 1673 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/18070ccc/phoenix-pherf/cluster/pherf.sh
--
diff --git a/phoenix-pherf/cluster/pherf.sh b/phoenix-pherf/cluster/pherf.sh
index aeff856..8d58dfe 100755
--- a/phoenix-pherf/cluster/pherf.sh
+++ b/phoenix-pherf/cluster/pherf.sh
@@ -28,6 +28,6 @@ for f in $PHERF_HOME/lib/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CMD="time $}JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
+CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
 
 eval $CMD
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/18070ccc/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 8868138..0facbde 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -16,13 +16,14 @@
   ~   limitations under the License.
   -->
 
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  

[1/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-19 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-0.98 1f5022c22 -> 18070ccc1


http://git-wip-us.apache.org/repos/asf/phoenix/blob/18070ccc/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
index 78f18ca..c9333a0 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
@@ -43,153 +43,160 @@ import difflib.DiffUtils;
 import difflib.Patch;
 
 public class QueryVerifier {
-   private PhoenixUtil pUtil = new PhoenixUtil();
-   private static final Logger logger = LoggerFactory
-   .getLogger(QueryVerifier.class);
-   private boolean useTemporaryOutput;
-   private String directoryLocation;
-
-   public QueryVerifier(boolean useTemporaryOutput) {
-   this.useTemporaryOutput = useTemporaryOutput;
-   this.directoryLocation = this.useTemporaryOutput ? 
-   PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
-   
-   ensureBaseDirExists();
-   }
-   
-   /***
-* Export query resultSet to CSV file
-* @param query
-* @throws Exception
-*/
-   public String exportCSV(Query query) throws Exception {
-   Connection conn = null;
-   PreparedStatement statement = null;
-   ResultSet rs = null;
-   String fileName = getFileName(query);
-   FileOutputStream fos = new FileOutputStream(fileName);
-   try {
-   conn = pUtil.getConnection(query.getTenantId());
-   statement = conn.prepareStatement(query.getStatement());
-   boolean isQuery = statement.execute();
-   if (isQuery) {
-   rs = statement.executeQuery();
-   int columnCount = 
rs.getMetaData().getColumnCount();
-   while (rs.next()) {
-   for (int columnNum = 1; columnNum <= 
columnCount; columnNum++) {
-   
fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER).getBytes());
-   }
-   
fos.write(PherfConstants.NEW_LINE.getBytes());
-   }
-   } else {
-   conn.commit();
-   }
-   } catch (Exception e) {
-   e.printStackTrace();
-   } finally {
-   if (rs != null) rs.close();
-   if (statement != null) statement.close();
-   if (conn != null) conn.close();
-   fos.flush();
-   fos.close();
-   }
-   return fileName;
-   }
-   
-   /***
-* Do a diff between exported query results and temporary CSV file
-* @param query
-* @param newCSV
-* @return
-*/
-   public boolean doDiff(Query query, String newCSV) {
+private PhoenixUtil pUtil = PhoenixUtil.create();
+private static final Logger logger = 
LoggerFactory.getLogger(QueryVerifier.class);
+private boolean useTemporaryOutput;
+private String directoryLocation;
+
+public QueryVerifier(boolean useTemporaryOutput) {
+this.useTemporaryOutput = useTemporaryOutput;
+this.directoryLocation =
+this.useTemporaryOutput ? PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
+
+ensureBaseDirExists();
+}
+
+/**
+ * Export query resultSet to CSV file
+ *
+ * @param query
+ * @throws Exception
+ */
+public String exportCSV(Query query) throws Exception {
+Connection conn = null;
+PreparedStatement statement = null;
+ResultSet rs = null;
+String fileName = getFileName(query);
+FileOutputStream fos = new FileOutputStream(fileName);
+try {
+conn = pUtil.getConnection(query.getTenantId());
+statement = conn.prepareStatement(query.getStatement());
+boolean isQuery = statement.execute();
+if (isQuery) {
+rs = statement.executeQuery();
+int columnCount = rs.getMetaData().getColumnCount();
+while (rs.next()) {
+for (int columnNum = 1; columnNum <= columnCount; 
columnNum++) {
+fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER)
+ 

[3/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-19 Thread codymarcel
PHOENIX-1920 - Pherf - Add support for mixed r/w workloads


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

Branch: refs/heads/master
Commit: 7175dcbc011dff48f6d041697ec84da98f80f729
Parents: 466eeb3
Author: cmarcel 
Authored: Fri Jun 19 16:34:41 2015 -0700
Committer: cmarcel 
Committed: Fri Jun 19 16:34:41 2015 -0700

--
 .gitignore  |   2 +
 phoenix-pherf/pom.xml   |  10 +-
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 134 --
 .../org/apache/phoenix/pherf/PherfMainIT.java   |  36 ++
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |  31 +-
 .../apache/phoenix/pherf/SchemaReaderIT.java|  17 +-
 .../java/org/apache/phoenix/pherf/Pherf.java| 179 +---
 .../apache/phoenix/pherf/PherfConstants.java|   8 +-
 .../phoenix/pherf/configuration/DataModel.java  |  10 -
 .../phoenix/pherf/configuration/Scenario.java   |  12 +-
 .../pherf/configuration/WriteParams.java|  72 +++
 .../pherf/configuration/XMLConfigParser.java|  25 +-
 .../phoenix/pherf/jmx/MonitorManager.java   | 153 ---
 .../phoenix/pherf/loaddata/DataLoader.java  | 332 --
 .../pherf/result/DataLoadThreadTime.java|  87 ++--
 .../pherf/result/DataLoadTimeSummary.java   |  54 +--
 .../phoenix/pherf/result/DataModelResult.java   |  68 ++-
 .../phoenix/pherf/result/QueryResult.java   |  17 +-
 .../phoenix/pherf/result/QuerySetResult.java|  40 +-
 .../org/apache/phoenix/pherf/result/Result.java |  11 +-
 .../phoenix/pherf/result/ResultHandler.java |   5 +
 .../phoenix/pherf/result/ResultManager.java |  19 +-
 .../apache/phoenix/pherf/result/ResultUtil.java | 119 +++--
 .../phoenix/pherf/result/ResultValue.java   |   4 +-
 .../apache/phoenix/pherf/result/RunTime.java| 179 
 .../phoenix/pherf/result/ScenarioResult.java|  44 +-
 .../apache/phoenix/pherf/result/ThreadTime.java |  34 +-
 .../phoenix/pherf/result/file/Extension.java|   3 +-
 .../phoenix/pherf/result/file/Header.java   |  11 +-
 .../pherf/result/impl/CSVResultHandler.java |  47 +-
 .../pherf/result/impl/ImageResultHandler.java   |  58 +--
 .../pherf/result/impl/XMLResultHandler.java |  36 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   2 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  64 ++-
 .../pherf/workload/MultiThreadedRunner.java | 153 +++
 .../pherf/workload/MultithreadedDiffer.java | 131 +++---
 .../pherf/workload/MultithreadedRunner.java | 170 ---
 .../phoenix/pherf/workload/QueryExecutor.java   | 459 ++-
 .../phoenix/pherf/workload/QueryVerifier.java   | 265 +--
 .../apache/phoenix/pherf/workload/Workload.java |  10 +
 .../pherf/workload/WorkloadExecutor.java| 109 ++---
 .../phoenix/pherf/workload/WriteWorkload.java   | 403 
 .../scenario/prod_test_unsalted_scenario.xml|  35 ++
 .../phoenix/pherf/ConfigurationParserTest.java  | 102 +++--
 .../org/apache/phoenix/pherf/ResultTest.java|   5 +-
 .../apache/phoenix/pherf/RuleGeneratorTest.java |  15 +-
 .../test/resources/scenario/test_scenario.xml   |  58 ++-
 47 files changed, 2171 insertions(+), 1667 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7175dcbc/.gitignore
--
diff --git a/.gitignore b/.gitignore
index fc0e4af..b918d76 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,5 @@
 target/
 release/
 RESULTS/
+CSV_EXPORT/
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7175dcbc/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 1667c66..0facbde 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -16,7 +16,8 @@
   ~   limitations under the License.
   -->
 
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
@@ -30,7 +31,7 @@
 Phoenix - Pherf
 
 
-  ${project.basedir}/..
+${project.basedir}/..
 
 
 
@@ -233,6 +234,11 @@
 
 
 
+com.jcabi
+jcabi-jdbc
+0.15
+
+
 junit
 junit
 4.11

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7175dcbc/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
---

[1/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-19 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 466eeb35f -> 7175dcbc0


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7175dcbc/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
index 78f18ca..c9333a0 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/QueryVerifier.java
@@ -43,153 +43,160 @@ import difflib.DiffUtils;
 import difflib.Patch;
 
 public class QueryVerifier {
-   private PhoenixUtil pUtil = new PhoenixUtil();
-   private static final Logger logger = LoggerFactory
-   .getLogger(QueryVerifier.class);
-   private boolean useTemporaryOutput;
-   private String directoryLocation;
-
-   public QueryVerifier(boolean useTemporaryOutput) {
-   this.useTemporaryOutput = useTemporaryOutput;
-   this.directoryLocation = this.useTemporaryOutput ? 
-   PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
-   
-   ensureBaseDirExists();
-   }
-   
-   /***
-* Export query resultSet to CSV file
-* @param query
-* @throws Exception
-*/
-   public String exportCSV(Query query) throws Exception {
-   Connection conn = null;
-   PreparedStatement statement = null;
-   ResultSet rs = null;
-   String fileName = getFileName(query);
-   FileOutputStream fos = new FileOutputStream(fileName);
-   try {
-   conn = pUtil.getConnection(query.getTenantId());
-   statement = conn.prepareStatement(query.getStatement());
-   boolean isQuery = statement.execute();
-   if (isQuery) {
-   rs = statement.executeQuery();
-   int columnCount = 
rs.getMetaData().getColumnCount();
-   while (rs.next()) {
-   for (int columnNum = 1; columnNum <= 
columnCount; columnNum++) {
-   
fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER).getBytes());
-   }
-   
fos.write(PherfConstants.NEW_LINE.getBytes());
-   }
-   } else {
-   conn.commit();
-   }
-   } catch (Exception e) {
-   e.printStackTrace();
-   } finally {
-   if (rs != null) rs.close();
-   if (statement != null) statement.close();
-   if (conn != null) conn.close();
-   fos.flush();
-   fos.close();
-   }
-   return fileName;
-   }
-   
-   /***
-* Do a diff between exported query results and temporary CSV file
-* @param query
-* @param newCSV
-* @return
-*/
-   public boolean doDiff(Query query, String newCSV) {
+private PhoenixUtil pUtil = PhoenixUtil.create();
+private static final Logger logger = 
LoggerFactory.getLogger(QueryVerifier.class);
+private boolean useTemporaryOutput;
+private String directoryLocation;
+
+public QueryVerifier(boolean useTemporaryOutput) {
+this.useTemporaryOutput = useTemporaryOutput;
+this.directoryLocation =
+this.useTemporaryOutput ? PherfConstants.EXPORT_TMP : 
PherfConstants.EXPORT_DIR;
+
+ensureBaseDirExists();
+}
+
+/**
+ * Export query resultSet to CSV file
+ *
+ * @param query
+ * @throws Exception
+ */
+public String exportCSV(Query query) throws Exception {
+Connection conn = null;
+PreparedStatement statement = null;
+ResultSet rs = null;
+String fileName = getFileName(query);
+FileOutputStream fos = new FileOutputStream(fileName);
+try {
+conn = pUtil.getConnection(query.getTenantId());
+statement = conn.prepareStatement(query.getStatement());
+boolean isQuery = statement.execute();
+if (isQuery) {
+rs = statement.executeQuery();
+int columnCount = rs.getMetaData().getColumnCount();
+while (rs.next()) {
+for (int columnNum = 1; columnNum <= columnCount; 
columnNum++) {
+fos.write((rs.getString(columnNum) + 
PherfConstants.RESULT_FILE_DELIMETER)
+ 

[2/3] phoenix git commit: PHOENIX-1920 - Pherf - Add support for mixed r/w workloads

2015-06-19 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/7175dcbc/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
index 523feb4..39d6a9c 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultManager.java
@@ -33,17 +33,13 @@ public class ResultManager {
 private final ResultUtil util;
 private final PherfConstants.RunMode runMode;
 
-
 public ResultManager(String fileNameSeed, PherfConstants.RunMode runMode) {
-this(runMode, Arrays.asList(
-new XMLResultHandler(fileNameSeed, ResultFileDetails.XML),
+this(runMode, Arrays.asList(new XMLResultHandler(fileNameSeed, 
ResultFileDetails.XML),
 new ImageResultHandler(fileNameSeed, ResultFileDetails.IMAGE),
-   new CSVResultHandler(
-   fileNameSeed,
-   runMode == 
RunMode.PERFORMANCE ? ResultFileDetails.CSV_DETAILED_PERFORMANCE
-   
: ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
-new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)
-));
+new CSVResultHandler(fileNameSeed, runMode == 
RunMode.PERFORMANCE ?
+ResultFileDetails.CSV_DETAILED_PERFORMANCE :
+ResultFileDetails.CSV_DETAILED_FUNCTIONAL),
+new CSVResultHandler(fileNameSeed, 
ResultFileDetails.CSV_AGGREGATE_PERFORMANCE)));
 }
 
 public ResultManager(PherfConstants.RunMode runMode, List 
resultHandlers) {
@@ -81,6 +77,7 @@ public class ResultManager {
 
 /**
  * Write a combined set of results for each result in the list.
+ *
  * @param dataModelResults List<{@link DataModelResult > }
  * @throws Exception
  */
@@ -89,7 +86,9 @@ public class ResultManager {
 
 CSVResultHandler detailsCSVWriter = null;
 try {
-detailsCSVWriter = new 
CSVResultHandler(PherfConstants.COMBINED_FILE_NAME, 
ResultFileDetails.CSV_DETAILED_PERFORMANCE);
+detailsCSVWriter =
+new CSVResultHandler(PherfConstants.COMBINED_FILE_NAME,
+ResultFileDetails.CSV_DETAILED_PERFORMANCE);
 for (DataModelResult dataModelResult : dataModelResults) {
 util.write(detailsCSVWriter, dataModelResult, runMode);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7175dcbc/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
index fd960d1..07dfa86 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultUtil.java
@@ -22,15 +22,16 @@ import org.apache.phoenix.pherf.PherfConstants;
 import org.apache.phoenix.pherf.PherfConstants.RunMode;
 import org.apache.phoenix.pherf.result.file.ResultFileDetails;
 import org.apache.phoenix.pherf.result.impl.CSVResultHandler;
-import org.apache.phoenix.pherf.result.impl.ImageResultHandler;
-import org.apache.phoenix.pherf.result.impl.XMLResultHandler;
 import org.apache.phoenix.pherf.util.PhoenixUtil;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
 import java.text.Format;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public class ResultUtil {
 
@@ -54,7 +55,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
 rowValues.add(new ResultValue(PhoenixUtil.getZookeeper()));
 
rowValues.addAll(writeThreadTime.getCsvRepresentation(this));
-Result result = new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE, "ZK," + 
dataLoadThreadTime.getCsvTitle(), rowValues);
+Result
+result =
+new 
Result(ResultFileDetails.CSV_DETAILED_PERFORMANCE,
+"ZK," + dataLoadThreadTime.getCsvTitle(), 
rowValues);
 writer.write(result);
 }
 }
@@ -83,7 +87,10 @@ public class ResultUtil {
 List rowValues = new ArrayList<>();
   

phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 0e0b4ddb4 -> c95e28df9


PHOENIX-1964 - porting from master


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

Branch: refs/heads/4.x-HBase-1.1
Commit: c95e28df94241f47d5cfe9a1515b21960c93adf2
Parents: 0e0b4dd
Author: cmarcel 
Authored: Wed May 27 13:58:45 2015 -0700
Committer: cmarcel 
Committed: Wed May 27 13:58:45 2015 -0700

--
 phoenix-pherf/config/pherf.properties   |  3 ++
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  | 45 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|  7 +--
 .../apache/phoenix/pherf/PherfConstants.java| 50 +++-
 .../phoenix/pherf/loaddata/DataLoader.java  |  2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |  4 +-
 .../pherf/result/impl/CSVResultHandler.java |  5 +-
 .../pherf/result/impl/ImageResultHandler.java   |  5 +-
 .../pherf/result/impl/XMLResultHandler.java |  6 ++-
 .../apache/phoenix/pherf/util/ResourceList.java | 26 --
 .../pherf/workload/WorkloadExecutor.java|  2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |  2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |  8 ++--
 .../apache/phoenix/pherf/ResultBaseTest.java| 44 +
 .../org/apache/phoenix/pherf/ResultTest.java|  5 +-
 16 files changed, 168 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c95e28df/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 354707a..1142f9b5 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -29,3 +29,6 @@ pherf.default.dataloader.threadpool=0
 # When upserting, this is the max # of rows that will be inserted in a single 
commit
 pherf.default.dataloader.batchsize=1000
 
+# Directory where results from a scenario run will be written
+pherf.default.results.dir=RESULTS
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c95e28df/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b29656d..2b56f43 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,7 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
 import org.apache.phoenix.pherf.configuration.Scenario;
@@ -39,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-public class DataIngestIT extends BaseHBaseManagedTimeIT {
+public class DataIngestIT extends ResultBaseTestIT {
 protected static PhoenixUtil util = new PhoenixUtil(true);
 static final String matcherScenario = ".*scenario/.*test.*xml";
 static final String matcherSchema = ".*datamodel/.*test.*sql";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c95e28df/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
new file mode 100644
index 000..6e103b8
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  

phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 9c5d5b7d7 -> 6e2b26886


PHOENIX-1964 - porting from master


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

Branch: refs/heads/4.4-HBase-1.1
Commit: 6e2b2688682490bf3b23d52a1e6bcc60bed8f136
Parents: 9c5d5b7
Author: cmarcel 
Authored: Wed May 27 13:56:20 2015 -0700
Committer: cmarcel 
Committed: Wed May 27 13:56:20 2015 -0700

--
 phoenix-pherf/config/pherf.properties   |  3 ++
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  | 45 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|  7 +--
 .../apache/phoenix/pherf/PherfConstants.java| 50 +++-
 .../phoenix/pherf/loaddata/DataLoader.java  |  2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |  4 +-
 .../pherf/result/impl/CSVResultHandler.java |  5 +-
 .../pherf/result/impl/ImageResultHandler.java   |  5 +-
 .../pherf/result/impl/XMLResultHandler.java |  6 ++-
 .../apache/phoenix/pherf/util/ResourceList.java | 26 --
 .../pherf/workload/WorkloadExecutor.java|  2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |  2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |  8 ++--
 .../apache/phoenix/pherf/ResultBaseTest.java| 44 +
 .../org/apache/phoenix/pherf/ResultTest.java|  5 +-
 16 files changed, 168 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6e2b2688/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 354707a..1142f9b5 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -29,3 +29,6 @@ pherf.default.dataloader.threadpool=0
 # When upserting, this is the max # of rows that will be inserted in a single 
commit
 pherf.default.dataloader.batchsize=1000
 
+# Directory where results from a scenario run will be written
+pherf.default.results.dir=RESULTS
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6e2b2688/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b29656d..2b56f43 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,7 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
 import org.apache.phoenix.pherf.configuration.Scenario;
@@ -39,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-public class DataIngestIT extends BaseHBaseManagedTimeIT {
+public class DataIngestIT extends ResultBaseTestIT {
 protected static PhoenixUtil util = new PhoenixUtil(true);
 static final String matcherScenario = ".*scenario/.*test.*xml";
 static final String matcherSchema = ".*datamodel/.*test.*sql";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6e2b2688/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
new file mode 100644
index 000..6e103b8
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  

[1/4] phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.0 41037dd4b -> e409c0e7a


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/OrderByIT.java~HEAD
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OrderByIT.java~HEAD 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OrderByIT.java~HEAD
new file mode 100644
index 000..9fc3003
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OrderByIT.java~HEAD
@@ -0,0 +1,515 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import static org.apache.phoenix.util.TestUtil.ROW1;
+import static org.apache.phoenix.util.TestUtil.ROW2;
+import static org.apache.phoenix.util.TestUtil.ROW3;
+import static org.apache.phoenix.util.TestUtil.ROW4;
+import static org.apache.phoenix.util.TestUtil.ROW5;
+import static org.apache.phoenix.util.TestUtil.ROW6;
+import static org.apache.phoenix.util.TestUtil.ROW7;
+import static org.apache.phoenix.util.TestUtil.ROW8;
+import static org.apache.phoenix.util.TestUtil.ROW9;
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.junit.Test;
+
+
+public class OrderByIT extends BaseClientManagedTimeIT {
+
+@Test
+public void testMultiOrderByExpr() throws Exception {
+long ts = nextTimestamp();
+String tenantId = getOrganizationId();
+initATableValues(tenantId, getDefaultSplits(tenantId), null, ts);
+String query = "SELECT entity_id FROM aTable ORDER BY b_string, 
entity_id";
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 2)); // Execute at timestamp 2
+Connection conn = DriverManager.getConnection(getUrl(), props);
+try {
+PreparedStatement statement = conn.prepareStatement(query);
+ResultSet rs = statement.executeQuery();
+assertTrue (rs.next());
+assertEquals(ROW1,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW4,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW7,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW2,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW5,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW8,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW3,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW6,rs.getString(1));
+assertTrue (rs.next());
+assertEquals(ROW9,rs.getString(1));
+
+assertFalse(rs.next());
+} finally {
+conn.close();
+}
+}
+
+
+@Test
+public void testDescMultiOrderByExpr() throws Exception {
+long ts = nextTimestamp();
+String tenantId = getOrganizationId();
+initATableValues(tenantId, getDefaultSplits(tenantId), null, ts);
+String query = "SELECT entity_id FROM aTable ORDER BY b_string || 
entity_id desc";
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 2)); // Execute at timestamp 2
+Connection conn = DriverManager.getConnection(getUrl(), props);
+try {
+PreparedStatement statement = conn.prepareStatement(query);
+ResultSet rs = statement.executeQuery();
+assertTrue (rs.next());
+assertEquals(ROW9,rs.getString(1));
+assertTrue (rs.next());
+ 

[4/4] phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
PHOENIX-1964 - porting from master


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

Branch: refs/heads/4.4-HBase-1.0
Commit: e409c0e7ae2ae67379e29fced1dee2045be25e15
Parents: 41037dd
Author: cmarcel 
Authored: Wed May 27 13:53:51 2015 -0700
Committer: cmarcel 
Committed: Wed May 27 13:53:51 2015 -0700

--
 .../end2end/BaseClientManagedTimeIT.java~HEAD   |   79 +
 ...on) tests from fast unit tests (GabrielReid) |   41 +
 .../end2end/BaseHBaseManagedTimeIT.java~HEAD|   66 +
 ...on) tests from fast unit tests (GabrielReid) |   41 +
 .../apache/phoenix/end2end/HashJoinIT.java~HEAD | 3818 ++
 ...on) tests from fast unit tests (GabrielReid) | 2242 ++
 .../apache/phoenix/end2end/OrderByIT.java~HEAD  |  515 +++
 ...on) tests from fast unit tests (GabrielReid) |  153 +
 .../end2end/TenantSpecificViewIndexIT.java~HEAD |  197 +
 ...on) tests from fast unit tests (GabrielReid) |   33 +
 phoenix-pherf/config/pherf.properties   |3 +
 .../org/apache/phoenix/pherf/DataIngestIT.java  |3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   45 +
 .../java/org/apache/phoenix/pherf/Pherf.java|7 +-
 .../apache/phoenix/pherf/PherfConstants.java|   50 +-
 .../phoenix/pherf/loaddata/DataLoader.java  |2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |4 +-
 .../pherf/result/impl/CSVResultHandler.java |5 +-
 .../pherf/result/impl/ImageResultHandler.java   |5 +-
 .../pherf/result/impl/XMLResultHandler.java |6 +-
 .../apache/phoenix/pherf/util/ResourceList.java |   26 -
 .../pherf/workload/WorkloadExecutor.java|2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |8 +-
 .../apache/phoenix/pherf/ResultBaseTest.java|   44 +
 .../org/apache/phoenix/pherf/ResultTest.java|5 +-
 26 files changed, 7353 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
new file mode 100644
index 000..1acd5b3
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import java.util.Map;
+
+import javax.annotation.concurrent.NotThreadSafe;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.phoenix.query.BaseTest;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.experimental.categories.Category;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Base class for tests that manage their own time stamps
+ * We need to separate these from tests that rely on hbase to set
+ * timestamps, because we create/destroy the Phoenix tables
+ * between tests and only allow a table time stamp to increase.
+ * Without this separation table deletion/creation would fail.
+ * 
+ * All tests extending this class use the mini cluster that is
+ * different from the mini cluster used by test classes extending 
+ * {@link BaseHBaseManagedTimeIT}.
+ * 
+ * @since 0.1
+ */
+@NotThreadSafe
+@Category(ClientManagedTimeTest.class)
+public abstract class BaseClientManagedTimeIT extends BaseTest {
+protected static Configuration getTestClusterConfig() {
+// don't want callers to modify config.
+return new Configuration(config);
+}
+
+@After
+public void cleanUpAfterTe

[3/4] phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~HEAD
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~HEAD 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~HEAD
new file mode 100644
index 000..a03204a
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~HEAD
@@ -0,0 +1,3818 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import static 
org.apache.phoenix.util.TestUtil.JOIN_CUSTOMER_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_CUSTOMER_TABLE_FULL_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ORDER_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ORDER_TABLE_FULL_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_SCHEMA;
+import static 
org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME;
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.schema.TableAlreadyExistsException;
+import org.apache.phoenix.util.MetaDataUtil;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+@RunWith(Parameterized.class)
+public class HashJoinIT extends BaseHBaseManagedTimeIT {
+
+private SimpleDateFormat format = new SimpleDateFormat("-MM-dd 
HH:mm:ss");
+private String[] indexDDL;
+private String[] plans;
+
+public HashJoinIT(String[] indexDDL, String[] plans) {
+this.indexDDL = indexDDL;
+this.plans = plans;
+}
+
+@BeforeClass
+@Shadower(classBeingShadowed = BaseHBaseManagedTimeIT.class)
+public static void doSetup() throws Exception {
+Map props = Maps.newHashMapWithExpectedSize(3);
+// Forces server cache to be used
+props.put(QueryServices.INDEX_MUTATE_BATCH_SIZE_THRESHOLD_ATTRIB, 
Integer.toString(2));
+// Must update config before starting server
+setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
+}
+
+@Before
+public void initTable() throws Exception {
+initJoinTableValues(getUrl(), null, null);
+if (indexDDL != null && indexDDL.length > 0) {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+for (String ddl : indexDDL) {
+try {
+conn.createStatement().execute(ddl);
+} catch (TableAlreadyExistsException e) {
+}
+}
+conn.close();
+}
+}
+
+@Parameters
+public static Collection data() {
+List testCases = List

[2/4] phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid) 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)
new file mode 100644
index 000..123ff35
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid) 
@@ -0,0 +1,2242 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import static org.apache.phoenix.util.TestUtil.JOIN_CUSTOMER_TABLE_FULL_NAME;
+import static 
org.apache.phoenix.util.TestUtil.JOIN_CUSTOMER_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_FULL_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ITEM_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ORDER_TABLE_FULL_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_ORDER_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.JOIN_SCHEMA;
+import static org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_FULL_NAME;
+import static 
org.apache.phoenix.util.TestUtil.JOIN_SUPPLIER_TABLE_DISPLAY_NAME;
+import static org.apache.phoenix.util.TestUtil.PHOENIX_JDBC_URL;
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.schema.TableAlreadyExistsException;
+import org.apache.phoenix.util.QueryUtil;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+@RunWith(Parameterized.class)
+public class HashJoinIT extends BaseHBaseManagedTimeIT {
+
+private String[] indexDDL;
+private String[] plans;
+
+public HashJoinIT(String[] indexDDL, String[] plans) {
+this.indexDDL = indexDDL;
+this.plans = plans;
+}
+
+@BeforeClass 
+public static void doSetup() throws Exception {
+Map props = Maps.newHashMapWithExpectedSize(3);
+// Don't split intra region so we can more easily know that the n-way 
parallelization is for the explain plan
+props.put(QueryServices.MAX_INTRA_REGION_PARALLELIZATION_ATTRIB, 
Integer.toString(1));
+// Forces server cache to be used
+props.put(QueryServices.INDEX_MUTATE_BATCH_SIZE_THRESHOLD_ATTRIB, 
Integer.toString(2));
+// Must update config before starting server
+startServer(getUrl(), new ReadOnlyProps(props.entrySet().iterator()));
+}
+
+@Before
+public void initTable() throws Exception {
+initTableValues();
+if (indexDDL != null && indexDDL.length > 0) {
+Properties props = new Properties(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+   

phoenix git commit: PHOENIX-1964 - porting from master

2015-05-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-0.98 a0fc27567 -> 9d5a56c3d


PHOENIX-1964 - porting from master


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

Branch: refs/heads/4.4-HBase-0.98
Commit: 9d5a56c3dbae3da59eaef3cf919e958602e5d929
Parents: a0fc275
Author: cmarcel 
Authored: Wed May 27 13:42:57 2015 -0700
Committer: cmarcel 
Committed: Wed May 27 13:42:57 2015 -0700

--
 phoenix-pherf/config/pherf.properties   |  3 ++
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  | 45 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|  7 +--
 .../apache/phoenix/pherf/PherfConstants.java| 50 +++-
 .../phoenix/pherf/loaddata/DataLoader.java  |  2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |  4 +-
 .../pherf/result/impl/CSVResultHandler.java |  5 +-
 .../pherf/result/impl/ImageResultHandler.java   |  5 +-
 .../pherf/result/impl/XMLResultHandler.java |  6 ++-
 .../apache/phoenix/pherf/util/ResourceList.java | 26 --
 .../pherf/workload/WorkloadExecutor.java|  2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |  2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |  8 ++--
 .../apache/phoenix/pherf/ResultBaseTest.java| 44 +
 .../org/apache/phoenix/pherf/ResultTest.java|  5 +-
 16 files changed, 168 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5a56c3/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 354707a..1142f9b5 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -29,3 +29,6 @@ pherf.default.dataloader.threadpool=0
 # When upserting, this is the max # of rows that will be inserted in a single 
commit
 pherf.default.dataloader.batchsize=1000
 
+# Directory where results from a scenario run will be written
+pherf.default.results.dir=RESULTS
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5a56c3/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b29656d..2b56f43 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,7 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
 import org.apache.phoenix.pherf.configuration.Scenario;
@@ -39,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-public class DataIngestIT extends BaseHBaseManagedTimeIT {
+public class DataIngestIT extends ResultBaseTestIT {
 protected static PhoenixUtil util = new PhoenixUtil(true);
 static final String matcherScenario = ".*scenario/.*test.*xml";
 static final String matcherSchema = ".*datamodel/.*test.*sql";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5a56c3/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
new file mode 100644
index 000..6e103b8
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *

phoenix git commit: PHOENIX-1964 - Pherf tests write output in module base directory. Port from master

2015-05-20 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 530389d7c -> b9712982f


PHOENIX-1964 - Pherf tests write output in module base directory. Port from 
master


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

Branch: refs/heads/4.x-HBase-1.0
Commit: b9712982f07fe830086bec66bc52a84ac9a44d8b
Parents: 530389d
Author: cmarcel 
Authored: Wed May 20 14:38:58 2015 -0700
Committer: cmarcel 
Committed: Wed May 20 14:38:58 2015 -0700

--
 phoenix-pherf/config/pherf.properties   |  3 ++
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  | 45 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|  7 +--
 .../apache/phoenix/pherf/PherfConstants.java| 50 +++-
 .../phoenix/pherf/loaddata/DataLoader.java  |  2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |  4 +-
 .../pherf/result/impl/CSVResultHandler.java |  5 +-
 .../pherf/result/impl/ImageResultHandler.java   |  5 +-
 .../pherf/result/impl/XMLResultHandler.java |  6 ++-
 .../apache/phoenix/pherf/util/ResourceList.java | 26 --
 .../pherf/workload/WorkloadExecutor.java|  2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |  2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |  8 ++--
 .../apache/phoenix/pherf/ResultBaseTest.java| 44 +
 .../org/apache/phoenix/pherf/ResultTest.java|  5 +-
 16 files changed, 168 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b9712982/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 354707a..1142f9b5 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -29,3 +29,6 @@ pherf.default.dataloader.threadpool=0
 # When upserting, this is the max # of rows that will be inserted in a single 
commit
 pherf.default.dataloader.batchsize=1000
 
+# Directory where results from a scenario run will be written
+pherf.default.results.dir=RESULTS
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b9712982/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b29656d..2b56f43 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,7 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
 import org.apache.phoenix.pherf.configuration.Scenario;
@@ -39,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-public class DataIngestIT extends BaseHBaseManagedTimeIT {
+public class DataIngestIT extends ResultBaseTestIT {
 protected static PhoenixUtil util = new PhoenixUtil(true);
 static final String matcherScenario = ".*scenario/.*test.*xml";
 static final String matcherSchema = ".*datamodel/.*test.*sql";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b9712982/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
new file mode 100644
index 000..6e103b8
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITI

phoenix git commit: PHOENIX-1964 - Pherf tests write output in module base directory. Port from master

2015-05-20 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 58ef7175e -> cef3610e5


PHOENIX-1964 - Pherf tests write output in module base directory. Port from 
master


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

Branch: refs/heads/4.x-HBase-0.98
Commit: cef3610e5d61a9f36721ad8f7bd61b04055748b5
Parents: 58ef717
Author: cmarcel 
Authored: Wed May 20 14:29:14 2015 -0700
Committer: cmarcel 
Committed: Wed May 20 14:29:14 2015 -0700

--
 phoenix-pherf/config/pherf.properties   |  3 ++
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  | 45 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|  7 +--
 .../apache/phoenix/pherf/PherfConstants.java| 50 +++-
 .../phoenix/pherf/loaddata/DataLoader.java  |  2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |  4 +-
 .../pherf/result/impl/CSVResultHandler.java |  5 +-
 .../pherf/result/impl/ImageResultHandler.java   |  5 +-
 .../pherf/result/impl/XMLResultHandler.java |  6 ++-
 .../apache/phoenix/pherf/util/ResourceList.java | 26 --
 .../pherf/workload/WorkloadExecutor.java|  2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |  2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |  8 ++--
 .../apache/phoenix/pherf/ResultBaseTest.java| 44 +
 .../org/apache/phoenix/pherf/ResultTest.java|  5 +-
 16 files changed, 168 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cef3610e/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 354707a..1142f9b5 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -29,3 +29,6 @@ pherf.default.dataloader.threadpool=0
 # When upserting, this is the max # of rows that will be inserted in a single 
commit
 pherf.default.dataloader.batchsize=1000
 
+# Directory where results from a scenario run will be written
+pherf.default.results.dir=RESULTS
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cef3610e/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b29656d..2b56f43 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,7 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
 import org.apache.phoenix.pherf.configuration.Scenario;
@@ -39,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-public class DataIngestIT extends BaseHBaseManagedTimeIT {
+public class DataIngestIT extends ResultBaseTestIT {
 protected static PhoenixUtil util = new PhoenixUtil(true);
 static final String matcherScenario = ".*scenario/.*test.*xml";
 static final String matcherSchema = ".*datamodel/.*test.*sql";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cef3610e/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
new file mode 100644
index 000..6e103b8
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDI

phoenix git commit: PHOENIX-1964 - Pherf tests write output in module base directory

2015-05-20 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 981ed472c -> d3ff0798f


PHOENIX-1964 - Pherf tests write output in module base directory


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

Branch: refs/heads/master
Commit: d3ff0798f3e87bb489e3c91f7d11813503fe7861
Parents: 981ed47
Author: cmarcel 
Authored: Tue May 19 15:54:52 2015 -0700
Committer: cmarcel 
Committed: Wed May 20 13:36:34 2015 -0700

--
 phoenix-pherf/config/pherf.properties   |  3 ++
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  | 45 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|  7 +--
 .../apache/phoenix/pherf/PherfConstants.java| 50 +++-
 .../phoenix/pherf/loaddata/DataLoader.java  |  2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |  4 +-
 .../pherf/result/impl/CSVResultHandler.java |  5 +-
 .../pherf/result/impl/ImageResultHandler.java   |  5 +-
 .../pherf/result/impl/XMLResultHandler.java |  6 ++-
 .../apache/phoenix/pherf/util/ResourceList.java | 26 --
 .../pherf/workload/WorkloadExecutor.java|  2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |  2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |  8 ++--
 .../apache/phoenix/pherf/ResultBaseTest.java| 44 +
 .../org/apache/phoenix/pherf/ResultTest.java|  5 +-
 16 files changed, 168 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d3ff0798/phoenix-pherf/config/pherf.properties
--
diff --git a/phoenix-pherf/config/pherf.properties 
b/phoenix-pherf/config/pherf.properties
index 354707a..1142f9b5 100644
--- a/phoenix-pherf/config/pherf.properties
+++ b/phoenix-pherf/config/pherf.properties
@@ -29,3 +29,6 @@ pherf.default.dataloader.threadpool=0
 # When upserting, this is the max # of rows that will be inserted in a single 
commit
 pherf.default.dataloader.batchsize=1000
 
+# Directory where results from a scenario run will be written
+pherf.default.results.dir=RESULTS
+

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d3ff0798/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
index b29656d..2b56f43 100644
--- a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -18,7 +18,6 @@
 
 package org.apache.phoenix.pherf;
 
-import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
 import org.apache.phoenix.pherf.configuration.Column;
 import org.apache.phoenix.pherf.configuration.DataTypeMapping;
 import org.apache.phoenix.pherf.configuration.Scenario;
@@ -39,7 +38,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-public class DataIngestIT extends BaseHBaseManagedTimeIT {
+public class DataIngestIT extends ResultBaseTestIT {
 protected static PhoenixUtil util = new PhoenixUtil(true);
 static final String matcherScenario = ".*scenario/.*test.*xml";
 static final String matcherSchema = ".*datamodel/.*test.*sql";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d3ff0798/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
new file mode 100644
index 000..6e103b8
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/ResultBaseTestIT.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o

phoenix git commit: PHOENIX-1963 - Irregular failures in ResultTest#testMonitorResult. Port from master

2015-05-18 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 dd3acfc5e -> 8176499c2


PHOENIX-1963 - Irregular failures in ResultTest#testMonitorResult. Port from 
master


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 8176499c2917762f2f1352111eb2e6e760fec790
Parents: dd3acfc
Author: cmarcel 
Authored: Mon May 18 10:41:38 2015 -0700
Committer: cmarcel 
Committed: Mon May 18 10:42:09 2015 -0700

--
 phoenix-pherf/cluster/pherf.sh  | 2 +-
 .../main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java  | 5 ++---
 .../src/test/java/org/apache/phoenix/pherf/ResultTest.java  | 4 ++--
 phoenix-pherf/standalone/pherf.sh   | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8176499c/phoenix-pherf/cluster/pherf.sh
--
diff --git a/phoenix-pherf/cluster/pherf.sh b/phoenix-pherf/cluster/pherf.sh
index aeff856..8d58dfe 100755
--- a/phoenix-pherf/cluster/pherf.sh
+++ b/phoenix-pherf/cluster/pherf.sh
@@ -28,6 +28,6 @@ for f in $PHERF_HOME/lib/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CMD="time $}JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
+CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
 
 eval $CMD
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8176499c/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
index 9f46cf7..6f97551 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
@@ -106,8 +106,9 @@ public class MonitorManager implements Runnable {
 rowCount.getAndIncrement();
 }
 try {
+resultHandler.flush();
 Thread.sleep(getMonitorFrequency());
-} catch (InterruptedException e) {
+} catch (Exception e) {
 Thread.currentThread().interrupt();
 e.printStackTrace();
 }
@@ -117,9 +118,7 @@ public class MonitorManager implements Runnable {
 try {
 isRunning = false;
 if (resultHandler != null) {
-resultHandler.flush();
 resultHandler.close();
-
 }
 } catch (Exception e) {
 throw new FileLoaderRuntimeException("Could not close monitor 
results.", e);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8176499c/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
index 0f4dfd1..c51f0dc 100644
--- a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
+++ b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
@@ -55,7 +55,7 @@ public class ResultTest {
 resultMonitorWriter.write(result);
 resultMonitorWriter.write(result);
 resultMonitorWriter.write(result);
-resultMonitorWriter.flush();
+resultMonitorWriter.close();
 List results = resultMonitorWriter.read();
 assertEquals("Results did not contain row.", results.size(), 3);
 
@@ -72,7 +72,7 @@ public class ResultTest {
 ExecutorService executorService = Executors.newFixedThreadPool(1);
 MonitorManager monitor = new MonitorManager(100);
 Future future = executorService.submit(monitor);
-List records = null;
+List records;
 final int TIMEOUT = 30;
 
 int ct = 0;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8176499c/phoenix-pherf/standalone/pherf.sh
--
diff --git a/phoenix-pherf/standalone/pherf.sh 
b/phoenix-pherf/standalone/pherf.sh
i

phoenix git commit: PHOENIX-1963 - Irregular failures in ResultTest#testMonitorResult. Port from master

2015-05-18 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 31874673d -> 9d5133abd


PHOENIX-1963 - Irregular failures in ResultTest#testMonitorResult. Port from 
master


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 9d5133abd97303f8b471dfef543df1dab36cf217
Parents: 3187467
Author: cmarcel 
Authored: Mon May 18 10:39:25 2015 -0700
Committer: cmarcel 
Committed: Mon May 18 10:39:25 2015 -0700

--
 phoenix-pherf/cluster/pherf.sh  | 2 +-
 .../main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java  | 5 ++---
 .../src/test/java/org/apache/phoenix/pherf/ResultTest.java  | 4 ++--
 phoenix-pherf/standalone/pherf.sh   | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5133ab/phoenix-pherf/cluster/pherf.sh
--
diff --git a/phoenix-pherf/cluster/pherf.sh b/phoenix-pherf/cluster/pherf.sh
index aeff856..8d58dfe 100755
--- a/phoenix-pherf/cluster/pherf.sh
+++ b/phoenix-pherf/cluster/pherf.sh
@@ -28,6 +28,6 @@ for f in $PHERF_HOME/lib/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CMD="time $}JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
+CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
 
 eval $CMD
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5133ab/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
index 9f46cf7..6f97551 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
@@ -106,8 +106,9 @@ public class MonitorManager implements Runnable {
 rowCount.getAndIncrement();
 }
 try {
+resultHandler.flush();
 Thread.sleep(getMonitorFrequency());
-} catch (InterruptedException e) {
+} catch (Exception e) {
 Thread.currentThread().interrupt();
 e.printStackTrace();
 }
@@ -117,9 +118,7 @@ public class MonitorManager implements Runnable {
 try {
 isRunning = false;
 if (resultHandler != null) {
-resultHandler.flush();
 resultHandler.close();
-
 }
 } catch (Exception e) {
 throw new FileLoaderRuntimeException("Could not close monitor 
results.", e);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5133ab/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
index 0f4dfd1..c51f0dc 100644
--- a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
+++ b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
@@ -55,7 +55,7 @@ public class ResultTest {
 resultMonitorWriter.write(result);
 resultMonitorWriter.write(result);
 resultMonitorWriter.write(result);
-resultMonitorWriter.flush();
+resultMonitorWriter.close();
 List results = resultMonitorWriter.read();
 assertEquals("Results did not contain row.", results.size(), 3);
 
@@ -72,7 +72,7 @@ public class ResultTest {
 ExecutorService executorService = Executors.newFixedThreadPool(1);
 MonitorManager monitor = new MonitorManager(100);
 Future future = executorService.submit(monitor);
-List records = null;
+List records;
 final int TIMEOUT = 30;
 
 int ct = 0;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d5133ab/phoenix-pherf/standalone/pherf.sh
--
diff --git a/phoenix-pherf/standalone/pherf.sh 
b/phoenix-pherf/standalone/pherf.sh

phoenix git commit: PHOENIX-1963 - Irregular failures in ResultTest#testMonitorResult

2015-05-14 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master a1032fba3 -> 289a875bd


PHOENIX-1963 - Irregular failures in ResultTest#testMonitorResult


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

Branch: refs/heads/master
Commit: 289a875bd1cd76b6437ae1400d6c324bfe3e0754
Parents: a1032fb
Author: cmarcel 
Authored: Thu May 14 15:56:46 2015 -0700
Committer: cmarcel 
Committed: Thu May 14 15:57:00 2015 -0700

--
 phoenix-pherf/cluster/pherf.sh  | 2 +-
 .../main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java  | 5 ++---
 .../src/test/java/org/apache/phoenix/pherf/ResultTest.java  | 4 ++--
 phoenix-pherf/standalone/pherf.sh   | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/289a875b/phoenix-pherf/cluster/pherf.sh
--
diff --git a/phoenix-pherf/cluster/pherf.sh b/phoenix-pherf/cluster/pherf.sh
index aeff856..8d58dfe 100755
--- a/phoenix-pherf/cluster/pherf.sh
+++ b/phoenix-pherf/cluster/pherf.sh
@@ -28,6 +28,6 @@ for f in $PHERF_HOME/lib/*.jar; do
   CLASSPATH=${CLASSPATH}:$f;
 done
 
-CMD="time $}JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
+CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} 
${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf 
${@}"
 
 eval $CMD
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/289a875b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
--
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
index 9f46cf7..6f97551 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/MonitorManager.java
@@ -106,8 +106,9 @@ public class MonitorManager implements Runnable {
 rowCount.getAndIncrement();
 }
 try {
+resultHandler.flush();
 Thread.sleep(getMonitorFrequency());
-} catch (InterruptedException e) {
+} catch (Exception e) {
 Thread.currentThread().interrupt();
 e.printStackTrace();
 }
@@ -117,9 +118,7 @@ public class MonitorManager implements Runnable {
 try {
 isRunning = false;
 if (resultHandler != null) {
-resultHandler.flush();
 resultHandler.close();
-
 }
 } catch (Exception e) {
 throw new FileLoaderRuntimeException("Could not close monitor 
results.", e);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/289a875b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
index 0f4dfd1..c51f0dc 100644
--- a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
+++ b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/ResultTest.java
@@ -55,7 +55,7 @@ public class ResultTest {
 resultMonitorWriter.write(result);
 resultMonitorWriter.write(result);
 resultMonitorWriter.write(result);
-resultMonitorWriter.flush();
+resultMonitorWriter.close();
 List results = resultMonitorWriter.read();
 assertEquals("Results did not contain row.", results.size(), 3);
 
@@ -72,7 +72,7 @@ public class ResultTest {
 ExecutorService executorService = Executors.newFixedThreadPool(1);
 MonitorManager monitor = new MonitorManager(100);
 Future future = executorService.submit(monitor);
-List records = null;
+List records;
 final int TIMEOUT = 30;
 
 int ct = 0;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/289a875b/phoenix-pherf/standalone/pherf.sh
--
diff --git a/phoenix-pherf/standalone/pherf.sh 
b/phoenix-pherf/standalone/pherf.sh
index e08035a..2b91d2c 100755
--- 

phoenix git commit: PHOENIX-1728 - Pherf - Make tests use mini cluster. Port from master.

2015-04-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 fa26c1cd3 -> 4f19820eb


PHOENIX-1728 - Pherf - Make tests use mini cluster. Port from master.


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 4f19820eb89f3ee49829e8e7e47daf405139c27e
Parents: fa26c1c
Author: cmarcel 
Authored: Mon Apr 27 10:56:09 2015 -0700
Committer: cmarcel 
Committed: Mon Apr 27 10:56:09 2015 -0700

--
 phoenix-pherf/pom.xml   | 143 ++-
 .../org/apache/phoenix/pherf/DataIngestIT.java  |  88 
 .../apache/phoenix/pherf/SchemaReaderIT.java|  77 ++
 .../java/org/apache/phoenix/pherf/Pherf.java|   1 -
 .../phoenix/pherf/loaddata/DataLoader.java  |  14 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   7 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  48 ---
 .../apache/phoenix/pherf/util/ResourceList.java |   8 +-
 .../pherf/workload/WorkloadExecutor.java|   4 +-
 .../datamodel/create_prod_test_unsalted.sql |   2 +-
 .../scenario/prod_test_unsalted_scenario.xml|   4 +-
 .../phoenix/pherf/BaseTestWithCluster.java  |  45 --
 .../phoenix/pherf/ConfigurationParserTest.java  |   2 +-
 .../apache/phoenix/pherf/DataIngestTest.java|  78 --
 .../apache/phoenix/pherf/DataLoaderTest.java|  94 
 .../org/apache/phoenix/pherf/PherfTest.java |  26 +---
 .../org/apache/phoenix/pherf/ResultTest.java|  12 --
 .../apache/phoenix/pherf/RowCalculatorTest.java |  88 
 .../apache/phoenix/pherf/RuleGeneratorTest.java |   7 +-
 .../apache/phoenix/pherf/SchemaReaderTest.java  |  73 --
 .../apache/phoenix/pherf/TestHBaseProps.java|   1 -
 .../test/resources/datamodel/test_schema.sql|  33 ++---
 .../test/resources/scenario/test_scenario.xml   |   4 +-
 pom.xml |   2 +-
 24 files changed, 432 insertions(+), 429 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4f19820e/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index 26698b2..46eb30c 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -25,9 +25,8 @@
 4.4.0-HBase-0.98-SNAPSHOT
 
 
-pherf
+phoenix-pherf
 jar
-
 Phoenix - Pherf
 
 
@@ -57,23 +56,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -134,23 +123,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -231,6 +210,28 @@
 3.3
 
 
+org.jfree
+jfreechart
+1.0.19
+
+
+joda-time
+joda-time
+1.6.2
+
+
+com.googlecode.java-diff-utils
+diffutils
+1.2.1
+
+
+org.slf4j
+slf4j-log4j12
+1.7.10
+
+
+
+
 junit
 junit
 4.11
@@ -242,41 +243,107 @@
 1.0.0.0
 test
 
-
 
 com.g

phoenix git commit: PHOENIX-1728 - Pherf - Make tests use mini cluster. Port from master.

2015-04-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.1 b453da81f -> 35e15149d


PHOENIX-1728 - Pherf - Make tests use mini cluster. Port from master.


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

Branch: refs/heads/4.4-HBase-1.1
Commit: 35e15149dfa8689f38f279c753e5f02bb7e6eb64
Parents: b453da8
Author: cmarcel 
Authored: Mon Apr 27 10:28:57 2015 -0700
Committer: cmarcel 
Committed: Mon Apr 27 10:28:57 2015 -0700

--
 phoenix-pherf/pom.xml   | 143 ++-
 .../java/org/apache/phoenix/pherf/Pherf.java|   1 -
 .../phoenix/pherf/loaddata/DataLoader.java  |  14 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   7 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  48 ---
 .../apache/phoenix/pherf/util/ResourceList.java |   8 +-
 .../pherf/workload/WorkloadExecutor.java|   4 +-
 .../datamodel/create_prod_test_unsalted.sql |   2 +-
 .../scenario/prod_test_unsalted_scenario.xml|   4 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |   2 +-
 .../org/apache/phoenix/pherf/PherfTest.java |  26 +---
 .../org/apache/phoenix/pherf/ResultTest.java|  12 --
 .../apache/phoenix/pherf/RuleGeneratorTest.java |   7 +-
 .../apache/phoenix/pherf/TestHBaseProps.java|   1 -
 .../test/resources/datamodel/test_schema.sql|  33 ++---
 .../test/resources/scenario/test_scenario.xml   |   4 +-
 pom.xml |   2 +-
 17 files changed, 179 insertions(+), 139 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/35e15149/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index dad3297..0901f71 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -25,9 +25,8 @@
 4.4.0-SNAPSHOT
 
 
-pherf
+phoenix-pherf
 jar
-
 Phoenix - Pherf
 
 
@@ -57,23 +56,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -134,23 +123,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -231,6 +210,28 @@
 3.3
 
 
+org.jfree
+jfreechart
+1.0.19
+
+
+joda-time
+joda-time
+1.6.2
+
+
+com.googlecode.java-diff-utils
+diffutils
+1.2.1
+
+
+org.slf4j
+slf4j-log4j12
+1.7.10
+
+
+
+
 junit
 junit
 4.11
@@ -242,41 +243,107 @@
 1.0.0.0
 test
 
-
 
 com.github.stefanbirkner
 system-rules
 1.8.0
 
 
-log4j
-log4j
-1.2.17
+org.apache.hbase
+hbase-testing-util
+${hbase.version}
+test
+true
+
+
+org.jruby
+jruby-complete
+
+
 
 
-org.jfree
-jfreechart
-   

phoenix git commit: PHOENIX-1728 - Pherf - Make tests use mini cluster. Port from master.

2015-04-27 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/4.4-HBase-1.0 77c5ba76e -> 2a0dc609f


PHOENIX-1728 - Pherf - Make tests use mini cluster. Port from master.


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

Branch: refs/heads/4.4-HBase-1.0
Commit: 2a0dc609faf08af8c9e900cf455bd4505c7d2c8c
Parents: 77c5ba7
Author: cmarcel 
Authored: Mon Apr 27 10:18:47 2015 -0700
Committer: cmarcel 
Committed: Mon Apr 27 10:18:47 2015 -0700

--
 phoenix-pherf/pom.xml   | 143 ++-
 .../java/org/apache/phoenix/pherf/Pherf.java|   1 -
 .../phoenix/pherf/loaddata/DataLoader.java  |  14 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   7 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  48 ---
 .../apache/phoenix/pherf/util/ResourceList.java |   8 +-
 .../pherf/workload/WorkloadExecutor.java|   4 +-
 .../datamodel/create_prod_test_unsalted.sql |   2 +-
 .../scenario/prod_test_unsalted_scenario.xml|   4 +-
 .../phoenix/pherf/BaseTestWithCluster.java  |  45 --
 .../phoenix/pherf/ConfigurationParserTest.java  |   2 +-
 .../apache/phoenix/pherf/DataIngestTest.java|  78 --
 .../apache/phoenix/pherf/DataLoaderTest.java|  94 
 .../org/apache/phoenix/pherf/PherfTest.java |  26 +---
 .../org/apache/phoenix/pherf/ResultTest.java|  12 --
 .../apache/phoenix/pherf/RuleGeneratorTest.java |   7 +-
 .../apache/phoenix/pherf/SchemaReaderTest.java  |  73 --
 .../apache/phoenix/pherf/TestHBaseProps.java|   1 -
 .../test/resources/datamodel/test_schema.sql|  33 ++---
 .../test/resources/scenario/test_scenario.xml   |   4 +-
 pom.xml |   2 +-
 21 files changed, 179 insertions(+), 429 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a0dc609/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index dad3297..0901f71 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -25,9 +25,8 @@
 4.4.0-SNAPSHOT
 
 
-pherf
+phoenix-pherf
 jar
-
 Phoenix - Pherf
 
 
@@ -57,23 +56,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -134,23 +123,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -231,6 +210,28 @@
 3.3
 
 
+org.jfree
+jfreechart
+1.0.19
+
+
+joda-time
+joda-time
+1.6.2
+
+
+com.googlecode.java-diff-utils
+diffutils
+1.2.1
+
+
+org.slf4j
+slf4j-log4j12
+1.7.10
+
+
+
+
 junit
 junit
 4.11
@@ -242,41 +243,107 @@
 1.0.0.0
 test
 
-
 
 com.github.stefanbirkner
 system-rules
 1.8.0
 
 
-log4j
-log4j
-1.2.17
+org.apache.hbase
+hbase-testing-util
+ 

phoenix git commit: PHOENIX-1728 - Pherf - Make tests use mini cluster. Removed extra files

2015-04-24 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master d28bb5f85 -> 235735872


PHOENIX-1728 - Pherf - Make tests use mini cluster. Removed extra files


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

Branch: refs/heads/master
Commit: 235735872bd171c10b3676ad0be6fe958a12e7a3
Parents: d28bb5f
Author: Cody Marcel 
Authored: Fri Apr 24 17:06:04 2015 -0700
Committer: Cody Marcel 
Committed: Fri Apr 24 17:06:04 2015 -0700

--
 .../phoenix/pherf/BaseTestWithCluster.java  | 45 --
 .../apache/phoenix/pherf/DataIngestTest.java| 78 
 .../apache/phoenix/pherf/DataLoaderTest.java| 94 
 .../apache/phoenix/pherf/SchemaReaderTest.java  | 73 ---
 4 files changed, 290 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/23573587/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/BaseTestWithCluster.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/BaseTestWithCluster.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/BaseTestWithCluster.java
deleted file mode 100644
index 8e33a15..000
--- 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/BaseTestWithCluster.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you under the Apache License, Version 2.0 (the
- *   "License"); you may not use this file except in compliance
- *   with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- */
-
-package org.apache.phoenix.pherf;
-
-import org.apache.phoenix.pherf.util.PhoenixUtil;
-import org.junit.BeforeClass;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static org.junit.Assert.assertNotNull;
-
-public class BaseTestWithCluster {
-static final String matcherScenario = PherfConstants.SCENARIO_ROOT_PATTERN 
+ ".xml";
-private static final Logger logger = 
LoggerFactory.getLogger(BaseTestWithCluster.class);
-protected static PhoenixUtil util;
-
-@BeforeClass
-public static void initQuorum() {
-util = new PhoenixUtil();
-String zookeeper = ((System.getProperty("ZK_QUORUM") == null) || 
System.getProperty("ZK_QUORUM").equals("")) ? "localhost" : 
System.getProperty("ZK_QUORUM");
-PhoenixUtil.setZookeeper(zookeeper);
-logger.info("Using quorum:" + zookeeper);
-}
-}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/23573587/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/DataIngestTest.java
--
diff --git 
a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/DataIngestTest.java 
b/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/DataIngestTest.java
deleted file mode 100644
index 0fc0dd9..000
--- a/phoenix-pherf/src/test/java/org/apache/phoenix/pherf/DataIngestTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you under the Apache License, Version 2.0 (the
- *   "License"); you may not use this file except in compliance
- *   with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- */
-
-package org.apache.phoenix.pherf;
-
-import org.apache.phoenix.pherf.configuration.Column;
-import org.apache.phoenix.pherf.configuration.DataTypeMapp

phoenix git commit: PHOENIX-1728 - Pherf - Make tests use mini cluster. Some files were missing from previous commit.

2015-04-24 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master 6e1c6a485 -> d28bb5f85


PHOENIX-1728 - Pherf - Make tests use mini cluster. Some files were missing 
from previous commit.


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

Branch: refs/heads/master
Commit: d28bb5f859cd609295f1e219b437f0be2dc2bc1c
Parents: 6e1c6a4
Author: Cody Marcel 
Authored: Fri Apr 24 17:02:46 2015 -0700
Committer: Cody Marcel 
Committed: Fri Apr 24 17:02:46 2015 -0700

--
 .gitignore  |   1 +
 phoenix-pherf/pom.xml   | 143 ++-
 .../java/org/apache/phoenix/pherf/Pherf.java|   1 -
 .../phoenix/pherf/loaddata/DataLoader.java  |  14 +-
 .../phoenix/pherf/schema/SchemaReader.java  |   7 +-
 .../apache/phoenix/pherf/util/PhoenixUtil.java  |  48 ---
 .../apache/phoenix/pherf/util/ResourceList.java |   8 +-
 .../pherf/workload/WorkloadExecutor.java|   4 +-
 .../datamodel/create_prod_test_unsalted.sql |   2 +-
 .../scenario/prod_test_unsalted_scenario.xml|   4 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |   2 +-
 .../org/apache/phoenix/pherf/PherfTest.java |  26 +---
 .../org/apache/phoenix/pherf/ResultTest.java|  12 --
 .../apache/phoenix/pherf/RuleGeneratorTest.java |   7 +-
 .../apache/phoenix/pherf/TestHBaseProps.java|   1 -
 .../test/resources/datamodel/test_schema.sql|  33 ++---
 .../test/resources/scenario/test_scenario.xml   |   4 +-
 pom.xml |   2 +-
 18 files changed, 180 insertions(+), 139 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d28bb5f8/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 705d30b..fc0e4af 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@
 #maven stuffs
 target/
 release/
+RESULTS/

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d28bb5f8/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index c1247a5..337f69c 100644
--- a/phoenix-pherf/pom.xml
+++ b/phoenix-pherf/pom.xml
@@ -25,9 +25,8 @@
 4.5.0-SNAPSHOT
 
 
-pherf
+phoenix-pherf
 jar
-
 Phoenix - Pherf
 
 
@@ -57,23 +56,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -134,23 +123,13 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-true
-
-
${logging.location}
-${project.basedir}
-
-
 
 
 org.apache.maven.plugins
 maven-resources-plugin
-2.4
 
 
 maven-assembly-plugin
-2.4
 
 
 make-dependency-jar
@@ -231,6 +210,28 @@
 3.3
 
 
+org.jfree
+jfreechart
+1.0.19
+
+
+joda-time
+joda-time
+1.6.2
+
+
+com.googlecode.java-diff-utils
+diffutils
+1.2.1
+
+
+org.slf4j
+slf4j-log4j12
+1.7.10
+
+
+
+
 junit
 junit
 4.11
@@ -242,41 +243,107 @@
 1.0.0.0
 test
 
-
 
 com.github.stefanbirkner
 system-rules
 1.8.0
 
 
-

[1/2] phoenix git commit: PHOENIX-1728 Pherf - Make tests use mini cluster

2015-04-23 Thread codymarcel
Repository: phoenix
Updated Branches:
  refs/heads/master bb30ed516 -> ee5b6707b


PHOENIX-1728 Pherf - Make tests use mini cluster


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

Branch: refs/heads/master
Commit: 254024f9c97ffa541fbc097a89e2bd2859fa02a2
Parents: 136f7ee
Author: cmarcel 
Authored: Thu Apr 23 15:26:48 2015 -0700
Committer: cmarcel 
Committed: Thu Apr 23 15:26:48 2015 -0700

--
 .../org/apache/phoenix/pherf/DataIngestIT.java  | 88 
 .../apache/phoenix/pherf/SchemaReaderIT.java| 77 +
 .../apache/phoenix/pherf/RowCalculatorTest.java | 88 
 3 files changed, 253 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/254024f9/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
--
diff --git 
a/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java 
b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
new file mode 100644
index 000..b29656d
--- /dev/null
+++ b/phoenix-pherf/src/it/java/org/apache/phoenix/pherf/DataIngestIT.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+package org.apache.phoenix.pherf;
+
+import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
+import org.apache.phoenix.pherf.configuration.Column;
+import org.apache.phoenix.pherf.configuration.DataTypeMapping;
+import org.apache.phoenix.pherf.configuration.Scenario;
+import org.apache.phoenix.pherf.configuration.XMLConfigParser;
+import org.apache.phoenix.pherf.loaddata.DataLoader;
+import org.apache.phoenix.pherf.rules.DataValue;
+import org.apache.phoenix.pherf.rules.RulesApplier;
+import org.apache.phoenix.pherf.schema.SchemaReader;
+import org.apache.phoenix.pherf.util.PhoenixUtil;
+import org.junit.Test;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class DataIngestIT extends BaseHBaseManagedTimeIT {
+protected static PhoenixUtil util = new PhoenixUtil(true);
+static final String matcherScenario = ".*scenario/.*test.*xml";
+static final String matcherSchema = ".*datamodel/.*test.*sql";
+
+@Test
+public void generateData() throws Exception {
+util.setZookeeper("localhost");
+SchemaReader reader = new SchemaReader(util, matcherSchema);
+XMLConfigParser parser = new XMLConfigParser(matcherScenario);
+
+// 1. Generate table schema from file
+List resources = new ArrayList<>(reader.getResourceList());
+assertTrue("Could not pull list of schema files.", resources.size() > 
0);
+assertNotNull("Could not read schema file.", 
reader.resourceToString(resources.get(0)));
+reader.applySchema();
+
+// 2. Load the metadata of for the test tables
+Scenario scenario = parser.getScenarios().get(0);
+List columnListFromPhoenix = 
util.getColumnsFromPhoenix(scenario.getSchemaName(), 
scenario.getTableNameWithoutSchemaName(), util.getConnection());
+assertTrue("Could not get phoenix columns.", 
columnListFromPhoenix.size() > 0);
+DataLoader loader = new DataLoader(util,parser);
+RulesApplier rulesApplier = loader.getRulesApplier();
+List modelList = rulesApplier.getModelList();
+assertTrue("Could not generate the modelList", modelList.size() > 0);
+
+for (Column column : columnListFromPhoenix) {
+DataValue data = rulesApplier.getDataForRule(scenario, column);
+
+// We are generating data values so the value should have been 
specified by this point.
+assertTrue("Failed to retrieve data for column type: " + 
co

[2/2] phoenix git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/phoenix

2015-04-23 Thread codymarcel
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/phoenix


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

Branch: refs/heads/master
Commit: ee5b6707ba3717f3806584daaf23706ef7c8bd4b
Parents: 254024f bb30ed5
Author: cmarcel 
Authored: Thu Apr 23 15:28:46 2015 -0700
Committer: cmarcel 
Committed: Thu Apr 23 15:28:46 2015 -0700

--
 dev/test-patch.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--




  1   2   >