net.sf.farrago.namespace.impl
Class MedAbstractFennelDataServer

java.lang.Object
  extended by net.sf.farrago.plugin.FarragoAbstractPluginBase
      extended by net.sf.farrago.namespace.impl.MedAbstractBase
          extended by net.sf.farrago.namespace.impl.MedAbstractDataServer
              extended by net.sf.farrago.namespace.impl.MedAbstractLocalDataServer
                  extended by net.sf.farrago.namespace.impl.MedAbstractFennelDataServer
All Implemented Interfaces:
FarragoMedDataServer, FarragoMedLocalDataServer, FarragoAllocation, ClosableAllocation
Direct Known Subclasses:
FtrsDataServer, LcsDataServer

public abstract class MedAbstractFennelDataServer
extends MedAbstractLocalDataServer

MedAbstractFennelDataServer refines MedAbstractLocalDataServer with abstract support for using Fennel's btree indexing.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/impl/MedAbstractFennelDataServer.java#15 $
Author:
John V. Sichi

Field Summary
protected  FarragoRepos repos
           
 
Fields inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase
BOOLEAN_CHOICES_DEFAULT_FALSE, BOOLEAN_CHOICES_DEFAULT_TRUE, EMPTY_DRIVER_PROPERTIES
 
Fields inherited from interface net.sf.farrago.namespace.FarragoMedDataServer
PROP_SERVER_NAME, PROP_SERVER_TYPE, PROP_SERVER_VERSION
 
Constructor Summary
protected MedAbstractFennelDataServer(String serverMofId, Properties props, FarragoRepos repos)
           
 
Method Summary
 FarragoMedLocalIndexStats computeIndexStats(FemLocalIndex index, long rootPageId, boolean estimate, FennelTxnContext txnContext)
          Verifies an index and returns its page count.
 long createIndex(FemLocalIndex index, FennelTxnContext txnContext)
          Creates an index.
 void dropIndex(FemLocalIndex index, long rootPageId, boolean truncate, FennelTxnContext txnContext)
          Drops or truncates an index.
protected abstract  boolean getIncludeTuples(FemLocalIndex index)
          Whether or not to include tuples in page count statistics
static long getIndexSegmentId(FemLocalIndex index)
          Gets the SegmentId of the segment storing an index.
 Object getRuntimeSupport(Object param)
          Gets an object needed for runtime support.
private  void initIndexCmd(FemIndexCmd cmd, FemLocalIndex index, FennelTxnContext txnContext)
           
protected abstract  void prepareIndexCmd(FemIndexCmd cmd, FemLocalIndex index)
          Prepares an index command based on the catalog definition of the index.
 void versionIndexRoot(Long oldRoot, Long newRoot, FennelTxnContext txnContext)
          Versions the root page of an index
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractLocalDataServer
getFennelDbHandle, getNameDirectory, setFennelDbHandle, supportsAlterTableAddColumn, validateTableDefinition, validateTableDefinition
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractDataServer
closeAllocation, getLoopbackDataSource, getProperties, getServerMofId, registerRelMetadataProviders, registerRules, releaseResources, setLoopbackDataSource
 
Methods inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase
getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getShortProperty, requireProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.farrago.namespace.FarragoMedLocalDataServer
constructIndexBuildPlan
 
Methods inherited from interface net.sf.farrago.namespace.FarragoMedDataServer
newColumnSet, registerRelMetadataProviders, registerRules, releaseResources, setLoopbackDataSource
 
Methods inherited from interface org.eigenbase.util.ClosableAllocation
closeAllocation
 

Field Detail

repos

protected FarragoRepos repos
Constructor Detail

MedAbstractFennelDataServer

protected MedAbstractFennelDataServer(String serverMofId,
                                      Properties props,
                                      FarragoRepos repos)
Method Detail

getRuntimeSupport

public Object getRuntimeSupport(Object param)
                         throws SQLException
Description copied from interface: FarragoMedDataServer
Gets an object needed for runtime support. Typically, this will be called from code generated by this server. The meaning of this is entirely dependent on the server implementation. If the returned object implements FarragoAllocation, its closeAllocation() method will be called automatically as soon as it is no longer needed.

Specified by:
getRuntimeSupport in interface FarragoMedDataServer
Overrides:
getRuntimeSupport in class MedAbstractDataServer
Parameters:
param - parameter supplied at runtime
Returns:
support object
Throws:
SQLException

createIndex

public long createIndex(FemLocalIndex index,
                        FennelTxnContext txnContext)
Description copied from interface: FarragoMedLocalDataServer
Creates an index.

Parameters:
index - definition of the index to create
txnContext - Fennel txn context
Returns:
root PageId of index

dropIndex

public void dropIndex(FemLocalIndex index,
                      long rootPageId,
                      boolean truncate,
                      FennelTxnContext txnContext)
Description copied from interface: FarragoMedLocalDataServer
Drops or truncates an index.

Parameters:
index - definition of the index to drop
rootPageId - root PageId of index
truncate - if true, only truncate storage; if false, drop storage entirely
txnContext - Fennel txn context

computeIndexStats

public FarragoMedLocalIndexStats computeIndexStats(FemLocalIndex index,
                                                   long rootPageId,
                                                   boolean estimate,
                                                   FennelTxnContext txnContext)
Description copied from interface: FarragoMedLocalDataServer
Verifies an index and returns its page count.

Parameters:
index - definition of the index to verify
rootPageId - root PageId of index
estimate - whether to estimate statistics for a quicker result (and at the cost of no unique key count)
txnContext - Fennel txn context
Returns:
index statistics for the specified index

initIndexCmd

private void initIndexCmd(FemIndexCmd cmd,
                          FemLocalIndex index,
                          FennelTxnContext txnContext)

prepareIndexCmd

protected abstract void prepareIndexCmd(FemIndexCmd cmd,
                                        FemLocalIndex index)
Prepares an index command based on the catalog definition of the index. The parameterization details of command preparation are subclass-dependent.

Parameters:
cmd - command to be initialized
index - catalog definition of index

getIncludeTuples

protected abstract boolean getIncludeTuples(FemLocalIndex index)
Whether or not to include tuples in page count statistics


getIndexSegmentId

public static long getIndexSegmentId(FemLocalIndex index)
Gets the SegmentId of the segment storing an index.

Parameters:
index - the index of interest
Returns:
containing SegmentId

versionIndexRoot

public void versionIndexRoot(Long oldRoot,
                             Long newRoot,
                             FennelTxnContext txnContext)
Description copied from interface: FarragoMedLocalDataServer
Versions the root page of an index

Parameters:
oldRoot - original root page
newRoot - new versioned, root page
txnContext - Fennel txn context