HADOOP-9216. CompressionCodecFactory#getCodecClasses should trim the result of parsing by Configuration. Contributed by Tsuyoshi Ozawa.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1434570 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f596c9b629
commit
7b5b90599f
|
@ -126,6 +126,9 @@ Release 2.0.3-alpha - Unreleased
|
||||||
HADOOP-9106. Allow configuration of IPC connect timeout.
|
HADOOP-9106. Allow configuration of IPC connect timeout.
|
||||||
(Rober Parker via suresh)
|
(Rober Parker via suresh)
|
||||||
|
|
||||||
|
HADOOP-9216. CompressionCodecFactory#getCodecClasses should trim the
|
||||||
|
result of parsing by Configuration. (Tsuyoshi Ozawa via todd)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HADOOP-8866. SampleQuantiles#query is O(N^2) instead of O(N). (Andrew Wang
|
HADOOP-8866. SampleQuantiles#query is O(N^2) instead of O(N). (Andrew Wang
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class CompressionCodecFactory {
|
||||||
if (codecsString != null) {
|
if (codecsString != null) {
|
||||||
StringTokenizer codecSplit = new StringTokenizer(codecsString, ",");
|
StringTokenizer codecSplit = new StringTokenizer(codecsString, ",");
|
||||||
while (codecSplit.hasMoreElements()) {
|
while (codecSplit.hasMoreElements()) {
|
||||||
String codecSubstring = codecSplit.nextToken();
|
String codecSubstring = codecSplit.nextToken().trim();
|
||||||
if (codecSubstring.length() != 0) {
|
if (codecSubstring.length() != 0) {
|
||||||
try {
|
try {
|
||||||
Class<?> cls = conf.getClassByName(codecSubstring);
|
Class<?> cls = conf.getClassByName(codecSubstring);
|
||||||
|
|
|
@ -256,5 +256,17 @@ public class TestCodecFactory extends TestCase {
|
||||||
checkCodec("overridden factory for .gz", NewGzipCodec.class, codec);
|
checkCodec("overridden factory for .gz", NewGzipCodec.class, codec);
|
||||||
codec = factory.getCodecByClassName(NewGzipCodec.class.getCanonicalName());
|
codec = factory.getCodecByClassName(NewGzipCodec.class.getCanonicalName());
|
||||||
checkCodec("overridden factory for gzip codec", NewGzipCodec.class, codec);
|
checkCodec("overridden factory for gzip codec", NewGzipCodec.class, codec);
|
||||||
|
|
||||||
|
Configuration conf = new Configuration();
|
||||||
|
conf.set("io.compression.codecs",
|
||||||
|
" org.apache.hadoop.io.compress.GzipCodec , " +
|
||||||
|
" org.apache.hadoop.io.compress.DefaultCodec , " +
|
||||||
|
" org.apache.hadoop.io.compress.BZip2Codec ");
|
||||||
|
try {
|
||||||
|
CompressionCodecFactory.getCodecClasses(conf);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
fail("IllegalArgumentException is unexpected");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue