forked from TrueCloudLab/frostfs-node
[#1634] meta: Add epoch state
It allows performing expiration checks on the stored objects. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
a97dee008c
commit
9aba0ba512
9 changed files with 76 additions and 7 deletions
|
@ -2,6 +2,7 @@ package shard_test
|
|||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"math"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -25,6 +26,12 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type epochState struct{}
|
||||
|
||||
func (s epochState) CurrentEpoch() uint64 {
|
||||
return math.MaxUint64
|
||||
}
|
||||
|
||||
func newShard(t testing.TB, enableWriteCache bool) *shard.Shard {
|
||||
return newCustomShard(t, t.TempDir(), enableWriteCache,
|
||||
[]writecache.Option{writecache.WithMaxMemSize(0)},
|
||||
|
@ -49,6 +56,7 @@ func newCustomShard(t testing.TB, rootPath string, enableWriteCache bool, wcOpts
|
|||
),
|
||||
shard.WithMetaBaseOptions(
|
||||
meta.WithPath(filepath.Join(rootPath, "meta")),
|
||||
meta.WithEpochState(epochState{}),
|
||||
),
|
||||
shard.WithPiloramaOptions(pilorama.WithPath(filepath.Join(rootPath, "pilorama"))),
|
||||
shard.WithWriteCache(enableWriteCache),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue