org.apache.derby.impl.store.access.btree
Class BTreeRowPosition

java.lang.Object
  extended by org.apache.derby.impl.store.access.conglomerate.RowPosition
      extended by org.apache.derby.impl.store.access.btree.BTreeRowPosition

public class BTreeRowPosition
extends RowPosition


Field Summary
 LeafControlRow current_leaf
           
 RowLocation current_lock_row_loc
           
 DataValueDescriptor[] current_lock_template
           
 DataValueDescriptor[] current_positionKey
          Fields of the class
protected  LeafControlRow next_leaf
           
private  BTreeScan parent
          The scan that owns this position object.
private  DataValueDescriptor[] positionKey_template
          Cached template for saving this position by key.
private  FetchDescriptor savedFetchDescriptor
          Cached fetch descriptor that can be used to fetch the key columns that are not already fetched by the scan.
(package private)  long versionWhenSaved
          The version number of the leaf page when this position was saved by key.
 
Fields inherited from class org.apache.derby.impl.store.access.conglomerate.RowPosition
current_page, current_pageno, current_rh, current_rh_qualified, current_slot
 
Constructor Summary
BTreeRowPosition(BTreeScan parent)
          Constructors for This class:
 
Method Summary
(package private)  FetchDescriptor getFetchDescriptorForSaveKey(int[] vcols, int fullLength)
          Get a fetch descriptor that can be used to fetch the missing columns in a partial key.
(package private)  DataValueDescriptor[] getKeyTemplate()
          Get a template into which the position key can be copied.
 void init()
          Public Methods of This class:
 void saveMeAndReleasePage()
          Save this position by key and release the latch on the current leaf.
 java.lang.String toString()
           
 void unlatch()
           
 
Methods inherited from class org.apache.derby.impl.store.access.conglomerate.RowPosition
positionAtNextSlot, positionAtPrevSlot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

current_positionKey

public DataValueDescriptor[] current_positionKey
Fields of the class


current_leaf

public LeafControlRow current_leaf

next_leaf

protected LeafControlRow next_leaf

current_lock_template

public DataValueDescriptor[] current_lock_template

current_lock_row_loc

public RowLocation current_lock_row_loc

parent

private final BTreeScan parent
The scan that owns this position object.


versionWhenSaved

long versionWhenSaved
The version number of the leaf page when this position was saved by key. Only valid if current_positionKey is non-null. This value is used to decide whether repositioning should be performed by using the key, or if RowPosition.current_rh could be used directly.


positionKey_template

private DataValueDescriptor[] positionKey_template
Cached template for saving this position by key.


savedFetchDescriptor

private FetchDescriptor savedFetchDescriptor
Cached fetch descriptor that can be used to fetch the key columns that are not already fetched by the scan. The fetch descriptor is used when this position is about to be saved by its full key.

Constructor Detail

BTreeRowPosition

public BTreeRowPosition(BTreeScan parent)
Constructors for This class:

Method Detail

init

public void init()
Public Methods of This class:

Overrides:
init in class RowPosition

unlatch

public final void unlatch()
Overrides:
unlatch in class RowPosition

saveMeAndReleasePage

public void saveMeAndReleasePage()
                          throws StandardException
Save this position by key and release the latch on the current leaf.

Throws:
StandardException - if an error occurs while saving the position
See Also:
BTreeScan.savePositionAndReleasePage()

getKeyTemplate

DataValueDescriptor[] getKeyTemplate()
                               throws StandardException
Get a template into which the position key can be copied. The value is cached, so two calls to this method on the same object will return the same object.

Returns:
an array into which the position key can be copied
Throws:
StandardException - if an error occurs while allocating the template array

getFetchDescriptorForSaveKey

FetchDescriptor getFetchDescriptorForSaveKey(int[] vcols,
                                             int fullLength)
Get a fetch descriptor that can be used to fetch the missing columns in a partial key. The fetch descriptor is only created on the first call to this method. The returned descriptor will be cached, so subsequent calls will return the same descriptor and the arguments to this method should be the same between invokations.

Parameters:
vcols - an array which tells which columns the partial key contains (valid columns have non-zero values in the array)
fullLength - the length of the full key to create a fetch descriptor for (may be greater than vcols.length)
Returns:
a fetch descriptor

toString

public final java.lang.String toString()
Overrides:
toString in class RowPosition

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.