|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.access.heap.HeapPostCommit
class HeapPostCommit
The HeapPostCommit class implements the Serviceable protocol. In it's role as a Serviceable object, it stores the state necessary to find a page in a heap that may have committed delete's to reclaim. It looks up the page described, and reclaims space in the conglomerate. It first trys to clean up any deleted commits on the page. It will then deallocate the page if no rows remain on the page. All work is done while holding the latch on the page, and locks are never "waited" on while holding this latch. This implementation uses record level locking to reclaim the space. For the protocols to work correctly all other heap methods must be prepared for a record or a page to "disappear" if they don't hold a latch and/or a lock. An example of the problem case is a scan which does not hold locks on it's current position (group scan works this way), which is positioned on a row deleted by another xact, it must be prepared to continue the scan after getting an error if the current page/row disapppears.
Field Summary | |
---|---|
private AccessFactory |
access_factory
Fields of the class |
private Heap |
heap
|
private long |
page_number
|
Fields inherited from interface org.apache.derby.iapi.services.daemon.Serviceable |
---|
DONE, REQUEUE |
Constructor Summary | |
---|---|
HeapPostCommit(AccessFactory access_factory,
Heap heap,
long input_page_number)
Constructors for This class: |
Method Summary | |
---|---|
int |
performWork(ContextManager contextMgr)
perform the work described in the postcommit work. |
private void |
purgeCommittedDeletes(HeapController heap_control,
long pageno)
Reclaim space taken up by committed deleted rows. |
boolean |
serviceASAP()
The urgency of this post commit work. |
boolean |
serviceImmediately()
If this work should be done immediately on the user thread then return true. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private AccessFactory access_factory
private Heap heap
private long page_number
Constructor Detail |
---|
HeapPostCommit(AccessFactory access_factory, Heap heap, long input_page_number)
Method Detail |
---|
private final void purgeCommittedDeletes(HeapController heap_control, long pageno) throws StandardException
This routine assumes it has been called by an internal transaction which has performed no work so far, and that it has an exclusive intent table lock. It will attempt obtain exclusive row locks on deleted rows, where successful those rows can be reclaimed as they must be "committed deleted" rows.
This routine will latch the page and hold the latch due to interface requirement from Page.purgeAtSlot.
heap_control
- The heap, already opened.pageno
- number of page to look for committed deletes.
StandardException
- Standard exception policy.Page.purgeAtSlot(int, int, boolean)
public boolean serviceASAP()
This determines where this Serviceable is put in the post commit queue. Post commit work in the heap can be safely delayed until there is not user work to do.
serviceASAP
in interface Serviceable
public boolean serviceImmediately()
Serviceable
serviceImmediately
in interface Serviceable
public int performWork(ContextManager contextMgr) throws StandardException
In this implementation the only work that can be executed by this post commit processor is this class itself.
performWork
in interface Serviceable
contextMgr
- the context manager started by the post commit daemon
StandardException
- Standard exception policy.
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |