-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDBNode.h
55 lines (43 loc) · 1.44 KB
/
DBNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef DBNode_H
#define DBNode_H
#include <nan.h>
#include "rocksdb/db.h"
#include <iostream>
using namespace std;
class DBNode : public Nan::ObjectWrap {
public:
static void Init();
static void InitBaseDBFunctions(v8::Local<v8::FunctionTemplate> tpl);
static void NewInstance(const v8::FunctionCallbackInfo<v8::Value>& args);
inline rocksdb::DB* db() { return _db;}
static NAN_METHOD(ListColumnFamilies);
static NAN_METHOD(DestroyDB);
rocksdb::ColumnFamilyHandle* GetColumnFamily(string family);
explicit DBNode(rocksdb::Options options, string path, rocksdb::DB *db, std::vector<rocksdb::ColumnFamilyHandle*> *cfHandles);
~DBNode();
static NAN_METHOD(Put);
static NAN_METHOD(Get);
static NAN_METHOD(Delete);
static NAN_METHOD(NewIterator);
static NAN_METHOD(ReleaseIterator);
static NAN_METHOD(GetSnapshot);
static NAN_METHOD(ReleaseSnapshot);
static NAN_METHOD(GetColumnFamilies);
static NAN_METHOD(CreateColumnFamily);
static NAN_METHOD(DropColumnFamily);
static NAN_METHOD(Batch);
static NAN_METHOD(Write);
static NAN_METHOD(Close);
static NAN_METHOD(GetSstFileWriter);
static NAN_METHOD(IngestExternalFile);
static NAN_METHOD(CompactRange);
static NAN_METHOD(MultiGet);
private:
rocksdb::Status DeleteColumnFamily(string family);
static NAN_METHOD(New);
rocksdb::DB *_db;
rocksdb::Options _options;
string _path;
std::vector<rocksdb::ColumnFamilyHandle*> *_cfHandles;
};
#endif // DBNode_H