|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tmatesoft.sqljet.core.internal.SqlJetCloneable
org.tmatesoft.sqljet.core.internal.btree.SqlJetMemPage
public class SqlJetMemPage
As each page of the file is loaded into memory, an instance of the following structure is appended and initialized to zero. This structure stores information about the page that is decoded from the raw file page. The pParent field points back to the parent page. This allows us to walk up the BTree from any leaf to the root. Care must be taken to unref() the parent page pointer when this page is no longer referenced. The pageDestructor() routine handles that chore. Access to all fields of this structure is controlled by the mutex stored in MemPage.pBt->mutex.
Field Summary | |
---|---|
static byte |
PTF_INTKEY
Page type flags. |
static byte |
PTF_LEAF
|
static byte |
PTF_LEAFDATA
|
static byte |
PTF_ZERODATA
|
Constructor Summary | |
---|---|
SqlJetMemPage()
|
Method Summary | |
---|---|
void |
assemblePage(int nCell,
ISqlJetMemoryPointer[] apCell,
int apCellPos,
int[] aSize,
int aSizePos)
Add a list of cells to a page. |
void |
assertParentIndex(int iIdx,
int iChild)
Page pParent is an internal (non-leaf) tree page. |
void |
clearCell(ISqlJetMemoryPointer pCell)
Free any overflow pages associated with the given Cell. |
java.lang.Object |
clone()
|
void |
copyNodeContent(SqlJetMemPage pTo)
|
void |
decodeFlags(int flagByte)
Decode the flags byte (the first byte of the header) for a page and initialize fields of the MemPage structure accordingly. |
void |
dropCell(int idx,
int sz)
Remove the i-th cell from pPage. |
int |
fillInCell(ISqlJetMemoryPointer pCell,
ISqlJetMemoryPointer pKey,
long nKey,
ISqlJetMemoryPointer pData,
int nData,
int nZero)
Create the byte sequence used to represent a cell on page pPage and write that byte sequence into pCell[]. |
ISqlJetMemoryPointer |
findCell(int i)
Given a btree page and a cell index (0 means the first cell on the page, 1 means the second cell, and so forth) return a pointer to the cell content. |
ISqlJetMemoryPointer |
findOverflowCell(int iCell)
This a more complex version of findCell() that works for pages that do contain overflow cells. |
void |
freePage()
Add a page of the database file to the freelist. |
void |
initPage()
Initialize the auxiliary information for a disk block. |
void |
insertCell(int i,
ISqlJetMemoryPointer pCell,
int sz,
ISqlJetMemoryPointer pTemp,
int iChild)
Insert a new cell on pPage at cell index "i". |
void |
modifyPagePointer(int iFrom,
int iTo,
short s)
Somewhere on pPage, which is guarenteed to be a btree page, not an overflow page, is a pointer to page iFrom. |
org.tmatesoft.sqljet.core.internal.btree.SqlJetBtreeCellInfo |
parseCell(int iCell)
|
void |
ptrmapPutOvfl(int iCell)
If the cell with index iCell on page pPage contains a pointer to an overflow page, insert an entry into the pointer-map for the overflow page. |
void |
ptrmapPutOvflPtr(ISqlJetMemoryPointer pCell)
If the cell pCell, part of page pPage contains a pointer to an overflow page, insert an entry into the pointer-map for the overflow page. |
static void |
releasePage(SqlJetMemPage pPage)
Release a MemPage. |
void |
setChildPtrmaps()
Set the pointer-map entries for all children of page pPage. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte PTF_INTKEY
public static final byte PTF_ZERODATA
public static final byte PTF_LEAFDATA
public static final byte PTF_LEAF
Constructor Detail |
---|
public SqlJetMemPage()
Method Detail |
---|
public void decodeFlags(int flagByte) throws SqlJetException
PTF_ZERODATA
PTF_ZERODATA | PTF_LEAF
PTF_LEAFDATA | PTF_INTKEY
PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF
SqlJetException
public void initPage() throws SqlJetException
SqlJetException
public static void releasePage(SqlJetMemPage pPage) throws SqlJetException
SqlJetException
public void setChildPtrmaps() throws SqlJetException
SqlJetException
public void modifyPagePointer(int iFrom, int iTo, short s) throws SqlJetException
SqlJetExceptionRemove
SqlJetException
public ISqlJetMemoryPointer findCell(int i)
public void ptrmapPutOvflPtr(ISqlJetMemoryPointer pCell) throws SqlJetException
SqlJetException
public org.tmatesoft.sqljet.core.internal.btree.SqlJetBtreeCellInfo parseCell(int iCell)
iCell
- The cell index. First cell is 0
public void freePage() throws SqlJetException
SqlJetException
public void clearCell(ISqlJetMemoryPointer pCell) throws SqlJetException
SqlJetException
public void dropCell(int idx, int sz) throws SqlJetException
idx
- sz
-
SqlJetException
public void insertCell(int i, ISqlJetMemoryPointer pCell, int sz, ISqlJetMemoryPointer pTemp, int iChild) throws SqlJetException
i
- New cell becomes the i-th cell of the pagepCell
- Content of the new cellsz
- Bytes of content in pCellpTemp
- Temp storage space for pCell, if needednSkip
- Do not write the first nSkip bytes of the cell
SqlJetException
public ISqlJetMemoryPointer findOverflowCell(int iCell)
iCell
-
public void assemblePage(int nCell, ISqlJetMemoryPointer[] apCell, int apCellPos, int[] aSize, int aSizePos) throws SqlJetException
nCell
- The number of cells to add to this pageapCell
- Pointers to cell bodiesaSize
- Sizes of the cells
SqlJetException
public void assertParentIndex(int iIdx, int iChild)
iIdx
- iChild
- public int fillInCell(ISqlJetMemoryPointer pCell, ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int nZero) throws SqlJetException
pCell
- Complete text of the cellpKey
- The keynKey
- The keypData
- The datanData
- The datanZero
- Extra zero bytes to append to pData
SqlJetException
public void ptrmapPutOvfl(int iCell) throws SqlJetException
iCell
-
SqlJetException
public void copyNodeContent(SqlJetMemPage pTo) throws SqlJetException
SqlJetException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class SqlJetCloneable
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |