-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphDatabase.h
79 lines (65 loc) · 2.41 KB
/
GraphDatabase.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
#ifndef GRAPHDATABASE_H
#define GRAPHDATABASE_H
#include "ParserGraphs.h"
#include "parser\GraphParser.h"
#include "storage\GraphSetManager.h"
#include "storage\GraphManager.h"
#include "GraphSchemaManager.h"
#include "GraphProcessor.h"
#include "storage\GraphLoader.h"
#include "GraphSchema.h"
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <iostream>
using namespace std;
class GraphSetManager;
class GraphProcessor;
class GraphLoader;
class FromConditionGraph;
class WhereConditionGraph;
class GraphDatabase {
public:
string gsetdir;
string gdir;
string schemadir;
GraphDatabase();
~GraphDatabase();
void run();
void close();
void createGraph(string gname, vector<string>& filelist, string& schemaid);
void loadGraph(string gname);
bool dispatchGraph(string gname, string& gtime, GraphSetManager* gm, int auth=0);
bool retrieveGraph(string gname, GraphSetManager* gm, int auth=0);
void callbackGraph(string gname);
void createGraphSet(string gsname, vector<string>& aliasgraph);
bool loadGraphSet(string gsname);
void addGraphSet(GraphSetManager* gm);
void removeGraphSet(GraphSetManager* gm, unordered_map<string, int>& graphAuth);
void linkGraphToGraphSet(string gname, string gsname);
void dropGraphSet(string gsname);
void dropGraph(string gname);
void dropSchema(string schemaname);
bool hasGraph(string gname);
bool hasGraphSet(string gsname);
bool getGraph(string gname, GraphManager*& gm);
bool getGraphSet(string gsname, GraphSetManager*& gsm);
void createSchema(string schemaname, SchemaAttrMap& nodeAttrMap, SchemaAttrMap& edgeAttrMap, SchemaNetwork& schemaNetwork);
void createSchema(string filename);
void insertIntoGraphSet(string gsname, vector<string>& gidlist);
void removeFromGraphSet(string gsname, vector<string>& gidlist);
void insertIntoGraph(GraphStat& gs, string& gid);
void removeFromGraph(GraphStat& gs, string& gid);
void selectFromGraphSet(FromConditionGraph* fcg, WhereConditionGraph* wcg);
GraphParser* gParser;
GraphProcessor* gProcessor;
GraphLoader* gLoader;
unordered_map<string, GraphSetManager*> gsetManager; //all the graph sets in the graph
GraphSchemaManager* gschemaManager;
unordered_map<string, GraphManager*> graphs; // all the graphs already maintained in the graph;
unordered_map<string, unordered_set<GraphSetManager*>> readAuthority;
unordered_map<string, unordered_set<GraphSetManager*>> writeAuthority;
};
#endif