@Test(timeout = 60000) public void testCreationErasureCodingZoneWithInvalidPolicy() throws IOException { ECSchema rsSchema = new ECSchema("rs", 4, 2); String policyName = "RS-4-2-128k"; int cellSize = 128 * 1024; ErasureCodingPolicy ecPolicy= new ErasureCodingPolicy(policyName,rsSchema,cellSize); String src = "/ecDir4-2"; final Path ecDir = new Path(src); try { fs.mkdir(ecDir, FsPermission.getDirDefault()); fs.getClient().setErasureCodingPolicy(src, ecPolicy); fail("HadoopIllegalArgumentException should be thrown for" + "setting an invalid erasure coding policy"); } catch (Exception e) { assertExceptionContains("Policy [ RS-4-2-128k ] does not match " + "any of the supported policies",e); } }
public static ECSchema convertECSchema(HdfsProtos.ECSchemaProto schema) { List<HdfsProtos.ECSchemaOptionEntryProto> optionsList = schema.getOptionsList(); Map<String, String> options = new HashMap<>(optionsList.size()); for (HdfsProtos.ECSchemaOptionEntryProto option : optionsList) { options.put(option.getKey(), option.getValue()); } return new ECSchema(schema.getCodecName(), schema.getDataUnits(), schema.getParityUnits(), options); }
public static HdfsProtos.ECSchemaProto convertECSchema(ECSchema schema) { HdfsProtos.ECSchemaProto.Builder builder = HdfsProtos.ECSchemaProto.newBuilder() .setCodecName(schema.getCodecName()) .setDataUnits(schema.getNumDataUnits()) .setParityUnits(schema.getNumParityUnits()); Set<Map.Entry<String, String>> entrySet = schema.getExtraOptions().entrySet(); for (Map.Entry<String, String> entry : entrySet) { builder.addOptions(HdfsProtos.ECSchemaOptionEntryProto.newBuilder() .setKey(entry.getKey()).setValue(entry.getValue()).build()); } return builder.build(); }
public HHXORErasureDecoder(ECSchema schema) { super(schema); }
public HHXORErasureEncoder(ECSchema schema) { super(schema); }
public XORErasureDecoder(ECSchema schema) { super(schema); }
public RSErasureEncoder(ECSchema schema) { super(schema); }
public XORErasureEncoder(ECSchema schema) { super(schema); }
public AbstractErasureEncoder(ECSchema schema) { super(schema); }
public AbstractErasureDecoder(ECSchema schema) { super(schema); }
public AbstractErasureCoder(ECSchema schema) { this(schema.getNumDataUnits(), schema.getNumParityUnits()); }
public RSErasureDecoder(ECSchema schema) { super(schema); }
public XORErasureCodec(ECSchema schema) { super(schema); assert(schema.getNumParityUnits() == 1); }
public AbstractErasureCodec(ECSchema schema) { this.schema = schema; }
public ECSchema getSchema() { return schema; }
public RSErasureCodec(ECSchema schema) { super(schema); }
public ErasureCodingPolicy(String name, ECSchema schema, int cellSize){ this.name = name; this.schema = schema; this.cellSize = cellSize; }
public HHXORErasureCodec(ECSchema schema) { super(schema); }