@Override
  public void reinit(final Configuration conf) {
    if (conf != null) {
      // Level might have changed
      boolean levelChanged = false;
      int newLevel = ZstdCodec.getLevel(conf);
      if (level != newLevel) {
        level = newLevel;
        levelChanged = true;
      }
      // Dictionary may have changed
      byte[] b = ZstdCodec.getDictionary(conf);
      if (b != null) {
        // Don't casually create dictionary objects; they consume native memory
        int thisDictId = ZstdCodec.getDictionaryId(b);
        if (dict == null || dictId != thisDictId || levelChanged) {
          dictId = thisDictId;
          dict = new ZstdDictCompress(b, level);
        }
      } else {
        dict = null;
      }
      // Buffer size might have changed
      int newBufferSize = ZstdCodec.getBufferSize(conf);
      if (bufferSize != newBufferSize) {
        bufferSize = newBufferSize;
        this.inBuf = ByteBuffer.allocateDirect(bufferSize);
        this.outBuf = ByteBuffer.allocateDirect(bufferSize);
      }
    }
    reset();
  }
Hadoop compressor glue for zstd-jni.
hbase-compression/hbase-compression-zstd/src/main/java/org/apache/hadoop/hbase/io/compress/zstd/ZstdCompressor.java