/* * blsm_server.cpp * * Copyright 2009-2012 Yahoo! Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include "MapKeeper.h" #include #include #include #include #include #include #include #include #include "bLSM.h" #include "dataTuple.h" #include "bLSMRequestHandler.h" using namespace ::apache::thrift; using namespace ::apache::thrift::protocol; using namespace ::apache::thrift::transport; using namespace ::apache::thrift::server; using namespace ::apache::thrift::concurrency; using boost::shared_ptr; 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(handler->port)); shared_ptr transportFactory(new TFramedTransportFactory()); shared_ptr protocolFactory(new TBinaryProtocolFactory()); shared_ptr threadManager = ThreadManager::newSimpleThreadManager(32); shared_ptr threadFactory(new PosixThreadFactory()); //threadManager->threadFactory(threadFactory); //threadManager->start(); TThreadedServer server(processor, serverTransport, transportFactory, protocolFactory); printf("I'm using tthreaded server!"); server.serve(); return 0; }