Search in sources :

Example 1 with HdfsErasureCodingShim

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());
}
Also used : HdfsErasureCodingShim(org.apache.hadoop.hive.shims.HadoopShims.HdfsErasureCodingShim) Path(org.apache.hadoop.fs.Path) HadoopShims(org.apache.hadoop.hive.shims.HadoopShims)

Aggregations

Path (org.apache.hadoop.fs.Path)1 HadoopShims (org.apache.hadoop.hive.shims.HadoopShims)1 HdfsErasureCodingShim (org.apache.hadoop.hive.shims.HadoopShims.HdfsErasureCodingShim)1