// runExterminate destroys the data held in the specified stores. func runExterminate(cmd *cobra.Command, args []string) { err := Context.Init("exterminate") if err != nil { log.Errorf("failed to initialize context: %s", err) return } // First attempt to shutdown the server. Note that an error of EOF just // means the HTTP server shutdown before the request to quit returned. if err := server.SendQuit(Context); err != nil { log.Infof("shutdown node %s: %s", Context.Addr, err) } else { log.Infof("shutdown node in anticipation of data extermination") } // Exterminate all data held in specified stores. for _, e := range Context.Engines { if rocksdb, ok := e.(*engine.RocksDB); ok { log.Infof("exterminating data from store %s", e) if err := rocksdb.Destroy(); err != nil { log.Fatalf("unable to destroy store %s: %s", e, err) } } } log.Infof("exterminated all data from stores %s", Context.Engines) }
// runQuit accesses the quit shutdown path. func runQuit(cmd *cobra.Command, args []string) { if err := server.SendQuit(Context); err != nil { fmt.Fprintf(osStderr, "quit failed: %s\n", err) osExit(1) return } }
// runQuit accesses the quit shutdown path. func runQuit(cmd *cobra.Command, args []string) { if err := server.SendQuit(Context); err != nil { log.Error(err) } }