aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_read_test.go
diff options
context:
space:
mode:
authorGuo Lei <snipergg@163.com>2022-11-14 16:19:27 +0800
committerGitHub <noreply@github.com>2022-11-14 00:19:27 -0800
commit5b905fb2b74049437fcd939c0304a7e34d051234 (patch)
tree2c654eb74ee30f5c9e20a6c26de4ede1d04543d9 /weed/storage/volume_read_test.go
parentd90aa31d5f5b846c13bbeabfbd7d89260c21020c (diff)
downloadseaweedfs-5b905fb2b74049437fcd939c0304a7e34d051234.tar.xz
seaweedfs-5b905fb2b74049437fcd939c0304a7e34d051234.zip
Lazy loading (#3958)
* types packages is imported more than onece * lazy-loading * fix bugs * fix bugs * fix unit tests * fix test error * rename function * unload ldb after initial startup * Don't load ldb when starting volume server if ldbtimeout is set. * remove uncessary unloadldb * Update weed/command/server.go Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> * Update weed/command/volume.go Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: guol-fnst <goul-fnst@fujitsu.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Diffstat (limited to 'weed/storage/volume_read_test.go')
-rw-r--r--weed/storage/volume_read_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/weed/storage/volume_read_test.go b/weed/storage/volume_read_test.go
index f1d0aa2fc..02c514083 100644
--- a/weed/storage/volume_read_test.go
+++ b/weed/storage/volume_read_test.go
@@ -1,17 +1,18 @@
package storage
import (
+ "testing"
+
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestReadNeedMetaWithWritesAndUpdates(t *testing.T) {
dir := t.TempDir()
- v, err := NewVolume(dir, dir, "", 1, NeedleMapInMemory, &super_block.ReplicaPlacement{}, &needle.TTL{}, 0, 0)
+ v, err := NewVolume(dir, dir, "", 1, NeedleMapInMemory, &super_block.ReplicaPlacement{}, &needle.TTL{}, 0, 0, 0)
if err != nil {
t.Fatalf("volume creation: %v", err)
}
@@ -48,7 +49,7 @@ func TestReadNeedMetaWithWritesAndUpdates(t *testing.T) {
func TestReadNeedMetaWithDeletesThenWrites(t *testing.T) {
dir := t.TempDir()
- v, err := NewVolume(dir, dir, "", 1, NeedleMapInMemory, &super_block.ReplicaPlacement{}, &needle.TTL{}, 0, 0)
+ v, err := NewVolume(dir, dir, "", 1, NeedleMapInMemory, &super_block.ReplicaPlacement{}, &needle.TTL{}, 0, 0, 0)
if err != nil {
t.Fatalf("volume creation: %v", err)
}