Skip to content

Commit 7ce22d1

Browse files
committed
rename Minlz to MinLZ
1 parent ed3560d commit 7ce22d1

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,7 @@ func (d *DB) Metrics() *Metrics {
21002100
metrics.Table.CompressedCountUnknown += int64(compressionTypes.unknown)
21012101
metrics.Table.CompressedCountSnappy += int64(compressionTypes.snappy)
21022102
metrics.Table.CompressedCountZstd += int64(compressionTypes.zstd)
2103-
metrics.Table.CompressedCountMinlz += int64(compressionTypes.minlz)
2103+
metrics.Table.CompressedCountMinLZ += int64(compressionTypes.minlz)
21042104
metrics.Table.CompressedCountNone += int64(compressionTypes.none)
21052105
}
21062106

metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ type Metrics struct {
304304
// The number of sstables that are compressed with zstd.
305305
CompressedCountZstd int64
306306
// The number of sstables that are compressed with minlz.
307-
CompressedCountMinlz int64
307+
CompressedCountMinLZ int64
308308
// The number of sstables that are uncompressed.
309309
CompressedCountNone int64
310310

@@ -740,7 +740,7 @@ func (m *Metrics) SafeFormat(w redact.SafePrinter, _ rune) {
740740
if count := m.Table.CompressedCountZstd; count > 0 {
741741
w.Printf(" zstd: %d", redact.Safe(count))
742742
}
743-
if count := m.Table.CompressedCountMinlz; count > 0 {
743+
if count := m.Table.CompressedCountMinLZ; count > 0 {
744744
w.Printf(" minlz: %d", redact.Safe(count))
745745
}
746746
if count := m.Table.CompressedCountNone; count > 0 {

options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const (
4949
NoCompression = block.NoCompression
5050
SnappyCompression = block.SnappyCompression
5151
ZstdCompression = block.ZstdCompression
52-
MinlzCompression = block.MinlzCompression
52+
MinLZCompression = block.MinLZCompression
5353
)
5454

5555
// FilterType exports the base.FilterType type.
@@ -2038,8 +2038,8 @@ func (o *Options) Parse(s string, hooks *ParseHooks) error {
20382038
l.Compression = func() Compression { return SnappyCompression }
20392039
case "ZSTD":
20402040
l.Compression = func() Compression { return ZstdCompression }
2041-
case "Minlz":
2042-
l.Compression = func() Compression { return MinlzCompression }
2041+
case "MinLZ":
2042+
l.Compression = func() Compression { return MinLZCompression }
20432043
default:
20442044
return errors.Errorf("pebble: unknown compression: %q", errors.Safe(value))
20452045
}

sstable/block/compression.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const (
2525
NoCompression
2626
SnappyCompression
2727
ZstdCompression
28-
MinlzCompression
28+
MinLZCompression
2929
NCompression
3030
)
3131

@@ -41,8 +41,8 @@ func (c Compression) String() string {
4141
return "Snappy"
4242
case ZstdCompression:
4343
return "ZSTD"
44-
case MinlzCompression:
45-
return "Minlz"
44+
case MinLZCompression:
45+
return "MinLZ"
4646
default:
4747
return "Unknown"
4848
}
@@ -60,8 +60,8 @@ func CompressionFromString(s string) Compression {
6060
return SnappyCompression
6161
case "ZSTD":
6262
return ZstdCompression
63-
case "Minlz":
64-
return MinlzCompression
63+
case "MinLZ":
64+
return MinLZCompression
6565
default:
6666
return DefaultCompression
6767
}
@@ -89,7 +89,7 @@ const (
8989
Lz4hcCompressionIndicator CompressionIndicator = 5
9090
XpressCompressionIndicator CompressionIndicator = 6
9191
ZstdCompressionIndicator CompressionIndicator = 7
92-
MinlzCompressionIndicator CompressionIndicator = 8
92+
MinLZCompressionIndicator CompressionIndicator = 8
9393
)
9494

9595
// String implements fmt.Stringer.

sstable/block/compression_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ func TestBufferRandomized(t *testing.T) {
140140
}
141141
}
142142

143-
func TestMinlzEncodingLimit(t *testing.T) {
144-
// Tests that Minlz compression has a strict limit of minlz.MaxBlockSize: 8<<20 (8MiB)
143+
func TestMinLZEncodingLimit(t *testing.T) {
144+
// Tests that MinLZ compression has a strict limit of minlz.MaxBlockSize: 8<<20 (8MiB)
145145
_, err := minlz.Encode([]byte{}, bytes.Repeat([]byte{0}, minlz.MaxBlockSize-1), minlz.LevelFastest)
146146
require.NoError(t, err)
147147
_, err = minlz.Encode([]byte{}, bytes.Repeat([]byte{0}, minlz.MaxBlockSize), minlz.LevelFastest)
@@ -151,12 +151,12 @@ func TestMinlzEncodingLimit(t *testing.T) {
151151
require.Fail(t, "Expected minlz.ErrTooLarge Error")
152152
}
153153

154-
c := GetCompressor(MinlzCompression)
154+
c := GetCompressor(MinLZCompression)
155155
defer c.Close()
156156
algo, _ := c.Compress([]byte{}, bytes.Repeat([]byte{0}, minlz.MaxBlockSize-1))
157-
require.Equal(t, algo, MinlzCompressionIndicator)
157+
require.Equal(t, algo, MinLZCompressionIndicator)
158158
algo, _ = c.Compress([]byte{}, bytes.Repeat([]byte{0}, minlz.MaxBlockSize))
159-
require.Equal(t, algo, MinlzCompressionIndicator)
159+
require.Equal(t, algo, MinLZCompressionIndicator)
160160
algo, _ = c.Compress([]byte{}, bytes.Repeat([]byte{0}, minlz.MaxBlockSize+1))
161161
require.Equal(t, algo, SnappyCompressionIndicator)
162162
}

sstable/block/compressor.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (snappyCompressor) Compress(dst, src []byte) (CompressionIndicator, []byte)
3939
func (snappyCompressor) Close() {}
4040

4141
func (minlzCompressor) Compress(dst, src []byte) (CompressionIndicator, []byte) {
42-
// Minlz cannot encode blocks greater than 8MB. Fall back to Snappy in those cases.
42+
// MinLZ cannot encode blocks greater than 8MB. Fall back to Snappy in those cases.
4343
if len(src) > minlz.MaxBlockSize {
4444
return (snappyCompressor{}).Compress(dst, src)
4545
}
@@ -48,7 +48,7 @@ func (minlzCompressor) Compress(dst, src []byte) (CompressionIndicator, []byte)
4848
if err != nil {
4949
panic(errors.Wrap(err, "minlz compression"))
5050
}
51-
return MinlzCompressionIndicator, compressed
51+
return MinLZCompressionIndicator, compressed
5252
}
5353

5454
func (minlzCompressor) Close() {}
@@ -61,7 +61,7 @@ func GetCompressor(c Compression) Compressor {
6161
return snappyCompressor{}
6262
case ZstdCompression:
6363
return getZstdCompressor()
64-
case MinlzCompression:
64+
case MinLZCompression:
6565
return minlzCompressor{}
6666
default:
6767
panic("Invalid compression type.")
@@ -156,7 +156,7 @@ func GetDecompressor(c CompressionIndicator) Decompressor {
156156
return snappyDecompressor{}
157157
case ZstdCompressionIndicator:
158158
return getZstdDecompressor()
159-
case MinlzCompressionIndicator:
159+
case MinLZCompressionIndicator:
160160
return minlzDecompressor{}
161161
default:
162162
panic("Invalid compression type.")

sstable/writer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ func runWriterBench(b *testing.B, keys [][]byte, comparer *base.Comparer, format
12421242
b.Run(fmt.Sprintf("block=%s", humanize.Bytes.Int64(int64(bs))), func(b *testing.B) {
12431243
for _, filter := range []bool{true, false} {
12441244
b.Run(fmt.Sprintf("filter=%t", filter), func(b *testing.B) {
1245-
for _, comp := range []block.Compression{block.NoCompression, block.SnappyCompression, block.ZstdCompression, block.MinlzCompression} {
1245+
for _, comp := range []block.Compression{block.NoCompression, block.SnappyCompression, block.ZstdCompression, block.MinLZCompression} {
12461246
b.Run(fmt.Sprintf("compression=%s", comp), func(b *testing.B) {
12471247
opts := WriterOptions{
12481248
BlockRestartInterval: 16,

table_stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ func (a compressionTypeAggregator) Accumulate(
11271127
dst.snappy++
11281128
case ZstdCompression:
11291129
dst.zstd++
1130-
case MinlzCompression:
1130+
case MinLZCompression:
11311131
dst.minlz++
11321132
case NoCompression:
11331133
dst.none++

0 commit comments

Comments
 (0)