leveldb-api:ReadOptions

public class ReadOptions
{
    private boolean verifyChecksums;
    private boolean fillCache = true;
    private Snapshot snapshot;

    public Snapshot snapshot()
    {
        return snapshot;
    }

    public ReadOptions snapshot(Snapshot snapshot)
this.snapshot = snapshot;
        return this;
    }

    public boolean fillCache()
    {
        return fillCache;
    }

    public ReadOptions fillCache(boolean fillCache)
    {
        this.fillCache = fillCache;
        return this;
    }

    public boolean verifyChecksums()
    {
        return verifyChecksums;
    }

    public ReadOptions verifyChecksums(boolean verifyChecksums)
    {
        this.verifyChecksums = verifyChecksums;
        return this;
    }
}

控制读方式

fill_cache=true从迭代器读取的数据是否缓存在内存中

snapshot有快照读取快照

verifychecksum:读取数据校验

posted @ 2022-07-19 11:04  只能说运气有点好  阅读(29)  评论(0)    收藏  举报