66 int internalOffset = 0,
72 PDBPage(
char* dataIn,
size_t offset,
int internalOffset = 0);
87 pthread_mutex_lock(&this->refCountMutex);
90 pthread_mutex_unlock(&this->refCountMutex);
94 pthread_mutex_lock(&this->refCountMutex);
96 if (this->refCount < 0) {
99 this->setPinned(
false);
101 }
else if (this->refCount == 0) {
102 this->setPinned(
false);
104 pthread_mutex_unlock(&this->refCountMutex);
108 pthread_mutex_lock(&this->refCountMutex);
109 if (this->rawBytes !=
nullptr) {
110 free(this->rawBytes);
111 this->rawBytes =
nullptr;
113 pthread_mutex_unlock(&this->refCountMutex);
118 pthread_mutex_lock(&this->refCountMutex);
119 char* refCountBytes =
122 *((
int*)refCountBytes) = *((
int*)refCountBytes) + 1;
123 pthread_mutex_unlock(&this->refCountMutex);
124 return *((
int*)refCountBytes);
128 char* refCountBytes =
131 return *((
int*)refCountBytes);
135 this->numObjects = numObjects;
139 return this->numObjects;
147 size_t remainSize = this->size - this->curAppendOffset;
148 if (remainSize < size +
sizeof(
size_t)) {
155 char* cur = this->rawBytes + this->curAppendOffset;
157 *((
size_t*)cur) = size;
158 void* retPos = cur +
sizeof(size_t);
159 cur = (
char*)retPos + size;
160 this->curAppendOffset = cur - this->rawBytes;
161 this->incEmbeddedNumObjects();
162 int myNumObjects = this->getEmbeddedNumObjects();
234 return numHeadMiniPages;
256 return accessSequenceId;
261 return this->refCount;
285 return this->inFlush;
290 return this->inEviction;
294 return pageSeqInPartition;
303 this->nodeID = nodeID;
313 this->typeID = typeID;
323 this->pageID = pageID;
328 this->rawBytes = rawBytes;
338 this->offset = offset;
344 this->numHeadMiniPages = numHeadMiniPages;
349 this->numMiniPages = numMiniPages;
355 this->miniPageSize = miniPageSize;
360 this->headSize = headSize;
365 this->accessSequenceId = accessSequenceId;
370 this->pinned = isPinned;
380 this->inFlush = inFlush;
385 this->inEviction = inEviction;
389 this->pageSeqInPartition = pageSeqInPartition;
393 this->partitionId = partitionId;
397 this->internalOffset = offset;
401 return this->internalOffset;
void setNumHeadMiniPages(int numHeadMiniPages)
void setNodeID(NodeID nodeID)
DatabaseID getDbID() const
shared_ptr< PDBPage > PDBPagePtr
int getNumMiniPages() const
void setPinned(bool isPinned)
void setInEviction(bool inEviction)
void setPageSeqInPartition(unsigned int pageSeqInPartition)
void setAccessSequenceId(long accessSequenceId)
int getNumHeadMiniPages() const
size_t getRawSize() const
void setInternalOffset(int offset)
void setHeadSize(size_t headSize)
void setSetID(SetID setID)
pthread_rwlock_t flushLock
void setPageID(PageID pageID)
void setInFlush(bool inFlush)
size_t getHeadSize() const
pthread_mutex_t refCountMutex
FilePartitionID getPartitionId() const
void setNumObjects(int numObjects)
void setTypeID(UserTypeID typeID)
unsigned int pageSeqInPartition
UserTypeID getTypeID() const
size_t getMiniPageSize() const
void setNumMiniPages(int numMiniPages)
void setDirty(bool dirty)
void setMiniPageSize(size_t miniPageSize)
void setDbID(DatabaseID dbID)
void setOffset(size_t offset)
void setPartitionId(FilePartitionID partitionId)
unsigned int getPageSeqInPartition() const
FilePartitionID partitionId
int incEmbeddedNumObjects()
void setRawBytes(char *rawBytes)
unsigned int FilePartitionID
char * getRawBytes() const
void setSize(size_t size)
long getAccessSequenceId() const
void * addVariableBytes(size_t size)
int getEmbeddedNumObjects()