HFileOutputFormat extends FileOutputFormat<BytesWritable, BytesWritable> { public static Compression.Algorithm getAlgorithm(String compressionString) { Compression.Algorithm compressionAlgo = Compression.Algorithm.SNAPPY; if (compressionString == null) { return compressionAlgo; } try { compressionAlgo = Compression.Algorithm.valueOf(compressionString); } catch (Throwable t) { return compressionAlgo; } return compressionAlgo; }  static Compression.Algorithm getAlgorithm(String compressionString); static Path hfilePath(Path outputPath, int partitionIndex); RecordWriter<BytesWritable, BytesWritable> getRecordWriter(
          TaskAttemptContext context);  }
@Test public void testGetCompression() { assertEquals(Compression.Algorithm.SNAPPY, HFileOutputFormat.getAlgorithm(null)); assertEquals(Compression.Algorithm.SNAPPY, HFileOutputFormat.getAlgorithm("")); assertEquals(Compression.Algorithm.SNAPPY, HFileOutputFormat.getAlgorithm("WRONG_ALGO")); assertEquals(Compression.Algorithm.SNAPPY, HFileOutputFormat.getAlgorithm("SNAPPY")); assertEquals(Compression.Algorithm.NONE, HFileOutputFormat.getAlgorithm("NONE")); }