public final Object compress(byte dataType, boolean isIndexed, DataPackNode dpn) {
        assert version == dpn.version();
        if (cmpData != null) {
            return null;
        }
        long time = System.currentTimeMillis();

        Wrapper extraInfo = new Wrapper();
        if (dpn.compress()) {
            cmpData = dpn.mode.versionAdapter.compressPack(version, dpn.mode(), dataType, isIndexed, dpn, data, extraInfo);
        } else {
            cmpData = data;
        }

        PackDurationStat.INSTANCE.add_compressPack(System.currentTimeMillis() - time);

        return extraInfo.value;
    }
Note that this method could update the content of dpn.
Make sure to call this method before you actually save the dpn instance to storage.
indexr-segment/src/main/java/io/indexr/segment/pack/DataPack.java