forked from TrueCloudLab/frostfs-node
Move to frostfs-node
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
42554a9298
commit
923f84722a
934 changed files with 3470 additions and 3451 deletions
49
cmd/frostfs-lens/internal/meta/root.go
Normal file
49
cmd/frostfs-lens/internal/meta/root.go
Normal file
|
@ -0,0 +1,49 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
common "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-lens/internal"
|
||||
meta "github.com/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase"
|
||||
"github.com/spf13/cobra"
|
||||
"go.etcd.io/bbolt"
|
||||
)
|
||||
|
||||
var (
|
||||
vAddress string
|
||||
vPath string
|
||||
)
|
||||
|
||||
type epochState struct{}
|
||||
|
||||
func (s epochState) CurrentEpoch() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Root contains `meta` command definition.
|
||||
var Root = &cobra.Command{
|
||||
Use: "meta",
|
||||
Short: "Operations with a metabase",
|
||||
}
|
||||
|
||||
func init() {
|
||||
Root.AddCommand(
|
||||
inspectCMD,
|
||||
listGraveyardCMD,
|
||||
listGarbageCMD,
|
||||
)
|
||||
}
|
||||
|
||||
func openMeta(cmd *cobra.Command) *meta.DB {
|
||||
db := meta.New(
|
||||
meta.WithPath(vPath),
|
||||
meta.WithBoltDBOptions(&bbolt.Options{
|
||||
ReadOnly: true,
|
||||
Timeout: 100 * time.Millisecond,
|
||||
}),
|
||||
meta.WithEpochState(epochState{}),
|
||||
)
|
||||
common.ExitOnErr(cmd, common.Errf("could not open metabase: %w", db.Open(true)))
|
||||
|
||||
return db
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue