[#1806] services/control: Allow to flush write-cache

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-21 13:51:51 +03:00 committed by fyrchik
parent 3d882e9f47
commit 51b8f26a31
11 changed files with 763 additions and 206 deletions

View file

@ -17,6 +17,7 @@ const (
rpcRestoreShard = "RestoreShard"
rpcSynchronizeTree = "SynchronizeTree"
rpcEvacuateShard = "EvacuateShard"
rpcFlushCache = "FlushCache"
)
// HealthCheck executes ControlService.HealthCheck RPC.
@ -177,3 +178,16 @@ func EvacuateShard(cli *client.Client, req *EvacuateShardRequest, opts ...client
return wResp.EvacuateShardResponse, nil
}
// FlushCache executes ControlService.FlushCache RPC.
func FlushCache(cli *client.Client, req *FlushCacheRequest, opts ...client.CallOption) (*FlushCacheResponse, error) {
wResp := &flushCacheResponseWrapper{new(FlushCacheResponse)}
wReq := &requestWrapper{m: req}
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcFlushCache), wReq, wResp, opts...)
if err != nil {
return nil, err
}
return wResp.FlushCacheResponse, nil
}