sofastack / sofa-jraft

A production-grade java implementation of RAFT consensus algorithm.
https://www.sofastack.tech/projects/sofa-jraft/
Apache License 2.0
3.56k stars 1.14k forks source link

jraft-core里面用了一些rocksdb的Deprecated方法 #982

Open justforxm opened 1 year ago

justforxm commented 1 year ago

将rocksdb升级到最新版本8.1.1.1之后,一些过时的方法已经删掉了,可以去掉吗 com.alipay.sofa.jraft.util.StorageOptionsFactory中的这个方法

**private static BlockBasedTableConfig copyTableFormatConfig(final BlockBasedTableConfig cfg) {
    return new BlockBasedTableConfig() //
        .setNoBlockCache(cfg.noBlockCache()) //
        .setBlockCacheSize(cfg.blockCacheSize()) //
        .setCacheNumShardBits(cfg.cacheNumShardBits()) //
        .setBlockSize(cfg.blockSize()) //
        .setBlockSizeDeviation(cfg.blockSizeDeviation()) //
        .setBlockRestartInterval(cfg.blockRestartInterval()) //
        .setWholeKeyFiltering(cfg.wholeKeyFiltering()) //
        .setCacheIndexAndFilterBlocks(cfg.cacheIndexAndFilterBlocks()) //
        .setCacheIndexAndFilterBlocksWithHighPriority(cfg.cacheIndexAndFilterBlocksWithHighPriority()) //
        .setPinL0FilterAndIndexBlocksInCache(cfg.pinL0FilterAndIndexBlocksInCache()) //
        .setPartitionFilters(cfg.partitionFilters()) //
        .setMetadataBlockSize(cfg.metadataBlockSize()) //
        .setPinTopLevelIndexAndFilter(cfg.pinTopLevelIndexAndFilter()) //
        .setHashIndexAllowCollision(cfg.hashIndexAllowCollision()) //
        .setBlockCacheCompressedSize(cfg.blockCacheCompressedSize()) //
        .setBlockCacheCompressedNumShardBits(cfg.blockCacheCompressedNumShardBits()) //
        .setChecksumType(cfg.checksumType()) //
        .setIndexType(cfg.indexType()) //
        .setFormatVersion(cfg.formatVersion());
}**
fengjiachun commented 1 year ago

被 Deprecated 的应该都有替代方法,欢迎提一个 pr

justforxm commented 1 year ago

好的,我把rocksdb升级到8.1.1.1了,8.1.1.1中去掉了blockCacheCompressed,改成了使用二级缓存,但是二级缓存的方法在javaapi中没有放出来,我直接去掉了setBlockCacheCompressed相关的调用,hashIndexAllowCollision这个参数默认是true,无论设不设置都不变,我也去掉了