-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexManager.cpp
47 lines (39 loc) · 1.04 KB
/
indexManager.cpp
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
#include <iostream>
#include <string>
#include "basic.h"
#include "definitions.h"
#include "bplustree.h"
#include "indexManager.h"
#include "bufferManager.h"
int indexManager::Find(const char* indexName, Data key){
bplustree bpt(indexName);
return bpt.Find(key);
}
bool indexManager::Insert(const char* indexName, Data key, int b_id){
bplustree bpt(indexName);
return bpt.Insert(key,b_id);
}
bool indexManager::Remove(const char* indexName, Data key){
bplustree bpt(indexName);
return bpt.Remove(key);
}
bool indexManager::CreateIndex(const char* indexName,
std::vector<Data> v,
std::vector<int> v_id,
int type
)
{
bplustree bpt(indexName,v,v_id,type);
return 1;
}
bool indexManager::DropIndex(const char* indexName){
std::string path(indexName);
path="index_"+path;
delete buffer_manager;
buffer_manager=new bufferManager();
return remove(path.c_str())==0;
}
bool indexManager::Show(const char* indexName){
bplustree bpt(indexName);
return bpt.Show();
}