Revision a8464ed8208e21c4438667234602f54ceae91518 authored by heyongqiang on 17 September 2012, 20:35:57 UTC, committed by heyongqiang on 17 September 2012, 20:59:57 UTC
Summary:
as subject. This diff should be good for benchmarking.

will send another diff to make it better in the case the seek compaction is enable.
In that coming diff, will not count a seek if the bloomfilter filters.

Test Plan: build

Reviewers: dhruba, MarkCallaghan

Reviewed By: MarkCallaghan

Differential Revision: https://reviews.facebook.net/D5481
1 parent 906f2ee
Raw File
server.cpp
/**
 * Thrift server for leveldb
 * @author Dhruba Borthakur (dhruba@gmail.com)
 * Copyright 2012 Facebook
 */

#include <signal.h>
#include <DB.h>
#include <protocol/TBinaryProtocol.h>
#include <server/TSimpleServer.h>
#include <server/TConnectionContext.h>
#include <transport/TServerSocket.h>
#include <transport/TBufferTransports.h>
#include <leveldb_types.h>
#include "openhandles.h"
#include "server_options.h"

#include "leveldb/db.h"
#include "leveldb/write_batch.h"

using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
using namespace apache::thrift::server;
using namespace  Tleveldb;
using boost::shared_ptr;

extern "C" void startServer(int argc, char** argv);
extern "C" void stopServer(int port);
extern ServerOptions server_options;

void signal_handler(int sig) {
  switch (sig) {
  case SIGINT:
    fprintf(stderr, "Received SIGINT, stopping leveldb server");
    stopServer(server_options.getPort());
    break;
  }
}

int main(int argc, char **argv) {
  signal(SIGINT, signal_handler);
  startServer(argc, argv);
  sleep(100000000L);
  return 0;
}

back to top