07 2022 档案
摘要:leveldb/VersionEdit.java at master · dain/leveldb · GitHub public VersionEdit() { } public VersionEdit(Slice slice) { SliceInput sliceInput = slice.in
阅读全文
摘要:VersionSet:leveldb/VersionSet.java at master · dain/leveldb · GitHub public class VersionSet implements SeekingIterable<InternalKey, Slice> { private
阅读全文
摘要:Manifest与Current文件是LevelDB保存在稳定存储中的文件版本信息,在LevelDB被打开后,其会先通过Current文件找到当前的Manifest文件,读取并反序列化其中数据,并在内存中维护文件版本信息,以便后续操作。 先来说说Version,Version表示了当前leveldb
阅读全文
摘要:SequenceNumber.java:leveldb/SequenceNumber.java at master · dain/leveldb · GitHub public final class SequenceNumber { // We leave eight bits empty at
阅读全文
摘要:SnapshotSeekingIterator.java public final class SnapshotSeekingIterator extends AbstractSeekingIterator<Slice, Slice> { private final DbIterator itera
阅读全文
摘要:实现leveldb-api的snapshot接口: public class SnapshotImpl implements Snapshot 在leveldb快照中每次都是用一个序列号保存当前插入的这一条记录,因此当插入多条相同的记录时,通过序列号来确定那一条是最新的记录,在leveldb的快照中
阅读全文
摘要:实现leveldb-api中的WriteBatch接口:WriteBatch的实现类为WriteBatchImpl public class WriteBatchImpl implements WriteBatch 可以看到WriteBatch中有一个变量为batch用来保存每一次的操作,还有一个变
阅读全文
摘要:LevelDB使用WriteBatch来替代简单的异步写操作,首先将所有的写操作记录到一个batch中,然后执行同步写,这样同步写的开销就被分摊到多个写操作中,降低同步写入的成本。 public interface WriteBatch extends Closeable { WriteBatch
阅读全文
摘要:leveldb/WriteOptions.java at master · dain/leveldb · GitHub 定义写操作方式 public class WriteOptions { private boolean sync; private boolean snapshot; public
阅读全文
摘要:leveldb/Range.java at master · dain/leveldb · GitHub range.java定义key范围start limit public class Range { private final byte[] start; private final byte[
阅读全文
摘要:public class ReadOptions { private boolean verifyChecksums; private boolean fillCache = true; private Snapshot snapshot; public Snapshot snapshot() {
阅读全文
摘要:leveldb/Options.java at master · dain/leveldb · GitHub 判断Argment是否为null: static void checkArgNotNull(Object value, String name) { if (value == null) {
阅读全文
摘要:DB迭代器:继承closeable接口 public interface DBIterator extends Iterator<Map.Entry<byte[], byte[]>>, Closeable { /** * Repositions the iterator so the key of
阅读全文
摘要:定义DB工厂类:open,destroy,repair public interface DBFactory { DB open(File path, Options options) throws IOException; void destroy(File path, Options optio
阅读全文
摘要:leveldb/DBComparator.java at master · dain/leveldb · GitHub 定义比较器:继承comparator接口 public interface DBComparator extends Comparator<byte[]> { String nam
阅读全文
摘要:github地址:leveldb/CompressionType.java at master · dain/leveldb · GitHub CompressionType.java enum定义compressiontype:SNAPPY or not: public enum Compress
阅读全文
摘要:github地址:leveldb/leveldb-api/src/main/java/org/iq80/leveldb at master · dain/leveldb · GitHub DB.java DB类接口实现:继承了Closeable接口 public interface DB exten
阅读全文
摘要:Cassandra的配置文件:cassandra-3.11.4-main/conf/cassandra.yaml 目录相关的文件: data_file_directories:存储表数据(在SSTables里)。Cassandra将数据均匀的分布在这个位置,受配置的压缩策略粒度的限制。commitl
阅读全文
浙公网安备 33010602011771号