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