public static void testCompression(Compression.Algorithm algo) throws IOException {
    if (compressionTestResults[algo.ordinal()] != null) {
      if (compressionTestResults[algo.ordinal()]) {
        return; // already passed test, dont do it again.
      } else {
        // failed.
        throw new DoNotRetryIOException(
          "Compression algorithm '" + algo.getName() + "'" + " previously failed test.");
      }
    }

    try {
      Compressor c = algo.getCompressor();
      algo.returnCompressor(c);
      compressionTestResults[algo.ordinal()] = true; // passes
    } catch (Throwable t) {
      compressionTestResults[algo.ordinal()] = false; // failure
      throw new DoNotRetryIOException(t);
    }
  }
Compression validation test. Checks compression is working. Be sure to run on every node in your
cluster.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java