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

#include <TempSet.h>

+ Inheritance diagram for TempSet:
+ Collaboration diagram for TempSet:

Public Member Functions

 TempSet (SetID setId, string setName, string metaTempPath, vector< string > dataTempPaths, SharedMemPtr shm, PageCachePtr cache, pdb::PDBLoggerPtr logger, LocalityType localityType=ShuffleData, LocalitySetReplacementPolicy policy=MRU, OperationType operation=Write, DurabilityType durability=TryCache, PersistenceType persistence=Transient, size_t pageSize=DEFAULT_PAGE_SIZE)
 
 ~TempSet ()
 
void clear ()
 
- Public Member Functions inherited from UserSet
 UserSet (pdb::PDBLoggerPtr logger, SharedMemPtr shm, NodeID nodeId, DatabaseID dbId, UserTypeID typeId, SetID setId, string setName, PageCachePtr pageCache, LocalityType localityType=JobData, LocalitySetReplacementPolicy policy=MRU, OperationType operation=Read, DurabilityType durability=TryCache, PersistenceType persistence=Persistent, size_t pageSize=DEFAULT_PAGE_SIZE)
 
 UserSet (size_t pageSize, pdb::PDBLoggerPtr logger, SharedMemPtr shm, NodeID nodeId, DatabaseID dbId, UserTypeID typeId, SetID setId, string setName, PartitionedFilePtr file, PageCachePtr pageCache, LocalityType localityType=JobData, LocalitySetReplacementPolicy policy=MRU, OperationType operation=Read, DurabilityType durability=TryCache, PersistenceType persistence=Persistent)
 
 ~UserSet ()
 
bool addObject (PDBObjectPtr object, PDBPagePtr page)
 
bool addObject (PDBObjectPtr object)
 
void pinBufferPage ()
 
void unpinBufferPage ()
 
PDBPagePtr getPageFromFile (FilePartitionID partitionId, unsigned int pageSeqInPartition)
 
PDBPagePtr addPage ()
 
PDBPagePtr addPageByRawBytes (size_t sharedMemOffset)
 
void * getNewBytes (size_t size, bool evictWhenUnpin=false)
 
virtual vector< PageIteratorPtr > * getIterators ()
 
PDBPagePtr getPage (FilePartitionID partitionId, unsigned int pageSeqInPartition, PageID pageId)
 
int getNumPages ()
 
DatabaseID getDbID ()
 
UserTypeID getTypeID ()
 
SetID getSetID ()
 
string getSetName ()
 
PartitionedFilePtr getFile ()
 
void setFile (PartitionedFilePtr file)
 
PageID getLastFlushedPageId ()
 
void setLastFlushedPageId (PageID pageId)
 
void addPageToDirtyPageSet (PageID pageId)
 
void removePageFromDirtyPageSet (PageID pageId, FilePartitionID partitionId, unsigned int pageSeqInPartition)
 
unordered_map< PageID,
FileSearchKey > * 
getDirtyPageSet ()
 
void lockDirtyPageSet ()
 
void unlockDirtyPageSet ()
 
void dump (char *buffer)
 
void evictPages ()
 
bool getPinned ()
 
void setPinned (bool isPinned)
 
pdb::PDBLoggerPtr getLogger ()
 
void cleanDirtyPageSet ()
 
void flushDirtyPages ()
 
size_t getPageSize ()
 
void setPageSize (size_t pageSize)
 
bool getSorted ()
 
void setSorted (bool isSorted)
 
bool getPartitioned ()
 
void setPartitioned (bool isPartitioned)
 
- Public Member Functions inherited from LocalitySet
 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 Member Functions

string encodePath (string tempPath, string setName)
 

Additional Inherited Members

- Protected Attributes inherited from UserSet
PartitionedFilePtr file = nullptr
 
PageCachePtr pageCache = nullptr
 
SharedMemPtr shm
 
pdb::PDBLoggerPtr logger = nullptr
 
NodeID nodeId
 
DatabaseID dbId
 
UserTypeID typeId
 
SetID setId
 
string setName
 
PageID lastFlushedPageId
 
PageID latestPageId
 
PDBPagePtr inputBufferPage = nullptr
 
SequenceID seqId
 
unordered_map< PageID,
FileSearchKey > * 
dirtyPagesInPageCache = nullptr
 
pthread_mutex_t dirtyPageSetMutex
 
bool isPinned = false
 
int numPages
 
pthread_mutex_t addBytesMutex
 
size_t pageSize
 
bool isSorted = false
 
bool isPartitioned = false
 
- Protected Attributes inherited from LocalitySet
list< PDBPagePtr > * cachedPages
 
LocalityType localityType
 
LocalitySetReplacementPolicy replacementPolicy
 
OperationType operationType
 
DurabilityType durabilityType
 
PersistenceType persistenceType
 
bool lifetimeEnded
 

Detailed Description

This class wraps a temporary set. The set is created per request of backend, and managed by local storage for creation, data insertion, flushing, loading and removal.

Definition at line 39 of file TempSet.h.

Constructor & Destructor Documentation

TempSet::TempSet ( SetID  setId,
string  setName,
string  metaTempPath,
vector< string >  dataTempPaths,
SharedMemPtr  shm,
PageCachePtr  cache,
pdb::PDBLoggerPtr  logger,
LocalityType  localityType = ShuffleData,
LocalitySetReplacementPolicy  policy = MRU,
OperationType  operation = Write,
DurabilityType  durability = TryCache,
PersistenceType  persistence = Transient,
size_t  pageSize = DEFAULT_PAGE_SIZE 
)

Create a TempSet instance. All TempSets are stored in Database with DatabaseID = 0, and in UserType with UserTypeID = 0.

Definition at line 30 of file TempSet.cc.

+ Here is the call graph for this function:

TempSet::~TempSet ( )

Definition at line 74 of file TempSet.cc.

Member Function Documentation

void TempSet::clear ( )

Clear temp set and all related files;

Definition at line 77 of file TempSet.cc.

+ Here is the call graph for this function:

string TempSet::encodePath ( string  tempPath,
string  setName 
)
protected

Compute the path to store the set data.

Definition at line 81 of file TempSet.cc.

+ Here is the caller graph for this function:


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