Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(dump): try without snapshot #7

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions internal/infra/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func encode(items []silo.DataNode) ([]byte, error) {
}

type Snapshot struct {
db *pebble.Batch
db *pebble.DB
}

func (s Snapshot) Next() (silo.DataNode, bool, error) {
Expand Down Expand Up @@ -120,10 +120,6 @@ func (s Snapshot) PullAll(node silo.DataNode) ([]silo.DataNode, error) {
}

func (s Snapshot) Close() error {
if err := s.db.Close(); err != nil {
return fmt.Errorf("%w", err)
}

return nil
}

Expand Down Expand Up @@ -175,7 +171,7 @@ func (b Backend) Store(key silo.DataNode, value silo.DataNode) error {
}

func (b Backend) Snapshot() silo.Snapshot { //nolint:ireturn
return Snapshot{b.db.NewIndexedBatch()}
return Snapshot(b)
}

func (b Backend) Close() error {
Expand Down
Loading