use of org.apache.hadoop.hive.shims.HadoopShims.HdfsErasureCodingShim in project hive by apache.
the class TestJdbcWithMiniHS2ErasureCoding method addErasurePolicy.
/**
* Add a Erasure Coding Policy to a Path.
*/
private static void addErasurePolicy(MiniDFSShim dfs, String pathString, String policyName) throws IOException {
HadoopShims hadoopShims = ShimLoader.getHadoopShims();
HdfsErasureCodingShim erasureCodingShim = hadoopShims.createHdfsErasureCodingShim(dfs.getFileSystem(), conf);
erasureCodingShim.enableErasureCodingPolicy(policyName);
Path fsRoot = new Path(pathString);
erasureCodingShim.setErasureCodingPolicy(fsRoot, policyName);
HadoopShims.HdfsFileErasureCodingPolicy erasureCodingPolicy = erasureCodingShim.getErasureCodingPolicy(fsRoot);
assertEquals(policyName, erasureCodingPolicy.getName());
}
Aggregations