MCPcopy
hub / github.com/cubefs/cubefs / newCmdFlashNodeHTTPEvict

Function newCmdFlashNodeHTTPEvict

cli/cmd/flashnode.go:255–280  ·  view source on GitHub ↗
(client *master.MasterClient)

Source from the content-addressed store, hash-verified

253}
254
255func newCmdFlashNodeHTTPEvict(client *master.MasterClient) *cobra.Command {
256 return &cobra.Command{
257 Use: "httpEvict" + _flashnodeAddr + " [volume]",
258 Short: "evict cache in flashnode",
259 Args: cobra.MinimumNArgs(1),
260 RunE: func(_ *cobra.Command, args []string) (err error) {
261 addr := args[0]
262 // check flashnode whether exist
263 _, err = client.NodeAPI().GetFlashNode(addr)
264 if err != nil {
265 return
266 }
267 if len(args) == 1 {
268 if err = httpclient.New().Addr(addr2Prof(addr)).FlashNode().EvictAll(); err == nil {
269 stdoutlnf("%s evicts all [OK]", addr)
270 }
271 return
272 }
273 volume := args[1]
274 if err = httpclient.New().Addr(addr2Prof(addr)).FlashNode().EvictVol(volume); err == nil {
275 stdoutlnf("%s evicts volume(%s) [OK]", addr, volume)
276 }
277 return
278 },
279 }
280}
281
282func newCmdFlashNodeHTTPInactiveDisk(client *master.MasterClient) *cobra.Command {
283 return &cobra.Command{

Callers 1

newFlashNodeCmdFunction · 0.70

Calls 9

NewFunction · 0.92
NodeAPIMethod · 0.80
FlashNodeMethod · 0.80
addr2ProfFunction · 0.70
stdoutlnfFunction · 0.70
EvictAllMethod · 0.65
EvictVolMethod · 0.65
GetFlashNodeMethod · 0.45
AddrMethod · 0.45

Tested by

no test coverage detected