net.sf.farrago.namespace.ftrs
Class FtrsDataServer

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
                      extended by net.sf.farrago.namespace.ftrs.FtrsDataServer
All Implemented Interfaces:
FarragoMedDataServer, FarragoMedLocalDataServer, FarragoAllocation, ClosableAllocation

 class FtrsDataServer
extends MedAbstractFennelDataServer

FtrsDataServer implements the FarragoMedDataServer interface for FTRS data.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/ftrs/FtrsDataServer.java#31 $
Author:
John V. Sichi

Nested Class Summary
private static class FtrsDataServer.FtrsColumnMetadata
           
static class FtrsDataServer.FtrsRelMetadataProvider
           
 
Field Summary
private  FarragoTypeFactory indexTypeFactory
           
 
Fields inherited from class net.sf.farrago.namespace.impl.MedAbstractFennelDataServer
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
FtrsDataServer(String serverMofId, Properties props, FarragoRepos repos)
           
 
Method Summary
 RelNode constructIndexBuildPlan(RelOptTable table, FemLocalIndex index, RelOptCluster cluster)
          Creates a plan for loading existing rows of a table into an index.
protected  boolean getIncludeTuples(FemLocalIndex index)
          Whether or not to include tuples in page count statistics
 FarragoMedColumnSet newColumnSet(String[] localName, Properties tableProps, FarragoTypeFactory typeFactory, RelDataType rowType, Map<String,Properties> columnPropMap)
          Creates an instance of a FarragoMedColumnSet corresponding to row data identified by properties rather than container name.
protected  void prepareIndexCmd(FemIndexCmd cmd, FemLocalIndex index)
          Prepares an index command based on the catalog definition of the index.
 void registerRelMetadataProviders(ChainedRelMetadataProvider chain)
          Gives this wrapper a chance to register one or more RelMetadataProviders in the chain which will be used to answer relational expression metadata queries during optimization.
 void registerRules(RelOptPlanner planner)
          Gives this wrapper a chance to register any special optimization rules.
 boolean supportsAlterTableAddColumn()
          Checks whether ALTER TABLE ADD COLUMN is implemented for tables stored by this local data server.
 void validateTableDefinition(FemLocalTable table, FemLocalIndex generatedPrimaryKeyIndex)
          Validates the definition of a table being created.
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractFennelDataServer
computeIndexStats, createIndex, dropIndex, getIndexSegmentId, getRuntimeSupport, versionIndexRoot
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractLocalDataServer
getFennelDbHandle, getNameDirectory, setFennelDbHandle, validateTableDefinition
 
Methods inherited from class net.sf.farrago.namespace.impl.MedAbstractDataServer
closeAllocation, getLoopbackDataSource, getProperties, getServerMofId, 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.FarragoMedDataServer
releaseResources, setLoopbackDataSource
 
Methods inherited from interface org.eigenbase.util.ClosableAllocation
closeAllocation
 

Field Detail

indexTypeFactory

private FarragoTypeFactory indexTypeFactory
Constructor Detail

FtrsDataServer

FtrsDataServer(String serverMofId,
               Properties props,
               FarragoRepos repos)
Method Detail

newColumnSet

public FarragoMedColumnSet newColumnSet(String[] localName,
                                        Properties tableProps,
                                        FarragoTypeFactory typeFactory,
                                        RelDataType rowType,
                                        Map<String,Properties> columnPropMap)
                                 throws SQLException
Description copied from interface: FarragoMedDataServer
Creates an instance of a FarragoMedColumnSet corresponding to row data identified by properties rather than container name. This supports the SQL/MED CREATE FOREIGN TABLE statement. As much validation as possible should be performed, including accessing representative data.

Parameters:
localName - the qualified name to assign to the column set within Farrago; this should NOT be used for finding the actual data, since it can be set arbitrarily by the caller; instead, it should be used to implement the RelOptTable.getQualifiedName() method, and can be useful for correlation during debugging
tableProps - properties to use for data location and access
typeFactory - FarragoTypeFactory to use for defining types
rowType - type to impose on the rows of this column set (including column names and types), or null to infer row type; if this is non-null, it must be saved for use by the getRowType() returned from FarragoMedColumnSet
columnPropMap - map from column name to column-specific Properties; this is optional and may only be specified when rowType is also specified (the field names in rowType are used as the keys for columnPropMap)
Returns:
new FarragoMedColumnSet
Throws:
SQLException - if data access is unsuccessful

registerRules

public void registerRules(RelOptPlanner planner)
Description copied from interface: FarragoMedDataServer
Gives this wrapper a chance to register any special optimization rules. This method may be called more than once, each time with a different planner instance.

Specified by:
registerRules in interface FarragoMedDataServer
Overrides:
registerRules in class MedAbstractDataServer
Parameters:
planner - the planner in which the rules should be registered

validateTableDefinition

public void validateTableDefinition(FemLocalTable table,
                                    FemLocalIndex generatedPrimaryKeyIndex)
                             throws SQLException
Description copied from interface: FarragoMedLocalDataServer
Validates the definition of a table being created. May have side-effects such as creating additional system-maintained indexes.

Specified by:
validateTableDefinition in interface FarragoMedLocalDataServer
Overrides:
validateTableDefinition in class MedAbstractLocalDataServer
Parameters:
table - definition of the table being created
generatedPrimaryKeyIndex - if non-null, a reference to an index generated by the system to enforce the primary key
Throws:
SQLException

constructIndexBuildPlan

public RelNode constructIndexBuildPlan(RelOptTable table,
                                       FemLocalIndex index,
                                       RelOptCluster cluster)
Description copied from interface: FarragoMedLocalDataServer
Creates a plan for loading existing rows of a table into an index. Typically, the topmost node of this plan will be a FarragoIndexBuilderRel, and this plugin will supply a rule which transforms that into a corresponding physical rel for writing to the index. Where possible, the returned plan should consist of logical rels, increasing optimization potential.

Parameters:
table - the optimizer representation for the indexed table
index - the index to be loaded
cluster - container for newly created relational expressions
Returns:
plan which will be used as input to optimization

prepareIndexCmd

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

Specified by:
prepareIndexCmd in class MedAbstractFennelDataServer
Parameters:
cmd - command to be initialized
index - catalog definition of index

getIncludeTuples

protected boolean getIncludeTuples(FemLocalIndex index)
Description copied from class: MedAbstractFennelDataServer
Whether or not to include tuples in page count statistics

Specified by:
getIncludeTuples in class MedAbstractFennelDataServer

registerRelMetadataProviders

public void registerRelMetadataProviders(ChainedRelMetadataProvider chain)
Description copied from interface: FarragoMedDataServer
Gives this wrapper a chance to register one or more RelMetadataProviders in the chain which will be used to answer relational expression metadata queries during optimization. Wrappers which define their own relational expressions will generally need to supply corresponding metadata providers.

Specified by:
registerRelMetadataProviders in interface FarragoMedDataServer
Overrides:
registerRelMetadataProviders in class MedAbstractDataServer
Parameters:
chain - receives wrappers's custom providers, if any

supportsAlterTableAddColumn

public boolean supportsAlterTableAddColumn()
Description copied from interface: FarragoMedLocalDataServer
Checks whether ALTER TABLE ADD COLUMN is implemented for tables stored by this local data server.

Specified by:
supportsAlterTableAddColumn in interface FarragoMedLocalDataServer
Overrides:
supportsAlterTableAddColumn in class MedAbstractLocalDataServer
Returns:
whether ALTER TABLE ADD COLUMN can be executed