[#1298] writecache: Add restore-mode
flag for Seal command
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
8e51d7849a
commit
5c01bd5be8
11 changed files with 238 additions and 205 deletions
|
@ -9,6 +9,8 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const restoreModeFlag = "restore-mode"
|
||||
|
||||
var writecacheShardCmd = &cobra.Command{
|
||||
Use: "writecache",
|
||||
Short: "Operations with storage node's write-cache",
|
||||
|
@ -26,10 +28,12 @@ func sealWritecache(cmd *cobra.Command, _ []string) {
|
|||
pk := key.Get(cmd)
|
||||
|
||||
ignoreErrors, _ := cmd.Flags().GetBool(ignoreErrorsFlag)
|
||||
restoreMode, _ := cmd.Flags().GetBool(restoreModeFlag)
|
||||
|
||||
req := &control.SealWriteCacheRequest{Body: &control.SealWriteCacheRequest_Body{
|
||||
Shard_ID: getShardIDList(cmd),
|
||||
IgnoreErrors: ignoreErrors,
|
||||
RestoreMode: restoreMode,
|
||||
}}
|
||||
|
||||
signRequest(cmd, pk, req)
|
||||
|
@ -68,6 +72,7 @@ func initControlShardsWritecacheCmd() {
|
|||
ff.StringSlice(shardIDFlag, nil, "List of shard IDs in base58 encoding")
|
||||
ff.Bool(shardAllFlag, false, "Process all shards")
|
||||
ff.Bool(ignoreErrorsFlag, true, "Skip invalid/unreadable objects")
|
||||
ff.Bool(restoreModeFlag, false, "Restore writecache's mode after sealing")
|
||||
|
||||
sealWritecacheShardCmd.MarkFlagsMutuallyExclusive(shardIDFlag, shardAllFlag)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue