incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [5/6] git commit: Null check on counters in the outputformat.
Date Thu, 10 Jul 2014 00:56:21 GMT
Null check on counters in the outputformat.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/92f14c8e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/92f14c8e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/92f14c8e

Branch: refs/heads/apache-blur-0.2
Commit: 92f14c8e6cfdc026043a8488f17fee02c879319a
Parents: a19ad8c
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Jul 9 20:52:09 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Jul 9 20:52:09 2014 -0400

----------------------------------------------------------------------
 .../mapreduce/lib/GenericBlurRecordWriter.java  | 22 +++++++++++---------
 .../mapreduce/lib/GenericBlurRecordWriter.java  | 22 +++++++++++---------
 2 files changed, 24 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/92f14c8e/blur-mapred-hadoop1/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
----------------------------------------------------------------------
diff --git a/blur-mapred-hadoop1/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
b/blur-mapred-hadoop1/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
index 83e011b..5b7c3ee 100644
--- a/blur-mapred-hadoop1/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
+++ b/blur-mapred-hadoop1/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
@@ -182,16 +182,18 @@ public class GenericBlurRecordWriter {
 
   private void setupCounter() {
     GetCounter getCounter = BlurOutputFormat.getGetCounter();
-    _fieldCount = getCounter.getCounter(BlurCounters.LUCENE_FIELD_COUNT);
-    _columnCount = getCounter.getCounter(BlurCounters.COLUMN_COUNT);
-    _recordCount = getCounter.getCounter(BlurCounters.RECORD_COUNT);
-    _recordDuplicateCount = getCounter.getCounter(BlurCounters.RECORD_DUPLICATE_COUNT);
-    _rowCount = getCounter.getCounter(BlurCounters.ROW_COUNT);
-    _rowDeleteCount = getCounter.getCounter(BlurCounters.ROW_DELETE_COUNT);
-    _rowOverFlowCount = getCounter.getCounter(BlurCounters.ROW_OVERFLOW_COUNT);
-    _recordRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.RECORD_RATE));
-    _rowRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.ROW_RATE));
-    _copyRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.COPY_RATE));
+    if (getCounter != null) {
+      _fieldCount = getCounter.getCounter(BlurCounters.LUCENE_FIELD_COUNT);
+      _columnCount = getCounter.getCounter(BlurCounters.COLUMN_COUNT);
+      _recordCount = getCounter.getCounter(BlurCounters.RECORD_COUNT);
+      _recordDuplicateCount = getCounter.getCounter(BlurCounters.RECORD_DUPLICATE_COUNT);
+      _rowCount = getCounter.getCounter(BlurCounters.ROW_COUNT);
+      _rowDeleteCount = getCounter.getCounter(BlurCounters.ROW_DELETE_COUNT);
+      _rowOverFlowCount = getCounter.getCounter(BlurCounters.ROW_OVERFLOW_COUNT);
+      _recordRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.RECORD_RATE));
+      _rowRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.ROW_RATE));
+      _copyRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.COPY_RATE));
+    }
   }
 
   private void add(BlurMutate value) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/92f14c8e/blur-mapred-hadoop2/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
----------------------------------------------------------------------
diff --git a/blur-mapred-hadoop2/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
b/blur-mapred-hadoop2/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
index 0a4544c..06e9bc2 100644
--- a/blur-mapred-hadoop2/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
+++ b/blur-mapred-hadoop2/src/main/java/org/apache/blur/mapreduce/lib/GenericBlurRecordWriter.java
@@ -182,16 +182,18 @@ public class GenericBlurRecordWriter {
 
   private void setupCounter() {
     GetCounter getCounter = BlurOutputFormat.getGetCounter();
-    _fieldCount = getCounter.getCounter(BlurCounters.LUCENE_FIELD_COUNT);
-    _columnCount = getCounter.getCounter(BlurCounters.COLUMN_COUNT);
-    _recordCount = getCounter.getCounter(BlurCounters.RECORD_COUNT);
-    _recordDuplicateCount = getCounter.getCounter(BlurCounters.RECORD_DUPLICATE_COUNT);
-    _rowCount = getCounter.getCounter(BlurCounters.ROW_COUNT);
-    _rowDeleteCount = getCounter.getCounter(BlurCounters.ROW_DELETE_COUNT);
-    _rowOverFlowCount = getCounter.getCounter(BlurCounters.ROW_OVERFLOW_COUNT);
-    _recordRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.RECORD_RATE));
-    _rowRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.ROW_RATE));
-    _copyRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.COPY_RATE));
+    if (getCounter != null) {
+      _fieldCount = getCounter.getCounter(BlurCounters.LUCENE_FIELD_COUNT);
+      _columnCount = getCounter.getCounter(BlurCounters.COLUMN_COUNT);
+      _recordCount = getCounter.getCounter(BlurCounters.RECORD_COUNT);
+      _recordDuplicateCount = getCounter.getCounter(BlurCounters.RECORD_DUPLICATE_COUNT);
+      _rowCount = getCounter.getCounter(BlurCounters.ROW_COUNT);
+      _rowDeleteCount = getCounter.getCounter(BlurCounters.ROW_DELETE_COUNT);
+      _rowOverFlowCount = getCounter.getCounter(BlurCounters.ROW_OVERFLOW_COUNT);
+      _recordRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.RECORD_RATE));
+      _rowRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.ROW_RATE));
+      _copyRateCounter = new RateCounter(getCounter.getCounter(BlurCounters.COPY_RATE));
+    }
   }
 
   private void add(BlurMutate value) throws IOException {


Mime
View raw message