Skip to content

Commit 9db6dee

Browse files
committed
block: rename GetCompressor to MakeCompressor
1 parent 703ca0d commit 9db6dee

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

sstable/blob/blob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func NewFileWriter(fn base.DiskFileNum, w objstorage.Writable, opts FileWriterOp
131131
fw.flushGov = opts.FlushGovernor
132132
fw.indexEncoder.Init()
133133
fw.checksummer = block.Checksummer{Type: opts.ChecksumType}
134-
fw.compressor = block.GetCompressor(opts.Compression)
134+
fw.compressor = block.MakeCompressor(opts.Compression)
135135
fw.cpuMeasurer = opts.CpuMeasurer
136136
fw.writeQueue.ch = make(chan compressedBlock)
137137
fw.writeQueue.wg.Add(1)

sstable/block/compression_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestBufferRandomized(t *testing.T) {
1818
t.Logf("seed %d", seed)
1919
rng := rand.New(rand.NewPCG(0, seed))
2020

21-
compressor := GetCompressor(SnappyCompression)
21+
compressor := MakeCompressor(SnappyCompression)
2222
defer compressor.Close()
2323
var checksummer Checksummer
2424
checksummer.Init(ChecksumTypeCRC32c)

sstable/block/compressor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type Compressor struct {
1313
compressor compression.Compressor
1414
}
1515

16-
// GetCompressor returns a Compressor that applies the given compression. Close
16+
// MakeCompressor returns a Compressor that applies the given compression. Close
1717
// must be called when it is no longer needed.
18-
func GetCompressor(c Compression) Compressor {
18+
func MakeCompressor(c Compression) Compressor {
1919
s := c.setting()
2020
return Compressor{
2121
algorithm: s.Algorithm,

sstable/colblk_writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func newColumnarWriter(
194194
w.cpuMeasurer = cpuMeasurer
195195
go w.drainWriteQueue()
196196

197-
w.compressor = block.GetCompressor(w.opts.Compression)
197+
w.compressor = block.MakeCompressor(w.opts.Compression)
198198
return w
199199
}
200200

sstable/layout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ func (w *layoutWriter) writeBlock(
918918
b []byte, compression block.Compression, buf *blockBuf,
919919
) (block.Handle, error) {
920920
// TODO(radu): store a compressor in the layoutWriter.
921-
compressor := block.GetCompressor(compression)
921+
compressor := block.MakeCompressor(compression)
922922
defer compressor.Close()
923923
pb := block.CompressAndChecksum(&buf.dataBuf, b, compressor, &buf.checksummer)
924924
h, err := w.writePrecompressedBlock(pb)

sstable/rowblk_writer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ func (d *dataBlockBuf) finish() {
490490

491491
func (d *dataBlockBuf) compressAndChecksum(c block.Compression) {
492492
// TODO(radu): pass a Compressor here.
493-
compressor := block.GetCompressor(c)
493+
compressor := block.MakeCompressor(c)
494494
defer compressor.Close()
495495
d.physical = block.CompressAndChecksum(&d.dataBuf, d.uncompressed, compressor, &d.checksummer)
496496
}
@@ -1933,7 +1933,7 @@ func (w *RawRowWriter) copyDataBlocks(
19331933
func (w *RawRowWriter) addDataBlock(b, sep []byte, bhp block.HandleWithProperties) error {
19341934
blockBuf := &w.dataBlockBuf.blockBuf
19351935
// TODO(radu): store a compressor in w.layout.
1936-
compressor := block.GetCompressor(w.layout.compression)
1936+
compressor := block.MakeCompressor(w.layout.compression)
19371937
defer compressor.Close()
19381938
pb := block.CompressAndChecksum(
19391939
&blockBuf.dataBuf,

sstable/suffix_rewriter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func rewriteDataBlocksInParallel(
170170
// We'll assume all blocks are _roughly_ equal so round-robin static partition
171171
// of each worker doing every ith block is probably enough.
172172
err := func() error {
173-
compressor := block.GetCompressor(opts.Compression)
173+
compressor := block.MakeCompressor(opts.Compression)
174174
defer compressor.Close()
175175
for i := worker; i < len(input); i += concurrency {
176176
bh := input[i]

sstable/valblk/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func NewWriter(
5656
blockFinishedFunc: blockFinishedFunc,
5757
blocks: w.blocks[:0],
5858
}
59-
w.compressor = block.GetCompressor(compression)
59+
w.compressor = block.MakeCompressor(compression)
6060
w.checksummer.Init(checksumType)
6161
w.buf = block.NewTempBuffer()
6262
return w

0 commit comments

Comments
 (0)