cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [2/2] git commit: Pig: fix widerow/secondary env toggles Patch by brandonwilliams reviewed by Jeremy Hanna for CASSANDRA-4749
Date Fri, 12 Oct 2012 03:03:06 GMT
Pig: fix widerow/secondary env toggles
Patch by brandonwilliams reviewed by Jeremy Hanna for CASSANDRA-4749


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

Branch: refs/heads/trunk
Commit: 6407cbcaccc0de664fcc0f1e722ebe431bf4db49
Parents: 4355aa8
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Thu Oct 11 22:00:08 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Thu Oct 11 22:00:08 2012 -0500

----------------------------------------------------------------------
 .../cassandra/hadoop/pig/CassandraStorage.java     |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6407cbca/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java b/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
index 49d8eac..8f539a9 100644
--- a/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
+++ b/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
@@ -83,8 +83,6 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface,
Lo
 
     private final static String DEFAULT_INPUT_FORMAT = "org.apache.cassandra.hadoop.ColumnFamilyInputFormat";
     private final static String DEFAULT_OUTPUT_FORMAT = "org.apache.cassandra.hadoop.ColumnFamilyOutputFormat";
-    private final static boolean DEFAULT_WIDEROW_INPUT = false;
-    private final static boolean DEFAULT_USE_SECONDARY = false;
 
     private final static String PARTITION_FILTER_SIGNATURE = "cassandra.partition.filter";
 
@@ -106,8 +104,8 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface,
Lo
     private String inputFormatClass;
     private String outputFormatClass;
     private int limit;
-    private boolean widerows;
-    private boolean usePartitionFilter;
+    private boolean widerows = false;
+    private boolean usePartitionFilter = false;
     // wide row hacks
     private ByteBuffer lastKey;
     private Map<ByteBuffer,IColumn> lastRow;
@@ -567,11 +565,9 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface,
Lo
             SlicePredicate predicate = new SlicePredicate().setSlice_range(range);
             ConfigHelper.setInputSlicePredicate(conf, predicate);
         }
-        widerows = DEFAULT_WIDEROW_INPUT;
         if (System.getenv(PIG_WIDEROW_INPUT) != null)
-            widerows = Boolean.valueOf(System.getProperty(PIG_WIDEROW_INPUT));
-        usePartitionFilter = DEFAULT_USE_SECONDARY;
-        if (System.getenv() != null)
+            widerows = Boolean.valueOf(System.getenv(PIG_WIDEROW_INPUT));
+        if (System.getenv(PIG_USE_SECONDARY) != null)
             usePartitionFilter = Boolean.valueOf(System.getenv(PIG_USE_SECONDARY));
 
         if (usePartitionFilter && getIndexExpressions() != null)
@@ -815,8 +811,7 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface,
Lo
             throw new IOException("PIG_OUTPUT_PARTITIONER or PIG_PARTITIONER environment
variable not set");
 
         // we have to do this again here for the check in writeColumnsFromTuple
-        usePartitionFilter = DEFAULT_USE_SECONDARY;
-        if (System.getenv() != null)
+        if (System.getenv(PIG_USE_SECONDARY) != null)
             usePartitionFilter = Boolean.valueOf(System.getenv(PIG_USE_SECONDARY));
 
         initSchema(storeSignature);


Mime
View raw message