com.lucidera.lcs
Class LcsDataServer

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 com.lucidera.lcs.LcsDataServer
All Implemented Interfaces:
FarragoMedDataServer, FarragoMedLocalDataServer, FarragoAllocation, ClosableAllocation

 class LcsDataServer
extends MedAbstractFennelDataServer

LcsDataServer implements the FarragoMedDataServer interface for LucidDB column-store data.

Version:
$Id: //open/dev/farrago/src/com/lucidera/lcs/LcsDataServer.java#31 $
Author:
John V. Sichi

Field Summary
 
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
LcsDataServer(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.
private  void createSystemIndex(String namePrefix, CwmTable table, CwmColumn col, boolean clustered, boolean sorted, boolean unique)
          Creates an index with an internally generated name
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.
private  void prepareClusteredIndexCmd(LcsIndexGuide indexGuide, FemIndexCmd cmd, FemLocalIndex index)
           
protected  void prepareIndexCmd(FemIndexCmd cmd, FemLocalIndex index)
          Prepares an index command based on the catalog definition of the index.
private  void prepareUnclusteredIndexCmd(LcsIndexGuide indexGuide, FemIndexCmd cmd, FemLocalIndex index)
           
 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, boolean creation)
          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, registerRelMetadataProviders, 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
registerRelMetadataProviders, releaseResources, setLoopbackDataSource
 
Methods inherited from interface org.eigenbase.util.ClosableAllocation
closeAllocation
 

Constructor Detail

LcsDataServer

LcsDataServer(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,
                                    boolean creation)
                             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
creation - true if the table being validated is being newly created
Throws:
SQLException

createSystemIndex

private void createSystemIndex(String namePrefix,
                               CwmTable table,
                               CwmColumn col,
                               boolean clustered,
                               boolean sorted,
                               boolean unique)
Creates an index with an internally generated name

Parameters:
namePrefix - the initial prefix of the internal name
table - table that the index will be created on
col - column associated with the index; null if the index is not associated with any column
clustered - whether the index is clustered
sorted - whether the index maintains its data in sort order
unique - whether the data in the index is unique

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

prepareClusteredIndexCmd

private void prepareClusteredIndexCmd(LcsIndexGuide indexGuide,
                                      FemIndexCmd cmd,
                                      FemLocalIndex index)

prepareUnclusteredIndexCmd

private void prepareUnclusteredIndexCmd(LcsIndexGuide indexGuide,
                                        FemIndexCmd cmd,
                                        FemLocalIndex 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

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