-
Notifications
You must be signed in to change notification settings - Fork 452
/
merger.go
37 lines (28 loc) · 1.03 KB
/
merger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2018 The LevelDB-Go and Pebble Authors. All rights reserved. Use
// of this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
package pebble
import (
"io"
"github.com/cockroachdb/pebble/internal/base"
)
// Merge exports the base.Merge type.
type Merge = base.Merge
// Merger exports the base.Merger type.
type Merger = base.Merger
// ValueMerger exports the base.ValueMerger type.
type ValueMerger = base.ValueMerger
// DeletableValueMerger exports the base.DeletableValueMerger type.
type DeletableValueMerger = base.DeletableValueMerger
// DefaultMerger exports the base.DefaultMerger variable.
var DefaultMerger = base.DefaultMerger
func finishValueMerger(
valueMerger ValueMerger, includesBase bool,
) (value []byte, needDelete bool, closer io.Closer, err error) {
if valueMerger2, ok := valueMerger.(DeletableValueMerger); ok {
value, needDelete, closer, err = valueMerger2.DeletableFinish(includesBase)
} else {
value, closer, err = valueMerger.Finish(includesBase)
}
return
}