-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colblk: implement synthetic prefix and suffix
`DataBlockIter` now takes into account the synthetic prefix and suffix transforms.
- Loading branch information
1 parent
9568f43
commit 5ef2311
Showing
12 changed files
with
551 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2024 The LevelDB-Go and Pebble Authors. All rights reserved. Use | ||
// of this source code is governed by a BSD-style license that can be found in | ||
// the LICENSE file. | ||
|
||
package block | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestIterTransforms(t *testing.T) { | ||
require.True(t, NoTransforms.NoTransforms()) | ||
var transforms IterTransforms | ||
require.True(t, transforms.NoTransforms()) | ||
require.False(t, transforms.SyntheticPrefix.IsSet()) | ||
require.False(t, transforms.SyntheticSuffix.IsSet()) | ||
transforms.SyntheticPrefix = []byte{} | ||
require.False(t, transforms.SyntheticPrefix.IsSet()) | ||
transforms.SyntheticSuffix = []byte{} | ||
require.False(t, transforms.SyntheticSuffix.IsSet()) | ||
require.True(t, transforms.NoTransforms()) | ||
transforms.HideObsoletePoints = true | ||
require.False(t, transforms.NoTransforms()) | ||
|
||
transforms = NoTransforms | ||
transforms.SyntheticSeqNum = 123 | ||
require.False(t, transforms.NoTransforms()) | ||
|
||
transforms = NoTransforms | ||
transforms.SyntheticPrefix = []byte{1} | ||
require.False(t, transforms.NoTransforms()) | ||
|
||
transforms = NoTransforms | ||
transforms.SyntheticSuffix = []byte{1} | ||
require.False(t, transforms.NoTransforms()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.