|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tmatesoft.sqljet.core.internal.btree.SqlJetBtreeShared
public class SqlJetBtreeShared
An instance of this object represents a single database file. A single database file can be in use as the same time by two or more database connections. When two or more connections are sharing the same database file, each connection has it own private Btree object for the file and each of those Btrees points to this one BtShared object. BtShared.nRef is the number of connections currently sharing this database file. Fields in this structure are accessed under the BtShared.mutex mutex, except for nRef and pNext which are accessed under the global SQLITE_MUTEX_STATIC_MASTER mutex. The pPager field may not be modified once it is initially set as long as nRef>0. The pSchema field may be set once under BtShared.mutex and thereafter is unchanged as long as nRef>0.
Field Summary | |
---|---|
static byte |
PTRMAP_BTREE
|
static byte |
PTRMAP_FREEPAGE
|
static byte |
PTRMAP_OVERFLOW1
|
static byte |
PTRMAP_OVERFLOW2
|
static byte |
PTRMAP_ROOTPAGE
|
Constructor Summary | |
---|---|
SqlJetBtreeShared()
|
Method Summary | |
---|---|
SqlJetMemPage |
allocatePage(int[] pPgno,
int nearby,
boolean exact)
Allocate a new page from the database file. |
void |
allocateTempSpace()
Make sure pBt->pTmpSpace points to an allocation of MX_CELL_SIZE(pBt) bytes. |
void |
autoVacuumCommit()
This routine is called prior to sqlite3PagerCommit when a transaction is commited for an auto-vacuum database. |
void |
clearDatabasePage(int pgno,
boolean freePageFlag,
int[] pnChange)
Erase the given database page and all its children. |
int |
countWriteCursors()
Return the number of write-cursors open on this handle. |
void |
getOverflowPage(int ovfl,
SqlJetMemPage[] ppPage,
int[] pPgnoNext)
Given the page number of an overflow page in the database (parameter ovfl), this function finds the page number of the next page in the linked list of overflow pages. |
SqlJetMemPage |
getPage(int pgno,
boolean noContent)
Get a page from the pager. |
void |
incrVacuumStep(int nFin,
int iLastPg)
Perform a single step of an incremental-vacuum. |
void |
invalidateAllOverflowCache()
Invalidate the overflow page-list cache for all cursors opened on the shared btree structure pBt. |
int |
MX_CELL_SIZE()
The following value is the maximum cell size assuming a maximum page size give above. |
int |
MX_CELL()
The maximum number of cells on a single page of the database. |
int |
PENDING_BYTE_PAGE()
The database page the PENDING_BYTE occupies. |
int |
PTRMAP_PAGENO(int pgno)
These macros define the location of the pointer-map entry for a database page. |
void |
ptrmapGet(int key,
short[] pEType,
int[] pPgno)
Read an entry from the pointer map. |
void |
ptrmapPut(int key,
short eType,
int parent)
Write an entry into the pointer map. |
void |
ptrmapPutOvflPtr(SqlJetMemPage pPage,
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. |
void |
relocatePage(SqlJetMemPage pDbPage,
short s,
int iPtrPage,
int iFreePage,
boolean isCommit)
Move the open database page pDbPage to location iFreePage in the database. |
boolean |
saveAllCursors(int iRoot,
SqlJetBtreeCursor pExcept)
Save the positions of all cursors except pExcept open on the table with root-page iRoot. |
void |
unlockBtreeIfUnused()
If there are no outstanding cursors and we are not in the middle of a transaction but there is a read lock on the database, then this routine unrefs the first page of the database file which has the effect of releasing the read lock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte PTRMAP_ROOTPAGE
public static final byte PTRMAP_FREEPAGE
public static final byte PTRMAP_OVERFLOW1
public static final byte PTRMAP_OVERFLOW2
public static final byte PTRMAP_BTREE
Constructor Detail |
---|
public SqlJetBtreeShared()
Method Detail |
---|
public int PENDING_BYTE_PAGE()
public int MX_CELL_SIZE()
public int MX_CELL()
public int PTRMAP_PAGENO(int pgno)
public void invalidateAllOverflowCache()
public void ptrmapPut(int key, short eType, int parent) throws SqlJetException
SqlJetException
public void ptrmapGet(int key, short[] pEType, int[] pPgno) throws SqlJetException
SqlJetException
public SqlJetMemPage getPage(int pgno, boolean noContent) throws SqlJetException
pgno
- Number of the page to fetchnoContent
- Do not load page content if true
SqlJetException
public SqlJetMemPage allocatePage(int[] pPgno, int nearby, boolean exact) throws SqlJetException
SqlJetException
public void relocatePage(SqlJetMemPage pDbPage, short s, int iPtrPage, int iFreePage, boolean isCommit) throws SqlJetException
pDbPage
- Open page to moves
- Pointer map 'type' entry for pDbPageiPtrPage
- Pointer map 'page-no' entry for pDbPageiFreePage
- The location to move pDbPage toisCommit
-
SqlJetException
public void incrVacuumStep(int nFin, int iLastPg) throws SqlJetException
SqlJetException
public void autoVacuumCommit() throws SqlJetException
SqlJetException
public void unlockBtreeIfUnused() throws SqlJetException
SqlJetException
public boolean saveAllCursors(int iRoot, SqlJetBtreeCursor pExcept) throws SqlJetException
i
- j
-
SqlJetException
public int countWriteCursors()
public void clearDatabasePage(int pgno, boolean freePageFlag, int[] pnChange) throws SqlJetException
pgno
- freePageFlag
- Page number to clearpnChange
- Deallocate page if true
SqlJetException
public void getOverflowPage(int ovfl, SqlJetMemPage[] ppPage, int[] pPgnoNext) throws SqlJetException
ovfl
- Overflow pageppPage
- OUT: MemPage handlepPgnoNext
- OUT: Next overflow page number
SqlJetException
public void allocateTempSpace()
public void ptrmapPutOvflPtr(SqlJetMemPage pPage, ISqlJetMemoryPointer pCell) throws SqlJetException
SqlJetException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |