phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndimi...@apache.org
Subject phoenix git commit: PHOENIX-2495 Fix test failures in CsvBulkLoadToolIT
Date Thu, 10 Dec 2015 01:50:17 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 dbd697eb3 -> f995761e6


PHOENIX-2495 Fix test failures in CsvBulkLoadToolIT


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

Branch: refs/heads/4.x-HBase-1.0
Commit: f995761e685eee2882362461339c4f7040894b11
Parents: dbd697e
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Wed Dec 9 16:51:18 2015 -0800
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Wed Dec 9 17:46:22 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java  | 2 +-
 .../org/apache/phoenix/mapreduce/CsvToKeyValueMapper.java     | 1 +
 .../org/apache/phoenix/mapreduce/FormatToKeyValueMapper.java  | 7 ++++++-
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f995761e/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
index a5b7488..4a440d6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
@@ -228,7 +228,7 @@ public class CsvBulkLoadToolIT {
                     "--zookeeper", zkQuorum});
             fail("Csv bulk load currently has issues with local indexes.");
         } catch( UnsupportedOperationException ise) {
-            assertEquals("Local indexes not supported by CSV Bulk Loader",ise.getMessage());
+            assertEquals("Local indexes not supported by Bulk Loader",ise.getMessage());
         }
         
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f995761e/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvToKeyValueMapper.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvToKeyValueMapper.java
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvToKeyValueMapper.java
index 5a5d378..2cb1ac7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvToKeyValueMapper.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvToKeyValueMapper.java
@@ -64,6 +64,7 @@ public class CsvToKeyValueMapper extends FormatToKeyValueMapper<CSVRecord>
{
 
     @Override
     protected void setup(Context context) throws IOException, InterruptedException {
+        super.setup(context);
         Configuration conf = context.getConfiguration();
         lineParser = new CsvLineParser(
                 CsvBulkImportUtil.getCharacter(conf, FIELD_DELIMITER_CONFKEY),

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f995761e/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToKeyValueMapper.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToKeyValueMapper.java
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToKeyValueMapper.java
index b2e99e5..7e115e5 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToKeyValueMapper.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToKeyValueMapper.java
@@ -128,6 +128,9 @@ public abstract class FormatToKeyValueMapper<RECORD> extends Mapper<LongWritable
     @SuppressWarnings("deprecation")
     @Override
     protected void map(LongWritable key, Text value, Context context) throws IOException,
InterruptedException {
+        if (conn == null) {
+            throw new RuntimeException("Connection not initialized.");
+        }
         try {
             RECORD record = null;
             try {
@@ -171,7 +174,9 @@ public abstract class FormatToKeyValueMapper<RECORD> extends Mapper<LongWritable
     @Override
     protected void cleanup(Context context) throws IOException, InterruptedException {
         try {
-            conn.close();
+            if (conn != null) {
+                conn.close();
+            }
         } catch (SQLException e) {
             throw new RuntimeException(e);
         }


Mime
View raw message