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
FileSet.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 
20 #ifndef FILESET_H
21 #define FILESET_H
22 
23 #include "PageCache.h"
24 #include "PDBLogger.h"
25 #include "PageIterator.h"
26 #include "PageCache.h"
27 #include "DataTypes.h"
28 #include <memory>
29 #include <string>
30 using namespace std;
31 
32 class FileSet;
33 typedef shared_ptr<FileSet> FileSetPtr;
34 
35 class FileSet : public LocalitySet {
36 public:
37  FileSet(PageCachePtr cache,
38  string filePath,
39  size_t pageSize,
40  NodeID nodeId,
41  DatabaseID dbId,
42  UserTypeID typeId,
43  SetID setId);
44  ~FileSet();
45  void clear();
46  int writeData(void* data, size_t length);
47  PageIteratorPtr getIterator();
49  return this->nodeId;
50  }
51 
53  return this->dbId;
54  }
56  return this->typeId;
57  }
59  return this->setId;
60  }
61  string getFilePath() {
62  return this->filePath;
63  }
64 
65 private:
66  string filePath;
67  int handle;
69  size_t pageSize;
70  size_t fileSize;
75 };
76 
77 #endif
unsigned int SetID
Definition: DataTypes.h:31
DatabaseID getDatabaseID()
Definition: FileSet.h:52
NodeID nodeId
Definition: FileSet.h:71
shared_ptr< PageCache > PageCachePtr
Definition: PageCache.h:39
shared_ptr< PageIteratorInterface > PageIteratorPtr
Definition: PageIterator.h:33
unsigned int NodeID
Definition: DataTypes.h:27
string getFilePath()
Definition: FileSet.h:61
PageCachePtr cache
Definition: FileSet.h:68
NodeID getNodeID()
Definition: FileSet.h:48
unsigned int DatabaseID
Definition: DataTypes.h:29
UserTypeID getUserTypeID()
Definition: FileSet.h:55
shared_ptr< FileSet > FileSetPtr
Definition: FileSet.h:32
string filePath
Definition: FileSet.h:66
DatabaseID dbId
Definition: FileSet.h:72
UserTypeID typeId
Definition: FileSet.h:73
size_t pageSize
Definition: FileSet.h:69
SetID getSetID()
Definition: FileSet.h:58
int handle
Definition: FileSet.h:67
SetID setId
Definition: FileSet.h:74
size_t fileSize
Definition: FileSet.h:70
unsigned int UserTypeID
Definition: DataTypes.h:25