SwatDB
Loading...
Searching...
No Matches
swatdb.h
Go to the documentation of this file.
1/*
2 * SwatDB
3 *
4 * @authors: See Contributors.doc for code contributors
5 *
6 * Copyright (c) 2020 Swarthmore College Computer Science Department
7 * Swarthmore PA, Professors Tia Newhall, Ameet Soni
8 */
9
10#ifndef _SWATDB_SWATDB_H_
11#define _SWATDB_SWATDB_H_
12
13#include "swatdb_types.h"
14
19class BufferManager;
20class DiskManager;
21class FileManager;
22class RelOpsManager;
23class Catalog;
24class Schema;
25
48class SwatDB {
49
50 public:
51
62 SwatDB(const char *result_path, RepType rep_pol = ClockT);
63
84 SwatDB(std::string metadata_filename, const char *result_path,
85 RepType rep_pol = ClockT);
86
104
105 // TODO: do we want version of destroyDB and saveDB that
106 // actually do the destroying and saving at other times
107 // in the execution rather than just set the state to
108 // do the right thing on shutdown???
120
137 void setSaveDB(std::string filename);
138
142 Catalog *getCatalog( ) { return cat; }
143
148
153
158
163
164 // TODO: do we want to export some information about the DB here
165 // statistics, sizes, etc.
166 // TODO: do we want any other interface functions that are
167 // called externally?
168
169
170 private: // or protected
171
176
181
185 // Clock *rep_pol;
186
191
196
201
208 bool saved;
209
213 std::string inited_file_name;
214
218 std::string saved_file_name;
219};
220
221#endif
Definition bufmgr.h:121
Definition catalog.h:161
Definition diskmgr.h:38
Definition filemgr.h:32
Definition relopsmgr.h:46
Definition schema.h:37
Definition swatdb.h:48
void setDestroyDB()
sets the DB to be destroyed on shutdown.
FileManager * getFileMgr()
Gets the SwatDB FileManager.
Definition swatdb.h:157
BufferManager * buf_mgr
Definition swatdb.h:190
BufferManager * getBufMgr()
Gets the SwatDB BufferManager.
Definition swatdb.h:152
RelOpsManager * getRelOpsMgr()
Gets the SwatDB RelopsManager.
Definition swatdb.h:162
SwatDB(std::string metadata_filename, const char *result_path, RepType rep_pol=ClockT)
Constructor to init SwatDB from a metadata file.
std::string inited_file_name
Definition swatdb.h:213
void setSaveDB(std::string filename)
sets the DB to be saved on shutdown.
~SwatDB()
Shutdown SwatDB.
SwatDB(const char *result_path, RepType rep_pol=ClockT)
Constructor.
Catalog * cat
Definition swatdb.h:175
std::string saved_file_name
Definition swatdb.h:218
DiskManager * disk_mgr
Definition swatdb.h:180
bool saved
Definition swatdb.h:208
DiskManager * getDiskMgr()
Gets the SwatDB DiskManager.
Definition swatdb.h:147
FileManager * file_mgr
Definition swatdb.h:195
RelOpsManager * relops_mgr
Definition swatdb.h:200
Catalog * getCatalog()
Gets the SwatDB Catalog.
Definition swatdb.h:142
RepType
Definition swatdb_types.h:167