added shutdown utility
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@1002 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
parent
645138d928
commit
b4f80aaa7d
2 changed files with 30 additions and 0 deletions
|
@ -2,3 +2,4 @@ CREATE_CLIENT_EXECUTABLE(dump_blockmap)
|
|||
CREATE_CLIENT_EXECUTABLE(drop_database)
|
||||
CREATE_CLIENT_EXECUTABLE(space_usage)
|
||||
CREATE_CLIENT_EXECUTABLE(histogram)
|
||||
CREATE_CLIENT_EXECUTABLE(shutdown)
|
||||
|
|
29
util/shutdown.cpp
Normal file
29
util/shutdown.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* shtudown.cpp
|
||||
*
|
||||
* Created on: Aug 16, 2010
|
||||
* Author: sears
|
||||
*/
|
||||
|
||||
#include "../tcpclient.h"
|
||||
#include "../network.h"
|
||||
#include "../datatuple.h"
|
||||
|
||||
void usage(char * argv[]) {
|
||||
fprintf(stderr, "usage %s [host [port]]\n", argv[0]);
|
||||
}
|
||||
#include "util_main.h"
|
||||
int main(int argc, char * argv[]) {
|
||||
logstore_handle_t * l = util_open_conn(argc, argv);
|
||||
|
||||
datatuple * ret = logstore_client_op(l, OP_SHUTDOWN);
|
||||
|
||||
if(ret == NULL) {
|
||||
perror("Shutdown failed."); return 3;
|
||||
} else {
|
||||
datatuple::freetuple(ret);
|
||||
}
|
||||
logstore_client_close(l);
|
||||
printf("Shutdown in progress\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue