You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by ab...@apache.org on 2021/04/10 08:14:54 UTC
[tez] branch branch-0.9 updated: TEZ-4302: NullPointerException in
CodecUtils with GzipCodec (#117) (Xi Chen reviewed by Laszlo Bodor)
This is an automated email from the ASF dual-hosted git repository.
abstractdog pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/tez.git
The following commit(s) were added to refs/heads/branch-0.9 by this push:
new 9e97913 TEZ-4302: NullPointerException in CodecUtils with GzipCodec (#117) (Xi Chen reviewed by Laszlo Bodor)
9e97913 is described below
commit 9e9791339cc35ccff72a6990ad5f29261a5346fd
Author: jshmchenxi <js...@gmail.com>
AuthorDate: Sat Apr 10 16:11:48 2021 +0800
TEZ-4302: NullPointerException in CodecUtils with GzipCodec (#117) (Xi Chen reviewed by Laszlo Bodor)
---
.../java/org/apache/tez/runtime/library/common/TezRuntimeUtils.java | 5 ++++-
.../main/java/org/apache/tez/runtime/library/utils/CodecUtils.java | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/TezRuntimeUtils.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/TezRuntimeUtils.java
index b33b4cd..815018c 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/TezRuntimeUtils.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/TezRuntimeUtils.java
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
+import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
import org.apache.tez.dag.api.TezUncheckedException;
import org.apache.tez.runtime.api.OutputContext;
import org.apache.tez.runtime.api.TaskContext;
@@ -269,7 +270,9 @@ public class TezRuntimeUtils {
public static String getBufferSizeProperty(String className) {
switch (className) {
case "org.apache.hadoop.io.compress.DefaultCodec":
- return "io.file.buffer.size";
+ case "org.apache.hadoop.io.compress.BZip2Codec":
+ case "org.apache.hadoop.io.compress.GzipCodec":
+ return CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY;
case "org.apache.hadoop.io.compress.SnappyCodec":
return CommonConfigurationKeys.IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY;
case "org.apache.hadoop.io.compress.LzoCodec":
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/CodecUtils.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/CodecUtils.java
index 99d22c5..8e5154f 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/CodecUtils.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/CodecUtils.java
@@ -78,7 +78,8 @@ public final class CodecUtils {
throws IOException {
String bufferSizeProp = TezRuntimeUtils.getBufferSizeProperty(codec);
Configurable configurableCodec = (Configurable) codec;
- int originalSize = configurableCodec.getConf().getInt(bufferSizeProp, DEFAULT_BUFFER_SIZE);
+ int originalSize = bufferSizeProp == null ? DEFAULT_BUFFER_SIZE :
+ configurableCodec.getConf().getInt(bufferSizeProp, DEFAULT_BUFFER_SIZE);
CompressionInputStream in = null;