Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.store.raw.data
Class ReclaimSpace  view ReclaimSpace download ReclaimSpace.java

java.lang.Object
  extended byorg.apache.derby.impl.store.raw.data.ReclaimSpace
All Implemented Interfaces:
org.apache.derby.iapi.services.daemon.Serviceable

public final class ReclaimSpace
extends java.lang.Object
implements org.apache.derby.iapi.services.daemon.Serviceable

Post commit work to reclaim some space from the raw store. This is a wrapper class for the real serviceable class who wraps this on top of itself so different things can be identified.


Field Summary
private  int attempts
           
static int COLUMN_CHAIN
           
private  int columnId
           
private  long columnPageId
           
private  int columnRecordId
           
static int CONTAINER
           
private  org.apache.derby.iapi.store.raw.ContainerKey containerId
           
private  org.apache.derby.iapi.store.raw.RecordHandle headRowHandle
           
static int PAGE
           
private  org.apache.derby.iapi.store.raw.PageKey pageId
           
private  org.apache.derby.iapi.store.raw.data.DataFactory processor
           
private  int reclaim
           
static int ROW_RESERVE
           
private  boolean serviceASAP
           
private  org.apache.derby.iapi.store.raw.PageTimeStamp timeStamp
           
 
Fields inherited from interface org.apache.derby.iapi.services.daemon.Serviceable
DONE, REQUEUE
 
Constructor Summary
ReclaimSpace(int reclaim, org.apache.derby.iapi.store.raw.ContainerKey containerId, org.apache.derby.iapi.store.raw.data.DataFactory processor, boolean serviceASAP)
           
ReclaimSpace(int reclaim, org.apache.derby.iapi.store.raw.PageKey pageId, org.apache.derby.iapi.store.raw.data.DataFactory processor, boolean serviceASAP)
           
ReclaimSpace(int reclaim, org.apache.derby.iapi.store.raw.RecordHandle headRowHandle, org.apache.derby.iapi.store.raw.data.DataFactory processor, boolean serviceASAP)
           
ReclaimSpace(int reclaim, org.apache.derby.iapi.store.raw.RecordHandle headRowHandle, int columnId, long ovPageId, int ovRecordId, org.apache.derby.iapi.store.raw.PageTimeStamp timeStamp, org.apache.derby.iapi.store.raw.data.DataFactory processor, boolean serviceASAP)
           
 
Method Summary
 int getColumnId()
           
 long getColumnPageId()
           
 int getColumnRecordId()
           
 org.apache.derby.iapi.store.raw.ContainerKey getContainerId()
           
 org.apache.derby.iapi.store.raw.RecordHandle getHeadRowHandle()
           
 org.apache.derby.iapi.store.raw.PageKey getPageId()
           
 org.apache.derby.iapi.store.raw.PageTimeStamp getPageTimeStamp()
           
 int incrAttempts()
           
private  void initContainerInfo(org.apache.derby.iapi.store.raw.ContainerKey containerId, int reclaim, org.apache.derby.iapi.store.raw.data.DataFactory processor, boolean serviceASAP)
           
 int performWork(org.apache.derby.iapi.services.context.ContextManager context)
          Do whatever it is that you want the daemon to do for you.
 int reclaimWhat()
           
 boolean serviceASAP()
          If this work should be done as soon as possible, then return true.
 boolean serviceImmediately()
          If this work should be done immediately on the user thread then return true.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serviceASAP

private boolean serviceASAP

containerId

private org.apache.derby.iapi.store.raw.ContainerKey containerId

pageId

private org.apache.derby.iapi.store.raw.PageKey pageId

headRowHandle

private org.apache.derby.iapi.store.raw.RecordHandle headRowHandle

columnId

private int columnId

columnPageId

private long columnPageId

columnRecordId

private int columnRecordId

timeStamp

private org.apache.derby.iapi.store.raw.PageTimeStamp timeStamp

attempts

private int attempts

processor

private org.apache.derby.iapi.store.raw.data.DataFactory processor

reclaim

private int reclaim

CONTAINER

public static final int CONTAINER
See Also:
Constant Field Values

PAGE

public static final int PAGE
See Also:
Constant Field Values

ROW_RESERVE

public static final int ROW_RESERVE
See Also:
Constant Field Values

COLUMN_CHAIN

public static final int COLUMN_CHAIN
See Also:
Constant Field Values
Constructor Detail

ReclaimSpace

public ReclaimSpace(int reclaim,
                    org.apache.derby.iapi.store.raw.ContainerKey containerId,
                    org.apache.derby.iapi.store.raw.data.DataFactory processor,
                    boolean serviceASAP)

ReclaimSpace

public ReclaimSpace(int reclaim,
                    org.apache.derby.iapi.store.raw.PageKey pageId,
                    org.apache.derby.iapi.store.raw.data.DataFactory processor,
                    boolean serviceASAP)

ReclaimSpace

public ReclaimSpace(int reclaim,
                    org.apache.derby.iapi.store.raw.RecordHandle headRowHandle,
                    org.apache.derby.iapi.store.raw.data.DataFactory processor,
                    boolean serviceASAP)

ReclaimSpace

public ReclaimSpace(int reclaim,
                    org.apache.derby.iapi.store.raw.RecordHandle headRowHandle,
                    int columnId,
                    long ovPageId,
                    int ovRecordId,
                    org.apache.derby.iapi.store.raw.PageTimeStamp timeStamp,
                    org.apache.derby.iapi.store.raw.data.DataFactory processor,
                    boolean serviceASAP)
Method Detail

initContainerInfo

private void initContainerInfo(org.apache.derby.iapi.store.raw.ContainerKey containerId,
                               int reclaim,
                               org.apache.derby.iapi.store.raw.data.DataFactory processor,
                               boolean serviceASAP)

serviceASAP

public boolean serviceASAP()
Description copied from interface: org.apache.derby.iapi.services.daemon.Serviceable
If this work should be done as soon as possible, then return true. If it doesn't make any difference if it is done sooner rather than later, then return false. The difference is whether or not the daemon service will be notified to work on this when this work is enqueued or subscribed, in case the serviceable work is put together but not sent to the daemon service directly, like in post commit processing

MT - MT safe

Specified by:
serviceASAP in interface org.apache.derby.iapi.services.daemon.Serviceable

performWork

public int performWork(org.apache.derby.iapi.services.context.ContextManager context)
                throws org.apache.derby.iapi.error.StandardException
Description copied from interface: org.apache.derby.iapi.services.daemon.Serviceable
Do whatever it is that you want the daemon to do for you. There may be multiple daemon objects on different thread calling performWork at the same time. The DaemonService will always call performWork with a context manager set up. the DaemonService will clean up the context if an exception is thrown. However, it is up to performWork to manage its own transaction. If you start a transaction in performWork, you must commit or abort it at the end. You may leave the transaction open so that other serviceable may use the transaction and context without starting a new one. On the same token, there may already be an opened transaction on the context. Serviceable performWork should always check the state of the context before use. A Serviceable object should be well behaved while it is performing the daemon work, i.e., it should not take too many resources or hog the CPU for too long or deadlock with anyone else.

Specified by:
performWork in interface org.apache.derby.iapi.services.daemon.Serviceable

serviceImmediately

public boolean serviceImmediately()
Description copied from interface: org.apache.derby.iapi.services.daemon.Serviceable
If this work should be done immediately on the user thread then return true. If it doesn't make any difference if this work is done on a the user thread immediately or if it is performed by another thread asynchronously later, then return false.

Specified by:
serviceImmediately in interface org.apache.derby.iapi.services.daemon.Serviceable

getContainerId

public final org.apache.derby.iapi.store.raw.ContainerKey getContainerId()

getPageId

public final org.apache.derby.iapi.store.raw.PageKey getPageId()

getHeadRowHandle

public final org.apache.derby.iapi.store.raw.RecordHandle getHeadRowHandle()

getColumnId

public final int getColumnId()

getColumnPageId

public final long getColumnPageId()

getColumnRecordId

public final int getColumnRecordId()

getPageTimeStamp

public final org.apache.derby.iapi.store.raw.PageTimeStamp getPageTimeStamp()

reclaimWhat

public final int reclaimWhat()

incrAttempts

public final int incrAttempts()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).