storage: expose separate WriteBatch interface#98712
storage: expose separate WriteBatch interface#98712craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
d820c87 to
ad639da
Compare
sumeerbhola
left a comment
There was a problem hiding this comment.
Reviewed 15 of 15 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @itsbilal and @jbowens)
pkg/storage/engine.go line 977 at r1 (raw file):
// iterator has to be repositioned using a seek operation, after the // mutations were done. ReadWriter
can this be changed to Reader?
pkg/storage/batch_test.go line 694 at r1 (raw file):
defer e.Close() batch := e.NewUnindexedBatch(true /* writeOnly */)
Since someone can successfully turn a WriteBatch into a Reader since both are backed by the pebbleBatch implementation, should we keep this.
Adapt NewUnindexedBatch to no longer take a writeOnly parameter. Instead, a new NewWriteBatch method is exposed that returns a WriteBatch type that does not provide Reader facilities. Future work may remove UnindexedBatch altogether, updating callers to explicitly maintain separate Readers and WriteBatches. Epic: None Release note: None
jbowens
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @itsbilal and @sumeerbhola)
pkg/storage/engine.go line 977 at r1 (raw file):
Previously, sumeerbhola wrote…
can this be changed to Reader?
Done.
pkg/storage/batch_test.go line 694 at r1 (raw file):
Previously, sumeerbhola wrote…
Since someone can successfully turn a
WriteBatchinto aReadersince both are backed by thepebbleBatchimplementation, should we keep this.
Done.
|
TFTR! bors r=sumeerbhola |
|
Build succeeded: |
Adapt NewUnindexedBatch to no longer take a writeOnly parameter. Instead, a new NewWriteBatch method is exposed that returns a WriteBatch type that does not provide Reader facilities. Future work may remove UnindexedBatch altogether, updating callers to explicitly maintain separate Readers and WriteBatches.
Epic: None
Release note: None