mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-19 19:21:44 -05:00
Merge pull request #1228 from dolthub/aaron/nbs-noop-conjoiner
go/store/nbs: WithoutConjoiner() to configure NBS to not conjoin.
This commit is contained in:
@@ -59,6 +59,17 @@ func (c inlineConjoiner) Conjoin(ctx context.Context, upstream manifestContents,
|
||||
return conjoin(ctx, upstream, mm, p, stats)
|
||||
}
|
||||
|
||||
type noopConjoiner struct {
|
||||
}
|
||||
|
||||
func (c noopConjoiner) ConjoinRequired(ts tableSet) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (c noopConjoiner) Conjoin(ctx context.Context, upstream manifestContents, mm manifestUpdater, p tablePersister, stats *Stats) (manifestContents, error) {
|
||||
return manifestContents{}, errors.New("unsupported conjoin operation on noopConjoiner")
|
||||
}
|
||||
|
||||
func conjoin(ctx context.Context, upstream manifestContents, mm manifestUpdater, p tablePersister, stats *Stats) (manifestContents, error) {
|
||||
var conjoined tableSpec
|
||||
var conjoinees, keepers []tableSpec
|
||||
|
||||
@@ -393,6 +393,25 @@ func newNomsBlockStore(ctx context.Context, nbfVerStr string, mm manifestManager
|
||||
return nbs, nil
|
||||
}
|
||||
|
||||
// WithoutConjoiner returns a new *NomsBlockStore instance that will not
|
||||
// conjoin table files during manifest updates. Used in some server-side
|
||||
// contexts when things like table file maintenance is done out-of-process. Not
|
||||
// safe for use outside of NomsBlockStore construction.
|
||||
func (nbs *NomsBlockStore) WithoutConjoiner() *NomsBlockStore {
|
||||
return &NomsBlockStore{
|
||||
mm: nbs.mm,
|
||||
p: nbs.p,
|
||||
c: noopConjoiner{},
|
||||
mu: sync.RWMutex{},
|
||||
mt: nbs.mt,
|
||||
tables: nbs.tables,
|
||||
upstream: nbs.upstream,
|
||||
mtSize: nbs.mtSize,
|
||||
putCount: nbs.putCount,
|
||||
stats: nbs.stats,
|
||||
}
|
||||
}
|
||||
|
||||
func (nbs *NomsBlockStore) Put(ctx context.Context, c chunks.Chunk) error {
|
||||
t1 := time.Now()
|
||||
a := addr(c.Hash())
|
||||
|
||||
Reference in New Issue
Block a user