avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [1/2] avro git commit: AVRO-2053: Remove Reference To Deprecated Property mapred.output.compression.type
Date Tue, 12 Sep 2017 13:58:54 GMT
Repository: avro
Updated Branches:
  refs/heads/master 6f8c72773 -> 9f3ceefda


AVRO-2053: Remove Reference To Deprecated Property mapred.output.compression.type


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

Branch: refs/heads/master
Commit: ce3f821a79d2a653a08da2ac26a14df9deccb7ec
Parents: 6f8c727
Author: BELUGA BEHR <dam6923@gmail.com>
Authored: Tue Sep 12 15:16:52 2017 +0200
Committer: Gabor Szadovszky <gabor@apache.org>
Committed: Tue Sep 12 15:16:52 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                          |  3 +++
 .../avro/mapreduce/AvroSequenceFileOutputFormat.java | 15 ++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/ce3f821a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cd389ae..95ffd0a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -83,6 +83,9 @@ Trunk (not yet released)
     AVRO-2048: Avro Binary Decoding - Gracefully Handle Long Strings
     (Beluga Behr via gabor)
 
+    AVRO-2053: Remove Reference To Deprecated Property mapred.output.compression.type
+    (Beluga Behr via gabor)
+
   BUG FIXES
 
     AVRO-1741: Python3: Fix error when codec is not in the header.

http://git-wip-us.apache.org/repos/asf/avro/blob/ce3f821a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroSequenceFileOutputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroSequenceFileOutputFormat.java
b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroSequenceFileOutputFormat.java
index 064c5ce..8728be3 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroSequenceFileOutputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroSequenceFileOutputFormat.java
@@ -43,12 +43,6 @@ import org.apache.hadoop.util.ReflectionUtils;
  * @param <V> The job output value type (may be a Writable, AvroValue).
  */
 public class AvroSequenceFileOutputFormat<K, V> extends FileOutputFormat<K, V>
{
-  /** Configuration key for storing the type of compression for the target sequence file.
*/
-  private static final String CONF_COMPRESSION_TYPE = "mapred.output.compression.type";
-
-  /** The default compression type for the target sequence file. */
-  private static final CompressionType DEFAULT_COMPRESSION_TYPE = CompressionType.RECORD;
-
   /** {@inheritDoc} */
   @Override
   public RecordWriter<K, V> getRecordWriter(TaskAttemptContext context)
@@ -112,7 +106,7 @@ public class AvroSequenceFileOutputFormat<K, V> extends FileOutputFormat<K,
V> {
    */
   public static void setOutputCompressionType(Job job, CompressionType compressionType) {
     setCompressOutput(job, true);
-    job.getConfiguration().set(CONF_COMPRESSION_TYPE, compressionType.name());
+    job.getConfiguration().set(FileOutputFormat.COMPRESS_TYPE, compressionType.name());
   }
 
   /**
@@ -122,7 +116,10 @@ public class AvroSequenceFileOutputFormat<K, V> extends FileOutputFormat<K,
V> {
    * @return The compression type.
    */
   public static CompressionType getOutputCompressionType(Configuration conf) {
-    String typeName = conf.get(CONF_COMPRESSION_TYPE, DEFAULT_COMPRESSION_TYPE.name());
-    return CompressionType.valueOf(typeName);
+    String typeName = conf.get(FileOutputFormat.COMPRESS_TYPE);
+    if (typeName != null) {
+      return CompressionType.valueOf(typeName);
+    }
+    return SequenceFile.getDefaultCompressionType(conf);
   }
 }


Mime
View raw message