SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
optionally open the leveldb in readonly mode
chrislucb67137a0317
diff --git a/weed/filer/leveldb2/leveldb2_store.go b/weed/filer/leveldb2/leveldb2_store.goindex 78d15382f7..b465046f9a 100644--- a/weed/filer/leveldb2/leveldb2_store.go+++ b/weed/filer/leveldb2/leveldb2_store.go@@ -25,8 +25,9 @@ func init() {}type LevelDB2Store struct {- dbs []*leveldb.DB- dbCount int+ dbs []*leveldb.DB+ dbCount int+ ReadOnly bool}func (store *LevelDB2Store) GetName() string {@@ -49,6 +50,7 @@ func (store *LevelDB2Store) initialize(dir string, dbCount int) (err error) {BlockCacheCapacity: 32 * 1024 * 1024, // default value is 8MiBWriteBuffer: 16 * 1024 * 1024, // default value is 4MiBFilter: filter.NewBloomFilter(8), // false positive rate 0.02+ ReadOnly: store.ReadOnly,}for d := 0; d < dbCount; d++ {diff --git a/weed/filer/leveldb3/leveldb3_store.go b/weed/filer/leveldb3/leveldb3_store.goindex 406dc80be2..2522221dae 100644--- a/weed/filer/leveldb3/leveldb3_store.go+++ b/weed/filer/leveldb3/leveldb3_store.go@@ -31,9 +31,10 @@ func init() {}type LevelDB3Store struct {- dir string- dbs map[string]*leveldb.DB- dbsLock sync.RWMutex+ dir string+ dbs map[string]*leveldb.DB+ dbsLock sync.RWMutex+ ReadOnly bool}func (store *LevelDB3Store) GetName() string {@@ -69,12 +70,14 @@ func (store *LevelDB3Store) loadDB(name string) (*leveldb.DB, error) {BlockCacheCapacity: 32 * 1024 * 1024, // default value is 8MiBWriteBuffer: 16 * 1024 * 1024, // default value is 4MiBFilter: bloom,+ ReadOnly: store.ReadOnly,}if name != DEFAULT {opts = &opt.Options{BlockCacheCapacity: 16 * 1024 * 1024, // default value is 8MiBWriteBuffer: 8 * 1024 * 1024, // default value is 4MiBFilter: bloom,+ ReadOnly: store.ReadOnly,}}