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);