stasis-bLSM/requestDispatch.h
sears 392a097e44 add atomic testAndSet operation (needed for sherpa tablet names' uniqid field)
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@1158 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
2010-09-16 22:36:48 +00:00

34 lines
1.6 KiB
C++

/*
* requestDispatch.h
*
* Created on: Aug 11, 2010
* Author: sears
*/
#ifndef REQUESTDISPATCH_H_
#define REQUESTDISPATCH_H_
#include "network.h"
#include "datatuple.h"
#include "logstore.h"
template<class HANDLE>
class requestDispatch {
private:
static inline int op_insert(logtable<datatuple> * ltable, HANDLE fd, datatuple * tuple);
static inline int op_test_and_set(logtable<datatuple> * ltable, HANDLE fd, datatuple * tuple, datatuple * tuple2);
static inline int op_find(logtable<datatuple> * ltable, HANDLE fd, datatuple * tuple);
static inline int op_scan(logtable<datatuple> * ltable, HANDLE fd, datatuple * tuple, datatuple * tuple2, size_t limit);
static inline int op_bulk_insert(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_flush(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_shutdown(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_stat_space_usage(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_stat_perf_report(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_stat_histogram(logtable<datatuple> * ltable, HANDLE fd, size_t limit);
static inline int op_dbg_blockmap(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_dbg_drop_database(logtable<datatuple> * ltable, HANDLE fd);
static inline int op_dbg_noop(logtable<datatuple> * ltable, HANDLE fd);
public:
static int dispatch_request(HANDLE f, logtable<datatuple> * ltable);
static int dispatch_request(network_op_t opcode, datatuple * tuple, datatuple * tuple2, logtable<datatuple> * ltable, HANDLE fd);
};
#endif /* REQUESTDISPATCH_H_ */