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
LocalitySet Class Reference

#include <LocalitySet.h>

+ Inheritance diagram for LocalitySet:
+ Collaboration diagram for LocalitySet:

Public Member Functions

 LocalitySet (LocalityType localityType, LocalitySetReplacementPolicy replacementPolicy, OperationType operationType, DurabilityType durabilityType, PersistenceType persistenceType)
 
 ~LocalitySet ()
 
void addCachedPage (PDBPagePtr page)
 
void updateCachedPage (PDBPagePtr page)
 
void removeCachedPage (PDBPagePtr page)
 
PDBPagePtr selectPageForReplacement ()
 
vector< PDBPagePtr > * selectPagesForReplacement ()
 
void pin (LocalitySetReplacementPolicy policy, OperationType operationType)
 
void unpin ()
 
LocalityType getLocalityType ()
 
void setLocalityType (LocalityType type)
 
LocalitySetReplacementPolicy getReplacementPolicy ()
 
void setReplacementPolicy (LocalitySetReplacementPolicy policy)
 
OperationType getOperationType ()
 
void setOperationType (OperationType type)
 
DurabilityType getDurabilityType ()
 
void setDurabilityType (DurabilityType type)
 
PersistenceType getPersistenceType ()
 
void setPersistenceType (PersistenceType type)
 
bool isLifetimeEnded ()
 
void setLifetimeEnd (bool lifetimeEnded)
 

Protected Attributes

list< PDBPagePtr > * cachedPages
 
LocalityType localityType
 
LocalitySetReplacementPolicy replacementPolicy
 
OperationType operationType
 
DurabilityType durabilityType
 
PersistenceType persistenceType
 
bool lifetimeEnded
 

Detailed Description

This class implements the interfaces for LocalitySet. LocalitySet defines the set locality properties, and is mainly used for PageCache eviction.

Definition at line 36 of file LocalitySet.h.

Constructor & Destructor Documentation

LocalitySet::LocalitySet ( LocalityType  localityType,
LocalitySetReplacementPolicy  replacementPolicy,
OperationType  operationType,
DurabilityType  durabilityType,
PersistenceType  persistenceType 
)

Definition at line 24 of file LocalitySet.cc.

LocalitySet::~LocalitySet ( )

Definition at line 38 of file LocalitySet.cc.

Member Function Documentation

void LocalitySet::addCachedPage ( PDBPagePtr  page)

Definition at line 43 of file LocalitySet.cc.

+ Here is the caller graph for this function:

DurabilityType LocalitySet::getDurabilityType ( )

Definition at line 173 of file LocalitySet.cc.

LocalityType LocalitySet::getLocalityType ( )

Definition at line 148 of file LocalitySet.cc.

OperationType LocalitySet::getOperationType ( )

Definition at line 164 of file LocalitySet.cc.

PersistenceType LocalitySet::getPersistenceType ( )

Definition at line 181 of file LocalitySet.cc.

LocalitySetReplacementPolicy LocalitySet::getReplacementPolicy ( )

Definition at line 156 of file LocalitySet.cc.

bool LocalitySet::isLifetimeEnded ( )

Definition at line 189 of file LocalitySet.cc.

void LocalitySet::pin ( LocalitySetReplacementPolicy  policy,
OperationType  operationType 
)

Definition at line 137 of file LocalitySet.cc.

void LocalitySet::removeCachedPage ( PDBPagePtr  page)

Definition at line 57 of file LocalitySet.cc.

PDBPagePtr LocalitySet::selectPageForReplacement ( )

Definition at line 66 of file LocalitySet.cc.

vector< PDBPagePtr > * LocalitySet::selectPagesForReplacement ( )

Definition at line 88 of file LocalitySet.cc.

void LocalitySet::setDurabilityType ( DurabilityType  type)

Definition at line 177 of file LocalitySet.cc.

void LocalitySet::setLifetimeEnd ( bool  lifetimeEnded)

Definition at line 193 of file LocalitySet.cc.

void LocalitySet::setLocalityType ( LocalityType  type)

Definition at line 152 of file LocalitySet.cc.

void LocalitySet::setOperationType ( OperationType  type)

Definition at line 168 of file LocalitySet.cc.

void LocalitySet::setPersistenceType ( PersistenceType  type)

Definition at line 185 of file LocalitySet.cc.

void LocalitySet::setReplacementPolicy ( LocalitySetReplacementPolicy  policy)

Definition at line 160 of file LocalitySet.cc.

void LocalitySet::unpin ( )

Definition at line 143 of file LocalitySet.cc.

void LocalitySet::updateCachedPage ( PDBPagePtr  page)

Definition at line 47 of file LocalitySet.cc.

+ Here is the caller graph for this function:

Member Data Documentation

list<PDBPagePtr>* LocalitySet::cachedPages
protected

Cached pages in the set, ordered by access sequenceId; So pop_front for LRU, pop_back for MRU

Definition at line 113 of file LocalitySet.h.

DurabilityType LocalitySet::durabilityType
protected

Durability type of the set:

  1. TryCache: flush to disk only when evicting dirty data
  2. CacheThrough: flush disk after each page writing

This property should be set at construction time.

Definition at line 154 of file LocalitySet.h.

bool LocalitySet::lifetimeEnded
protected

If lifetime ends, the data becomes garbage data which has the lowest priority. This property will be set as false by default at construction time, and will be set as true at unpin time.

Definition at line 170 of file LocalitySet.h.

LocalityType LocalitySet::localityType
protected

Definition at line 125 of file LocalitySet.h.

OperationType LocalitySet::operationType
protected

Definition at line 145 of file LocalitySet.h.

PersistenceType LocalitySet::persistenceType
protected

Whether the set is required for persistence:

  1. Transient
  2. Persistence

This property should be set at construction time.

Definition at line 163 of file LocalitySet.h.

LocalitySetReplacementPolicy LocalitySet::replacementPolicy
protected

Definition at line 135 of file LocalitySet.h.


The documentation for this class was generated from the following files: