A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
DefaultDatabase.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* *
3
* Copyright 2018 Rice University *
4
* *
5
* Licensed under the Apache License, Version 2.0 (the "License"); *
6
* you may not use this file except in compliance with the License. *
7
* You may obtain a copy of the License at *
8
* *
9
* http://www.apache.org/licenses/LICENSE-2.0 *
10
* *
11
* Unless required by applicable law or agreed to in writing, software *
12
* distributed under the License is distributed on an "AS IS" BASIS, *
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14
* See the License for the specific language governing permissions and *
15
* limitations under the License. *
16
* *
17
*****************************************************************************/
18
19
#ifndef DEFAULTDATABASE_H
20
#define DEFAULTDATABASE_H
21
22
#include "
Configuration.h
"
23
#include "
DataTypes.h
"
24
#include "
PDBLogger.h
"
25
#include "
UserType.h
"
26
#include "
SharedMem.h
"
27
#include "
PageCache.h
"
28
#include "
PageCircularBuffer.h
"
29
30
#include <map>
31
#include <pthread.h>
32
#include <boost/filesystem.hpp>
33
using namespace
std;
34
35
// create a smart pointer for DummyDatabase objects
36
class
DefaultDatabase
;
37
typedef
shared_ptr<DefaultDatabase>
DefaultDatabasePtr
;
38
;
39
43
class
DefaultDatabase
{
44
45
public
:
49
DefaultDatabase
(
NodeID
nodeId,
50
DatabaseID
dbId,
51
string
dbName,
52
ConfigurationPtr
conf,
53
pdb::PDBLoggerPtr
logger,
54
SharedMemPtr
shm,
55
string
metaDBPath,
56
vector<string>* dataDBPaths,
57
PageCachePtr
cache,
58
PageCircularBufferPtr
flushBuffer);
59
~
DefaultDatabase
();
60
61
66
bool
initializeFromDBDir(boost::filesystem::path dbDir);
67
72
bool
initializeFromMetaDBDir(boost::filesystem::path metaDBDir);
73
77
bool
addType(
TypePtr
type);
78
82
bool
addType(
string
name,
UserTypeID
id
);
83
84
88
TypePtr
getType(
UserTypeID
typeId);
89
90
94
bool
removeType(
UserTypeID
typeID);
95
99
DatabaseID
getDatabaseID();
100
104
string
getDatabaseName();
105
109
void
flush();
110
114
map<UserTypeID, TypePtr>* getTypes();
115
116
117
protected
:
121
void
addTypeBySequenceFiles(
string
name,
UserTypeID
id
, boost::filesystem::path typeDir);
122
126
void
addTypeByPartitionedFiles(
string
name,
UserTypeID
id
, boost::filesystem::path metaTypeDir);
127
131
void
clearType(
UserTypeID
typeId,
string
typeName);
132
136
string
encodeTypePath(
string
dbPath,
UserTypeID
typeId,
string
typeName);
137
138
private
:
139
ConfigurationPtr
conf
;
140
map<UserTypeID, TypePtr>*
types
;
141
string
dbName
;
142
DatabaseID
dbId
;
143
NodeID
nodeId
;
144
pdb::PDBLoggerPtr
logger
;
145
pthread_mutex_t
typeOpLock
;
146
string
metaDBPath
;
147
vector<string>*
dataDBPaths
;
148
SharedMemPtr
shm
;
149
PageCachePtr
cache
;
150
PageCircularBufferPtr
flushBuffer
;
151
};
152
153
154
#endif
/* DEFAULTDATABASE_H */
TypePtr
shared_ptr< UserType > TypePtr
Definition:
UserType.h:41
UserType.h
PageCachePtr
shared_ptr< PageCache > PageCachePtr
Definition:
PageCache.h:39
DefaultDatabasePtr
shared_ptr< DefaultDatabase > DefaultDatabasePtr
Definition:
DefaultDatabase.h:36
DefaultDatabase::dbName
string dbName
Definition:
DefaultDatabase.h:141
NodeID
unsigned int NodeID
Definition:
DataTypes.h:27
DefaultDatabase::metaDBPath
string metaDBPath
Definition:
DefaultDatabase.h:146
PDBLogger.h
DefaultDatabase::nodeId
NodeID nodeId
Definition:
DefaultDatabase.h:143
DefaultDatabase::dbId
DatabaseID dbId
Definition:
DefaultDatabase.h:142
DefaultDatabase::dataDBPaths
vector< string > * dataDBPaths
Definition:
DefaultDatabase.h:147
SharedMemPtr
shared_ptr< SharedMem > SharedMemPtr
Definition:
SharedMem.h:32
DataTypes.h
DefaultDatabase::conf
ConfigurationPtr conf
Definition:
DefaultDatabase.h:139
DefaultDatabase::typeOpLock
pthread_mutex_t typeOpLock
Definition:
DefaultDatabase.h:145
SharedMem.h
DatabaseID
unsigned int DatabaseID
Definition:
DataTypes.h:29
PageCircularBuffer.h
ConfigurationPtr
shared_ptr< Configuration > ConfigurationPtr
Definition:
Configuration.h:89
DefaultDatabase::logger
pdb::PDBLoggerPtr logger
Definition:
DefaultDatabase.h:144
DefaultDatabase::flushBuffer
PageCircularBufferPtr flushBuffer
Definition:
DefaultDatabase.h:150
DefaultDatabase
Definition:
DefaultDatabase.h:43
DefaultDatabase::types
map< UserTypeID, TypePtr > * types
Definition:
DefaultDatabase.h:140
pdb::PDBLoggerPtr
std::shared_ptr< PDBLogger > PDBLoggerPtr
Definition:
PDBLogger.h:40
DefaultDatabase::shm
SharedMemPtr shm
Definition:
DefaultDatabase.h:148
PageCircularBufferPtr
shared_ptr< PageCircularBuffer > PageCircularBufferPtr
Definition:
PageCircularBuffer.h:27
PageCache.h
Configuration.h
UserTypeID
unsigned int UserTypeID
Definition:
DataTypes.h:25
DefaultDatabase::cache
PageCachePtr cache
Definition:
DefaultDatabase.h:149
plinycompute
pdb
src
storage
headers
DefaultDatabase.h
Generated on Mon Jun 18 2018 18:10:36 by
1.8.6