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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PDBFile.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 PDBFILE_H
20 #define PDBFILE_H
21 
22 #include <stdio.h>
23 #include <vector>
24 #include "DataTypes.h"
25 #include "PDBPage.h"
26 #include <memory>
27 using namespace std;
28 
30 typedef shared_ptr<PDBFileInterface> PDBFilePtr;
31 
37 public:
38  /*
39  * To support polymorphism.
40  */
41  virtual ~PDBFileInterface() {}
42 
46  virtual bool openAll() = 0;
47 
51  virtual bool closeAll() = 0;
52 
56  virtual void clear() = 0;
57 
61  virtual int appendPage(FilePartitionID partitionId, PDBPagePtr page) = 0;
62 
66  virtual int writeMeta() = 0;
67 
71  virtual int updateMeta() = 0;
72 
77  virtual size_t loadPage(FilePartitionID partitionId,
78  unsigned int pageSeqInPartition,
79  char* pageInCache,
80  size_t length) = 0;
81 
82 
86  virtual unsigned int getAndSetNumFlushedPages() = 0;
87 
91  virtual unsigned int getNumFlushedPages() = 0;
92 
96  virtual NodeID getNodeId() = 0;
97 
101  virtual DatabaseID getDbId() = 0;
102 
106  virtual UserTypeID getTypeId() = 0;
107 
111  virtual SetID getSetId() = 0;
112 
116  virtual PageID getLastFlushedPageID() = 0;
117 
121  virtual PageID getLatestPageID() = 0;
122 
126  virtual size_t getPageSize() = 0;
127 
131  virtual size_t getPageSizeInMeta() = 0;
132 
136  virtual FileType getFileType() = 0;
137 };
138 
139 
140 #endif /* PDBFILE_H */
unsigned int SetID
Definition: DataTypes.h:31
shared_ptr< PDBPage > PDBPagePtr
Definition: PDBPage.h:32
FileType
Definition: DataTypes.h:72
unsigned int NodeID
Definition: DataTypes.h:27
unsigned int DatabaseID
Definition: DataTypes.h:29
unsigned int PageID
Definition: DataTypes.h:26
shared_ptr< PDBFileInterface > PDBFilePtr
Definition: PDBFile.h:29
virtual ~PDBFileInterface()
Definition: PDBFile.h:41
unsigned int FilePartitionID
Definition: DataTypes.h:32
unsigned int UserTypeID
Definition: DataTypes.h:25