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 <cmar...@cmarcel-wsl1.internal.salesforce.com>
Authored: Mon Nov 2 16:15:02 2015 -0800
Committer: Cody Marcel <cmar...@cmarcel-wsl1.internal.salesforce.com>
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 getDefault    True 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<ResultValue> 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<ResultValue> rowValues = new ArrayList<>();

Reply via email to