From 6368f16bc08640f3eca923981665117bc5c8fe0b Mon Sep 17 00:00:00 2001 From: sears Date: Fri, 13 Jan 2012 00:13:33 +0000 Subject: [PATCH] add --port option git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@3566 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe --- sherpa/LSMServerHandler.cc | 9 ++++++--- sherpa/LSMServerHandler.h | 1 + sherpa/main/lsm_server.cc | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sherpa/LSMServerHandler.cc b/sherpa/LSMServerHandler.cc index ebdacba..fe4cd95 100644 --- a/sherpa/LSMServerHandler.cc +++ b/sherpa/LSMServerHandler.cc @@ -19,13 +19,13 @@ LSMServerHandler(int argc, char **argv) // how big the in-memory tree should be (512MB). int64_t c0_size = 1024 * 1024 * 512 * 1; - // write-ahead log // 1 -> sync on each commit // 2 -> sync on each 2 commits // ... int log_mode = 0; // do not log by default. int64_t expiry_delta = 0; // do not gc by default + port = 9090; stasis_buffer_manager_size = 1 * 1024 * 1024 * 1024 / PAGE_SIZE; // 1.5GB total @@ -45,8 +45,11 @@ LSMServerHandler(int argc, char **argv) } else if(!strcmp(argv[i], "--log-mode")) { i++; log_mode = atoi(argv[i]); - } else if(!strcmp(argv[i], "--blind-update")) { - blind_update = 1; + } else if(!strcmp(argv[i], "--port")) { + i++; + port = atoi(argv[i]); + } else if(!strcmp(argv[i], "--blind-update")) { + blind_update = 1; } else if(!strcmp(argv[i], "--expiry-delta")) { i++; expiry_delta = atoi(argv[i]); diff --git a/sherpa/LSMServerHandler.h b/sherpa/LSMServerHandler.h index 40061fc..b23c703 100644 --- a/sherpa/LSMServerHandler.h +++ b/sherpa/LSMServerHandler.h @@ -28,6 +28,7 @@ public: ResponseCode::type insertMany(const std::string& databaseName, const std::vector & records); ResponseCode::type update(const std::string& databaseName, const std::string& recordName, const std::string& recordBody); ResponseCode::type remove(const std::string& databaseName, const std::string& recordName); + short port; private: ResponseCode::type insert(datatuple* tuple); diff --git a/sherpa/main/lsm_server.cc b/sherpa/main/lsm_server.cc index 247b69e..aa4b3f9 100644 --- a/sherpa/main/lsm_server.cc +++ b/sherpa/main/lsm_server.cc @@ -23,7 +23,7 @@ using namespace mapkeeper; int main(int argc, char **argv) { shared_ptr handler(new LSMServerHandler(argc, argv)); shared_ptr processor(new MapKeeperProcessor(handler)); - shared_ptr serverTransport(new TServerSocket(9090)); + shared_ptr serverTransport(new TServerSocket(handler->port)); shared_ptr transportFactory(new TFramedTransportFactory()); shared_ptr protocolFactory(new TBinaryProtocolFactory()); shared_ptr threadManager = ThreadManager::newSimpleThreadManager(32);