HADOOP-13665. Erasure Coding codec should support fallback coder. Contributed by Kai Sasaki.

This commit is contained in:
Wei-Chiu Chuang 2017-04-11 07:31:29 -07:00
parent 90d97372ed
commit f050afb578
10 changed files with 164 additions and 81 deletions

View File

@ -18,6 +18,10 @@
package org.apache.hadoop.io.erasurecode; package org.apache.hadoop.io.erasurecode;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.erasurecode.codec.ErasureCodec; import org.apache.hadoop.io.erasurecode.codec.ErasureCodec;
@ -26,6 +30,8 @@ import org.apache.hadoop.io.erasurecode.codec.RSErasureCodec;
import org.apache.hadoop.io.erasurecode.codec.XORErasureCodec; import org.apache.hadoop.io.erasurecode.codec.XORErasureCodec;
import org.apache.hadoop.io.erasurecode.coder.ErasureDecoder; import org.apache.hadoop.io.erasurecode.coder.ErasureDecoder;
import org.apache.hadoop.io.erasurecode.coder.ErasureEncoder; import org.apache.hadoop.io.erasurecode.coder.ErasureEncoder;
import org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawErasureCoderFactory;
import org.apache.hadoop.io.erasurecode.rawcoder.NativeXORRawErasureCoderFactory;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory; import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactoryLegacy; import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactoryLegacy;
import org.apache.hadoop.io.erasurecode.rawcoder.RawErasureCoderFactory; import org.apache.hadoop.io.erasurecode.rawcoder.RawErasureCoderFactory;
@ -35,6 +41,7 @@ import org.apache.hadoop.io.erasurecode.rawcoder.XORRawErasureCoderFactory;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.Map;
/** /**
* A codec & coder utility to help create coders conveniently. * A codec & coder utility to help create coders conveniently.
@ -49,41 +56,50 @@ import java.lang.reflect.InvocationTargetException;
@InterfaceAudience.Private @InterfaceAudience.Private
public final class CodecUtil { public final class CodecUtil {
private static final Log LOG = LogFactory.getLog(CodecUtil.class);
public static final String IO_ERASURECODE_CODEC = "io.erasurecode.codec.";
/** Erasure coder XOR codec. */ /** Erasure coder XOR codec. */
public static final String IO_ERASURECODE_CODEC_XOR_KEY = public static final String IO_ERASURECODE_CODEC_XOR_KEY =
"io.erasurecode.codec.xor"; IO_ERASURECODE_CODEC + "xor";
public static final String IO_ERASURECODE_CODEC_XOR = public static final String IO_ERASURECODE_CODEC_XOR =
XORErasureCodec.class.getCanonicalName(); XORErasureCodec.class.getCanonicalName();
/** Erasure coder Reed-Solomon codec. */ /** Erasure coder Reed-Solomon codec. */
public static final String IO_ERASURECODE_CODEC_RS_KEY = public static final String IO_ERASURECODE_CODEC_RS_KEY =
"io.erasurecode.codec.rs"; IO_ERASURECODE_CODEC + "rs";
public static final String IO_ERASURECODE_CODEC_RS = public static final String IO_ERASURECODE_CODEC_RS =
RSErasureCodec.class.getCanonicalName(); RSErasureCodec.class.getCanonicalName();
/** Erasure coder hitch hiker XOR codec. */ /** Erasure coder hitch hiker XOR codec. */
public static final String IO_ERASURECODE_CODEC_HHXOR_KEY = public static final String IO_ERASURECODE_CODEC_HHXOR_KEY =
"io.erasurecode.codec.hhxor"; IO_ERASURECODE_CODEC + "hhxor";
public static final String IO_ERASURECODE_CODEC_HHXOR = public static final String IO_ERASURECODE_CODEC_HHXOR =
HHXORErasureCodec.class.getCanonicalName(); HHXORErasureCodec.class.getCanonicalName();
/** Supported erasure codec classes. */ /** Comma separated raw codec name. The first coder is prior to the latter. */
public static final String IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODERS_KEY =
/** Raw coder factory for the RS codec. */ IO_ERASURECODE_CODEC + "rs-legacy.rawcoders";
public static final String IO_ERASURECODE_CODEC_RS_RAWCODER_KEY = public static final String IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODERS_DEFAULT =
"io.erasurecode.codec.rs.rawcoder";
public static final String IO_ERASURECODE_CODEC_RS_RAWCODER_DEFAULT =
RSRawErasureCoderFactory.class.getCanonicalName();
/** Raw coder factory for the RS legacy codec. */
public static final String IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODER_KEY =
"io.erasurecode.codec.rs-legacy.rawcoder";
public static final String IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODER_DEFAULT =
RSRawErasureCoderFactoryLegacy.class.getCanonicalName(); RSRawErasureCoderFactoryLegacy.class.getCanonicalName();
public static final String IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY =
IO_ERASURECODE_CODEC + "rs.rawcoders";
public static final String IO_ERASURECODE_CODEC_RS_RAWCODERS_DEFAULT =
NativeRSRawErasureCoderFactory.class.getCanonicalName() +
"," + RSRawErasureCoderFactory.class.getCanonicalName();
/** Raw coder factory for the XOR codec. */ /** Raw coder factory for the XOR codec. */
public static final String IO_ERASURECODE_CODEC_XOR_RAWCODER_KEY = public static final String IO_ERASURECODE_CODEC_XOR_RAWCODERS_KEY =
"io.erasurecode.codec.xor.rawcoder"; IO_ERASURECODE_CODEC + "xor.rawcoders";
public static final String IO_ERASURECODE_CODEC_XOR_RAWCODER_DEFAULT = public static final String IO_ERASURECODE_CODEC_XOR_RAWCODERS_DEFAULT =
XORRawErasureCoderFactory.class.getCanonicalName(); NativeXORRawErasureCoderFactory.class.getCanonicalName() +
"," + XORRawErasureCoderFactory.class.getCanonicalName();
// Default coders for each codec names.
public static final Map<String, String> DEFAULT_CODERS_MAP = ImmutableMap.of(
"rs", IO_ERASURECODE_CODEC_RS_RAWCODERS_DEFAULT,
"rs-legacy", IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODERS_DEFAULT,
"xor", IO_ERASURECODE_CODEC_XOR_RAWCODERS_DEFAULT
);
private CodecUtil() { } private CodecUtil() { }
@ -133,12 +149,7 @@ public final class CodecUtil {
Preconditions.checkNotNull(conf); Preconditions.checkNotNull(conf);
Preconditions.checkNotNull(codec); Preconditions.checkNotNull(codec);
String rawCoderFactoryKey = getRawCoderFactNameFromCodec(conf, codec); return createRawEncoderWithFallback(conf, codec, coderOptions);
RawErasureCoderFactory fact = createRawCoderFactory(conf,
rawCoderFactoryKey);
return fact.createEncoder(coderOptions);
} }
/** /**
@ -153,12 +164,7 @@ public final class CodecUtil {
Preconditions.checkNotNull(conf); Preconditions.checkNotNull(conf);
Preconditions.checkNotNull(codec); Preconditions.checkNotNull(codec);
String rawCoderFactoryKey = getRawCoderFactNameFromCodec(conf, codec); return createRawDecoderWithFallback(conf, codec, coderOptions);
RawErasureCoderFactory fact = createRawCoderFactory(conf,
rawCoderFactoryKey);
return fact.createDecoder(coderOptions);
} }
private static RawErasureCoderFactory createRawCoderFactory( private static RawErasureCoderFactory createRawCoderFactory(
@ -180,31 +186,52 @@ public final class CodecUtil {
return fact; return fact;
} }
private static String getRawCoderFactNameFromCodec(Configuration conf, // Return comma separated coder names
String codec) { private static String getRawCoders(Configuration conf, String codec) {
switch (codec) { return conf.get(
case ErasureCodeConstants.RS_CODEC_NAME: IO_ERASURECODE_CODEC + codec + ".rawcoders",
return conf.get( DEFAULT_CODERS_MAP.getOrDefault(codec, codec)
IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, );
IO_ERASURECODE_CODEC_RS_RAWCODER_DEFAULT); }
case ErasureCodeConstants.RS_LEGACY_CODEC_NAME:
return conf.get( private static RawErasureEncoder createRawEncoderWithFallback(
IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODER_KEY, Configuration conf, String codec, ErasureCoderOptions coderOptions) {
IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODER_DEFAULT); String coders = getRawCoders(conf, codec);
case ErasureCodeConstants.XOR_CODEC_NAME: for (String factName : Splitter.on(",").split(coders)) {
return conf.get( try {
IO_ERASURECODE_CODEC_XOR_RAWCODER_KEY, if (factName != null) {
IO_ERASURECODE_CODEC_XOR_RAWCODER_DEFAULT); RawErasureCoderFactory fact = createRawCoderFactory(conf,
default: factName);
// For custom codec, we throw exception if the factory is not configured return fact.createEncoder(coderOptions);
String rawCoderKey = "io.erasurecode.codec." + codec + ".rawcoder"; }
String factName = conf.get(rawCoderKey); } catch (LinkageError | Exception e) {
if (factName == null) { // Fallback to next coder if possible
throw new IllegalArgumentException("Raw coder factory not configured " + LOG.warn("Failed to create raw erasure encoder " + factName +
"for custom codec " + codec); ", fallback to next codec if possible", e);
} }
return factName;
} }
throw new IllegalArgumentException("Fail to create raw erasure " +
"encoder with given codec: " + codec);
}
private static RawErasureDecoder createRawDecoderWithFallback(
Configuration conf, String codec, ErasureCoderOptions coderOptions) {
String coders = getRawCoders(conf, codec);
for (String factName : Splitter.on(",").split(coders)) {
try {
if (factName != null) {
RawErasureCoderFactory fact = createRawCoderFactory(conf,
factName);
return fact.createDecoder(coderOptions);
}
} catch (LinkageError | Exception e) {
// Fallback to next coder if possible
LOG.warn("Failed to create raw erasure decoder " + factName +
", fallback to next codec if possible", e);
}
}
throw new IllegalArgumentException("Fail to create raw erasure " +
"encoder with given codec: " + codec);
} }
private static ErasureCodec createCodec(Configuration conf, private static ErasureCodec createCodec(Configuration conf,

View File

@ -657,34 +657,33 @@
</property> </property>
<property> <property>
<name>io.erasurecode.codec.rs.rawcoder</name> <name>io.erasurecode.codec.rs.rawcoders</name>
<value>org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory</value> <value>org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawErasureCoderFactory,org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory</value>
<description> <description>
Raw coder implementation for the rs codec. The default value is a Comma separated raw coder implementations for the rs codec. The earlier
pure Java implementation. There is also a native implementation. Its value factory is prior to followings in case of failure of creating raw coders.
is org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawErasureCoderFactory.
</description> </description>
</property> </property>
<property> <property>
<name>io.erasurecode.codec.rs-legacy.rawcoder</name> <name>io.erasurecode.codec.rs-legacy.rawcoders</name>
<value>org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactoryLegacy</value> <value>org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactoryLegacy</value>
<description> <description>
Raw coder implementation for the rs-legacy codec. Comma separated raw coder implementations for the rs-legacy codec. The earlier
factory is prior to followings in case of failure of creating raw coders.
</description> </description>
</property> </property>
<property> <property>
<name>io.erasurecode.codec.xor.rawcoder</name> <name>io.erasurecode.codec.xor.rawcoders</name>
<value>org.apache.hadoop.io.erasurecode.rawcoder.XORRawErasureCoderFactory</value> <value>org.apache.hadoop.io.erasurecode.rawcoder.NativeXORRawErasureCoderFactory,org.apache.hadoop.io.erasurecode.rawcoder.XORRawErasureCoderFactory</value>
<description> <description>
Raw coder implementation for the xor codec. The default value is a pure Java Comma separated raw coder implementations for the xor codec. The earlier
implementation. There is also a native implementation. Its value is factory is prior to followings in case of failure of creating raw coders.
org.apache.hadoop.io.erasurecode.rawcoder.NativeXORRawErasureCoderFactory.
</description> </description>
</property> </property>
<!-- file system properties --> <!-- file system properties -->
<property> <property>
<name>fs.defaultFS</name> <name>fs.defaultFS</name>

View File

@ -18,12 +18,16 @@
package org.apache.hadoop.io.erasurecode; package org.apache.hadoop.io.erasurecode;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawErasureCoderFactory;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoder; import org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoder;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoderLegacy; import org.apache.hadoop.io.erasurecode.rawcoder.RSRawDecoderLegacy;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoder; import org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoder;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoderLegacy; import org.apache.hadoop.io.erasurecode.rawcoder.RSRawEncoderLegacy;
import org.apache.hadoop.io.erasurecode.rawcoder.RSRawErasureCoderFactory;
import org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder; import org.apache.hadoop.io.erasurecode.rawcoder.RawErasureDecoder;
import org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder; import org.apache.hadoop.io.erasurecode.rawcoder.RawErasureEncoder;
import org.apache.hadoop.io.erasurecode.rawcoder.XORRawDecoder;
import org.apache.hadoop.io.erasurecode.rawcoder.XORRawEncoder;
import org.apache.hadoop.test.GenericTestUtils; import org.apache.hadoop.test.GenericTestUtils;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
@ -70,20 +74,73 @@ public class TestCodecRawCoderMapping {
numDataUnit, numParityUnit); numDataUnit, numParityUnit);
String dummyFactName = "DummyNoneExistingFactory"; String dummyFactName = "DummyNoneExistingFactory";
// set the dummy factory to rs-legacy and create a raw coder // set the dummy factory to raw coders then fail to create any rs raw coder.
// with rs, which is OK as the raw coder key is not used
conf.set(CodecUtil. conf.set(CodecUtil.
IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODER_KEY, dummyFactName); IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY, dummyFactName);
RawErasureEncoder encoder = CodecUtil.createRawEncoder(conf, try {
ErasureCodeConstants.RS_CODEC_NAME, coderOptions); CodecUtil.createRawEncoder(conf,
Assert.assertTrue(encoder instanceof RSRawEncoder); ErasureCodeConstants.RS_CODEC_NAME, coderOptions);
Assert.fail();
} catch (Exception e) {
GenericTestUtils.assertExceptionContains(
"Fail to create raw erasure encoder with given codec: rs", e);
}
// now create the raw coder with rs-legacy, which should throw exception // now create the raw coder with rs-legacy, which should throw exception
conf.set(CodecUtil.
IO_ERASURECODE_CODEC_RS_LEGACY_RAWCODERS_KEY, dummyFactName);
try { try {
CodecUtil.createRawEncoder(conf, CodecUtil.createRawEncoder(conf,
ErasureCodeConstants.RS_LEGACY_CODEC_NAME, coderOptions); ErasureCodeConstants.RS_LEGACY_CODEC_NAME, coderOptions);
Assert.fail(); Assert.fail();
} catch (Exception e) { } catch (Exception e) {
GenericTestUtils.assertExceptionContains("Failed to create raw coder", e); GenericTestUtils.assertExceptionContains(
"Fail to create raw erasure encoder with given codec: rs", e);
} }
} }
@Test
public void testFallbackCoders() {
ErasureCoderOptions coderOptions = new ErasureCoderOptions(
numDataUnit, numParityUnit);
conf.set(CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
RSRawErasureCoderFactory.class.getCanonicalName() +
"," + NativeRSRawErasureCoderFactory.class.getCanonicalName());
// should return default raw coder of rs codec
RawErasureEncoder encoder = CodecUtil.createRawEncoder(
conf, ErasureCodeConstants.RS_CODEC_NAME, coderOptions);
Assert.assertTrue(encoder instanceof RSRawEncoder);
RawErasureDecoder decoder = CodecUtil.createRawDecoder(
conf, ErasureCodeConstants.RS_CODEC_NAME, coderOptions);
Assert.assertTrue(decoder instanceof RSRawDecoder);
}
@Test
public void testLegacyCodecFallback() {
ErasureCoderOptions coderOptions = new ErasureCoderOptions(
numDataUnit, numParityUnit);
// should return default raw coder of rs-legacy codec
RawErasureEncoder encoder = CodecUtil.createRawEncoder(
conf, ErasureCodeConstants.RS_LEGACY_CODEC_NAME, coderOptions);
Assert.assertTrue(encoder instanceof RSRawEncoderLegacy);
RawErasureDecoder decoder = CodecUtil.createRawDecoder(
conf, ErasureCodeConstants.RS_LEGACY_CODEC_NAME, coderOptions);
Assert.assertTrue(decoder instanceof RSRawDecoderLegacy);
}
@Test
public void testIgnoreInvalidCodec() {
ErasureCoderOptions coderOptions = new ErasureCoderOptions(
numDataUnit, numParityUnit);
conf.set(CodecUtil.IO_ERASURECODE_CODEC_XOR_RAWCODERS_KEY,
"invalid-codec," +
"org.apache.hadoop.io.erasurecode.rawcoder.XORRawErasureCoderFactory");
// should return second coder specified by IO_ERASURECODE_CODEC_CODERS
RawErasureEncoder encoder = CodecUtil.createRawEncoder(
conf, ErasureCodeConstants.XOR_CODEC_NAME, coderOptions);
Assert.assertTrue(encoder instanceof XORRawEncoder);
RawErasureDecoder decoder = CodecUtil.createRawDecoder(
conf, ErasureCodeConstants.XOR_CODEC_NAME, coderOptions);
Assert.assertTrue(decoder instanceof XORRawDecoder);
}
} }

View File

@ -50,7 +50,7 @@ public class TestHHXORErasureCoder extends TestHHErasureCoderBase {
* This tests if the configuration items work or not. * This tests if the configuration items work or not.
*/ */
Configuration conf = new Configuration(); Configuration conf = new Configuration();
conf.set(CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, conf.set(CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
RSRawErasureCoderFactory.class.getCanonicalName()); RSRawErasureCoderFactory.class.getCanonicalName());
prepare(conf, 10, 4, new int[]{0}, new int[0]); prepare(conf, 10, 4, new int[]{0}, new int[0]);

View File

@ -57,7 +57,7 @@ public class TestRSErasureCoder extends TestErasureCoderBase {
* This tests if the configuration items work or not. * This tests if the configuration items work or not.
*/ */
Configuration conf = new Configuration(); Configuration conf = new Configuration();
conf.set(CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, conf.set(CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
RSRawErasureCoderFactory.class.getCanonicalName()); RSRawErasureCoderFactory.class.getCanonicalName());
prepare(conf, 10, 4, new int[]{0}, new int[0]); prepare(conf, 10, 4, new int[]{0}, new int[0]);

View File

@ -97,7 +97,7 @@ public class TestDFSStripedInputStream {
getEcPolicy().getName()); getEcPolicy().getName());
if (ErasureCodeNative.isNativeCodeLoaded()) { if (ErasureCodeNative.isNativeCodeLoaded()) {
conf.set( conf.set(
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
NativeRSRawErasureCoderFactory.class.getCanonicalName()); NativeRSRawErasureCoderFactory.class.getCanonicalName());
} }
SimulatedFSDataset.setFactory(conf); SimulatedFSDataset.setFactory(conf);

View File

@ -84,7 +84,7 @@ public class TestDFSStripedOutputStream {
conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY, 0); conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY, 0);
if (ErasureCodeNative.isNativeCodeLoaded()) { if (ErasureCodeNative.isNativeCodeLoaded()) {
conf.set( conf.set(
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
NativeRSRawErasureCoderFactory.class.getCanonicalName()); NativeRSRawErasureCoderFactory.class.getCanonicalName());
} }
DFSTestUtil.enableAllECPolicies(conf); DFSTestUtil.enableAllECPolicies(conf);

View File

@ -213,7 +213,7 @@ public class TestDFSStripedOutputStreamWithFailure {
final int numDNs = dataBlocks + parityBlocks; final int numDNs = dataBlocks + parityBlocks;
if (ErasureCodeNative.isNativeCodeLoaded()) { if (ErasureCodeNative.isNativeCodeLoaded()) {
conf.set( conf.set(
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
NativeRSRawErasureCoderFactory.class.getCanonicalName()); NativeRSRawErasureCoderFactory.class.getCanonicalName());
} }
DFSTestUtil.enableAllECPolicies(conf); DFSTestUtil.enableAllECPolicies(conf);

View File

@ -99,7 +99,7 @@ public class TestReconstructStripedFile {
false); false);
if (ErasureCodeNative.isNativeCodeLoaded()) { if (ErasureCodeNative.isNativeCodeLoaded()) {
conf.set( conf.set(
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
NativeRSRawErasureCoderFactory.class.getCanonicalName()); NativeRSRawErasureCoderFactory.class.getCanonicalName());
} }
conf.set(DFSConfigKeys.DFS_NAMENODE_EC_POLICIES_ENABLED_KEY, conf.set(DFSConfigKeys.DFS_NAMENODE_EC_POLICIES_ENABLED_KEY,

View File

@ -67,7 +67,7 @@ public class TestUnsetAndChangeDirectoryEcPolicy {
conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY, 0); conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY, 0);
if (ErasureCodeNative.isNativeCodeLoaded()) { if (ErasureCodeNative.isNativeCodeLoaded()) {
conf.set( conf.set(
CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODER_KEY, CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
NativeRSRawErasureCoderFactory.class.getCanonicalName()); NativeRSRawErasureCoderFactory.class.getCanonicalName());
} }
DFSTestUtil.enableAllECPolicies(conf); DFSTestUtil.enableAllECPolicies(conf);