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
HashSet.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
* HashSet is an in-memory set for implementing Pangaea hash map.
21
*/
22
23
24
#ifndef HASHSET_H
25
#define HASHSET_H
26
27
#include "
PageCache.h
"
28
#include "
PDBLogger.h
"
29
#include "
DataTypes.h
"
30
#include "
LocalitySet.h
"
31
#include <memory>
32
#include <string>
33
using namespace
std;
34
35
class
HashSet
;
36
typedef
shared_ptr<HashSet>
HashSetPtr
;
37
38
class
HashSet
:
public
LocalitySet
{
39
public
:
40
HashSet
(
PageCachePtr
cache,
41
PDBLoggerPtr
logger,
42
size_t
pageSize,
43
NodeID
nodeId,
44
DatabaseID
dbId,
45
UserTypeID
typeId,
46
SetID
setId,
47
string
setName)
48
:
LocalitySet
(
HashPartitionData
,
LRU
,
Write
,
TryCache
,
Transient
) {
49
this->cache = cache;
50
this->logger = logger;
51
this->pageSize = pageSize;
52
this->nodeId = nodeId;
53
this->dbId = dbId;
54
this->typeId = typeId;
55
this->setId = setId;
56
this->pageId = 0;
57
this->setName = setName;
58
}
59
60
~HashSet
() {}
61
62
void
clear
() {}
63
64
DatabaseID
getDatabaseID
() {
65
return
this->dbId;
66
}
67
68
UserTypeID
getUserTypeID
() {
69
return
this->typeId;
70
}
71
72
SetID
getSetID
() {
73
return
this->setId;
74
}
75
76
string
getSetName
() {
77
return
this->setName;
78
}
79
80
PDBPagePtr
addPage
() {
81
CacheKey
key;
82
key.
dbId
= this->dbId;
83
key.
typeId
= this->typeId;
84
key.
setId
= this->setId;
85
key.
pageId
= this->pageId;
86
this->pageId++;
87
// PDBPagePtr page = this->cache->getNewPageNonBlocking(this->nodeId, key, this);
88
PDBPagePtr
page = this->cache->getNewPage(this->nodeId, key,
this
);
89
return
page;
90
}
91
92
void
unpinPage
(
PageID
pageId) {
93
CacheKey
key;
94
key.
dbId
= this->dbId;
95
key.
typeId
= this->typeId;
96
key.
setId
= this->setId;
97
key.
pageId
= pageId;
98
this->cache->decPageRefCount(key);
99
}
100
101
private
:
102
PDBLoggerPtr
logger
;
103
PageCachePtr
cache
;
104
size_t
pageSize
;
105
NodeID
nodeId
;
106
DatabaseID
dbId
;
107
UserTypeID
typeId
;
108
SetID
setId
;
109
PageID
pageId
;
110
string
setName
;
111
};
112
113
#endif
HashSet::getSetID
SetID getSetID()
Definition:
HashSet.h:72
HashSet::logger
PDBLoggerPtr logger
Definition:
HashSet.h:102
CacheKey::setId
SetID setId
Definition:
DataTypes.h:87
SetID
unsigned int SetID
Definition:
DataTypes.h:31
PDBPagePtr
shared_ptr< PDBPage > PDBPagePtr
Definition:
PDBPage.h:32
HashSet::getSetName
string getSetName()
Definition:
HashSet.h:76
HashSet::setId
SetID setId
Definition:
HashSet.h:108
HashSet::~HashSet
~HashSet()
Definition:
HashSet.h:60
HashSet::setName
string setName
Definition:
HashSet.h:110
Transient
Definition:
DataTypes.h:68
PageCachePtr
shared_ptr< PageCache > PageCachePtr
Definition:
PageCache.h:39
HashSetPtr
shared_ptr< HashSet > HashSetPtr
Definition:
HashSet.h:35
TryCache
Definition:
DataTypes.h:59
CacheKey::dbId
DatabaseID dbId
Definition:
DataTypes.h:85
HashSet::unpinPage
void unpinPage(PageID pageId)
Definition:
HashSet.h:92
HashSet::pageSize
size_t pageSize
Definition:
HashSet.h:104
NodeID
unsigned int NodeID
Definition:
DataTypes.h:27
HashSet::getUserTypeID
UserTypeID getUserTypeID()
Definition:
HashSet.h:68
LocalitySet
Definition:
LocalitySet.h:36
PDBLogger.h
HashPartitionData
Definition:
DataTypes.h:50
DataTypes.h
DatabaseID
unsigned int DatabaseID
Definition:
DataTypes.h:29
PageID
unsigned int PageID
Definition:
DataTypes.h:26
HashSet::typeId
UserTypeID typeId
Definition:
HashSet.h:107
CacheKey::pageId
PageID pageId
Definition:
DataTypes.h:88
CacheKey
Definition:
DataTypes.h:84
HashSet::addPage
PDBPagePtr addPage()
Definition:
HashSet.h:80
HashSet::HashSet
HashSet(PageCachePtr cache, PDBLoggerPtr logger, size_t pageSize, NodeID nodeId, DatabaseID dbId, UserTypeID typeId, SetID setId, string setName)
Definition:
HashSet.h:40
HashSet::clear
void clear()
Definition:
HashSet.h:62
HashSet::nodeId
NodeID nodeId
Definition:
HashSet.h:105
HashSet::getDatabaseID
DatabaseID getDatabaseID()
Definition:
HashSet.h:64
HashSet::pageId
PageID pageId
Definition:
HashSet.h:109
HashSet
Definition:
HashSet.h:38
pdb::PDBLoggerPtr
std::shared_ptr< PDBLogger > PDBLoggerPtr
Definition:
PDBLogger.h:40
HashSet::cache
PageCachePtr cache
Definition:
HashSet.h:103
CacheKey::typeId
UserTypeID typeId
Definition:
DataTypes.h:86
PageCache.h
HashSet::dbId
DatabaseID dbId
Definition:
HashSet.h:106
UserTypeID
unsigned int UserTypeID
Definition:
DataTypes.h:25
Write
Definition:
DataTypes.h:57
LRU
Definition:
DataTypes.h:52
LocalitySet.h
plinycompute
pdb
src
storage
headers
HashSet.h
Generated on Mon Jun 18 2018 18:10:36 by
1.8.6