|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.defimpl.FarragoDefaultSessionPersonality
public class FarragoDefaultSessionPersonality
FarragoDefaultSessionPersonality is a default implementation of the FarragoSessionPersonality
interface.
Nested Class Summary | |
---|---|
private class |
FarragoDefaultSessionPersonality.ParamDesc
ParamDesc represents a session parameter descriptor |
class |
FarragoDefaultSessionPersonality.ParamValidator
ParamValidator is a basic session parameter validator |
Field Summary | |
---|---|
static String |
CACHE_STATEMENTS
Whether statement caching is enabled for a session |
static String |
CACHE_STATEMENTS_DEFAULT
|
protected FarragoDatabase |
database
|
static String |
DEGREE_OF_PARALLELISM
Degree of parallelism to use for parallel executor; a value of 1 (the default) causes the default non-parallel executor to be used. |
static String |
DEGREE_OF_PARALLELISM_DEFAULT
|
static String |
LABEL
The label for the current session |
static String |
LABEL_DEFAULT
|
protected FarragoDefaultSessionPersonality.ParamValidator |
paramValidator
|
static String |
REDUCE_NON_CORRELATED_SUBQUERIES
Whether non-correlated subqueries should be converted to constants |
static String |
REDUCE_NON_CORRELATED_SUBQUERIES_FARRAGO_DEFAULT
|
static String |
SQUEEZE_JDBC_NUMERIC
Numeric data from external data sources may have a greater precision than Farrago. |
static String |
SQUEEZE_JDBC_NUMERIC_DEFAULT
|
static String |
VALIDATE_DDL_ON_PREPARE
Whether DDL validation should be done at prepare time |
static String |
VALIDATE_DDL_ON_PREPARE_DEFAULT
|
Constructor Summary | |
---|---|
protected |
FarragoDefaultSessionPersonality(FarragoDbSession session)
|
Method Summary | ||
---|---|---|
protected boolean |
addRowCount(ResultSet resultSet,
List<Long> rowCounts)
|
|
FarragoSessionVariables |
createInheritedSessionVariables(FarragoSessionVariables variables)
Creates a set of session variables for use in a cloned session. |
|
void |
defineDdlHandlers(FarragoSessionDdlValidator ddlValidator,
List<DdlHandler> handlerList)
See FarragoSessionModelExtension.defineDdlHandlers(net.sf.farrago.session.FarragoSessionDdlValidator, java.util.List . |
|
void |
definePlannerListeners(FarragoSessionPlanner planner)
Defines listeners for events which occur during planning. |
|
void |
definePrivileges(FarragoSessionPrivilegeMap map)
Defines privileges allowed on various object types. |
|
private void |
defineTypePrivileges(FarragoSessionPrivilegeMap map,
RefClass refClass,
PrivilegedAction[] actions)
|
|
String |
getDefaultLocalDataServerName(FarragoSessionStmtValidator stmtValidator)
Gets the name of the local data server to use for tables when none is specified by CREATE TABLE. |
|
OJRexImplementorTable |
getOJRexImplementorTable(FarragoSessionPreparingStmt preparingStmt)
Gets the implementation table to use for compiling a statement that uses a Java calculator. |
|
void |
getRowCounts(ResultSet resultSet,
List<Long> rowCounts,
TableModificationRelBase.Operation tableModOp)
Gives this personality the opportunity to retrieve rowcount information returned by a DML operation. |
|
Class |
getRuntimeContextClass(FarragoSessionPreparingStmt preparingStmt)
Determines the class to use for runtime context. |
|
SqlOperatorTable |
getSqlOperatorTable(FarragoSessionPreparingStmt preparingStmt)
Gets the SQL operator table to use for validating a statement. |
|
protected void |
initPreparingStmt(FarragoPreparingStmt stmt)
|
|
boolean |
isAlterTableAddColumnIncremental()
Tests whether this session personality implements ALTER TABLE ADD COLUMN in an incremental fashion (only adding on the new column as opposed to reformatting existing rows). |
|
boolean |
isJavaUdxRestartable()
Returns whether a JavaUDX is implemented as a restartable data source. |
|
boolean |
isSupportedType(SqlTypeName type)
Returns whether a type is valid in this database. |
|
void |
loadDefaultSessionVariables(FarragoSessionVariables variables)
Loads variables from the session personality into a session variables object. |
|
|
newComponentImpl(Class<C> componentInterface)
Gets the component associated with the given Class object from the personality. |
|
FarragoSessionDdlValidator |
newDdlValidator(FarragoSessionStmtValidator stmtValidator)
Creates a new validator for DDL commands. |
|
JmiQueryProcessor |
newJmiQueryProcessor(String language)
Creates a new processor for JMI queries. |
|
FarragoSessionParser |
newParser(FarragoSession session)
Creates a new SQL parser. |
|
FarragoSessionPlanner |
newPlanner(FarragoSessionPreparingStmt stmt,
boolean init)
Creates a new planner. |
|
FarragoSessionPreparingStmt |
newPreparingStmt(FarragoSessionStmtContext stmtContext,
FarragoSessionStmtContext rootStmtContext,
FarragoSessionStmtValidator stmtValidator)
Creates a new preparing statement tied to this session and its underlying database. |
|
FarragoSessionPreparingStmt |
newPreparingStmt(FarragoSessionStmtContext stmtContext,
FarragoSessionStmtValidator stmtValidator)
Creates a new preparing statement tied to this session and its underlying database. |
|
FarragoSessionPreparingStmt |
newPreparingStmt(FarragoSessionStmtValidator stmtValidator)
|
|
FarragoSessionRuntimeContext |
newRuntimeContext(FarragoSessionRuntimeParams params)
Creates a new runtime context. |
|
RelDataTypeFactory |
newTypeFactory(FarragoRepos repos)
Creates a new type factory. |
|
void |
registerRelMetadataProviders(ChainedRelMetadataProvider chain)
Gives this personality a chance to register one or more RelMetadataProvider s in the chain which will be used to answer
relational expression metadata queries during optimization. |
|
void |
registerStreamFactories(long hStreamGraph)
Registers factories for extension ExecStreams in Fennel. |
|
void |
resetRowCounts(FemAbstractColumnSet table)
Gives this personality the opportunity to reset rowcount information in the catalog tables for a specified table |
|
boolean |
shouldReplacePreserveOriginalSql()
Tests whether this personality wants original SQL to be preserved for dependent objects where possible during the revalidation triggered by CREATE OR REPLACE. |
|
boolean |
supportsFeature(org.eigenbase.resgen.ResourceDefinition feature)
Tests whether a feature is supported in this personality. |
|
void |
updateIndexRoot(FemLocalIndex index,
FarragoDataWrapperCache wrapperCache,
FarragoSessionIndexMap baseIndexMap,
Long newRoot)
Gives the personality the opportunity to update an index root page when the index is rebuilt |
|
long |
updateRowCounts(FarragoSession session,
List<String> tableName,
List<Long> rowCounts,
TableModificationRelBase.Operation tableModOp,
FarragoSessionRuntimeContext runningContext)
Gives this personality the opportunity to update rowcount information in the catalog tables for a specified table as a result of a particular DML operation. |
|
void |
validateSessionVariable(FarragoSessionDdlValidator ddlValidator,
FarragoSessionVariables variables,
String name,
String value)
Checks whether a parameter value is appropriate for a session variable and, if the value is appropriate, sets the session variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SQUEEZE_JDBC_NUMERIC
public static final String SQUEEZE_JDBC_NUMERIC_DEFAULT
public static final String CACHE_STATEMENTS
public static final String CACHE_STATEMENTS_DEFAULT
public static final String VALIDATE_DDL_ON_PREPARE
public static final String VALIDATE_DDL_ON_PREPARE_DEFAULT
public static final String REDUCE_NON_CORRELATED_SUBQUERIES
public static final String REDUCE_NON_CORRELATED_SUBQUERIES_FARRAGO_DEFAULT
public static final String DEGREE_OF_PARALLELISM
public static final String DEGREE_OF_PARALLELISM_DEFAULT
public static final String LABEL
public static final String LABEL_DEFAULT
protected final FarragoDatabase database
protected final FarragoDefaultSessionPersonality.ParamValidator paramValidator
Constructor Detail |
---|
protected FarragoDefaultSessionPersonality(FarragoDbSession session)
Method Detail |
---|
public FarragoSessionPlanner newPlanner(FarragoSessionPreparingStmt stmt, boolean init)
FarragoSessionPersonality
newPlanner
in interface FarragoSessionPersonality
stmt
- stmt on whose behalf planner will operateinit
- whether to initialize default rules in new planner
public void definePlannerListeners(FarragoSessionPlanner planner)
FarragoSessionPersonality
definePlannerListeners
in interface FarragoSessionPersonality
planner
- planner to which listeners should be addedpublic void registerStreamFactories(long hStreamGraph)
FarragoStreamFactoryProvider
registerStreamFactories
in interface FarragoStreamFactoryProvider
hStreamGraph
- native handle to unprepared stream graphpublic String getDefaultLocalDataServerName(FarragoSessionStmtValidator stmtValidator)
FarragoSessionPersonality
getDefaultLocalDataServerName
in interface FarragoSessionPersonality
stmtValidator
- validator for statement being prepared
public boolean isAlterTableAddColumnIncremental()
FarragoSessionPersonality
isAlterTableAddColumnIncremental
in interface FarragoSessionPersonality
public boolean isJavaUdxRestartable()
FarragoSessionPersonality
isJavaUdxRestartable
in interface FarragoSessionPersonality
public SqlOperatorTable getSqlOperatorTable(FarragoSessionPreparingStmt preparingStmt)
FarragoSessionPersonality
getSqlOperatorTable
in interface FarragoSessionPersonality
preparingStmt
- statement being prepared
public OJRexImplementorTable getOJRexImplementorTable(FarragoSessionPreparingStmt preparingStmt)
FarragoSessionPersonality
getOJRexImplementorTable
in interface FarragoSessionPersonality
preparingStmt
- statement being prepared
FarragoSessionPersonality.getSqlOperatorTable(FarragoSessionPreparingStmt)
public <C> C newComponentImpl(Class<C> componentInterface)
FarragoSessionPersonality
C
or a subclass.
newComponentImpl
in interface FarragoSessionPersonality
componentInterface
- the interface desired
componentInterface
or nullpublic FarragoSessionParser newParser(FarragoSession session)
FarragoSessionPersonality
newParser
in interface FarragoSessionPersonality
session
- session which will use the parser
public FarragoSessionPreparingStmt newPreparingStmt(FarragoSessionStmtValidator stmtValidator)
newPreparingStmt
in interface FarragoSessionPersonality
public FarragoSessionPreparingStmt newPreparingStmt(FarragoSessionStmtContext stmtContext, FarragoSessionStmtValidator stmtValidator)
FarragoSessionPersonality
newPreparingStmt
in interface FarragoSessionPersonality
stmtContext
- embracing stmt context, if any; otherwise, null.stmtValidator
- generic stmt validator
FarragoSessionPreparingStmt
.public FarragoSessionPreparingStmt newPreparingStmt(FarragoSessionStmtContext stmtContext, FarragoSessionStmtContext rootStmtContext, FarragoSessionStmtValidator stmtValidator)
FarragoSessionPersonality
newPreparingStmt
in interface FarragoSessionPersonality
stmtContext
- embracing stmt context, if any; otherwise, null.rootStmtContext
- the root stmt contextstmtValidator
- generic stmt validator
FarragoSessionPreparingStmt
.protected void initPreparingStmt(FarragoPreparingStmt stmt)
public FarragoSessionDdlValidator newDdlValidator(FarragoSessionStmtValidator stmtValidator)
FarragoSessionPersonality
newDdlValidator
in interface FarragoSessionPersonality
stmtValidator
- generic stmt validator
public void defineDdlHandlers(FarragoSessionDdlValidator ddlValidator, List<DdlHandler> handlerList)
FarragoSessionPersonality
FarragoSessionModelExtension.defineDdlHandlers(net.sf.farrago.session.FarragoSessionDdlValidator, java.util.List)
.
defineDdlHandlers
in interface FarragoSessionPersonality
ddlValidator
- validator which will invoke handlershandlerList
- receives handler objects in order in which they
should be invokedpublic void definePrivileges(FarragoSessionPrivilegeMap map)
FarragoSessionPersonality
definePrivileges
in interface FarragoSessionPersonality
map
- receives allowed privilegesprivate void defineTypePrivileges(FarragoSessionPrivilegeMap map, RefClass refClass, PrivilegedAction[] actions)
public Class getRuntimeContextClass(FarragoSessionPreparingStmt preparingStmt)
FarragoSessionPersonality
getRuntimeContextClass
in interface FarragoSessionPersonality
preparingStmt
- stmt on whose behalf planner will operate
FarragoSessionRuntimeContext
public FarragoSessionRuntimeContext newRuntimeContext(FarragoSessionRuntimeParams params)
FarragoSessionPersonality
newRuntimeContext
in interface FarragoSessionPersonality
params
- context initialization parameters
public RelDataTypeFactory newTypeFactory(FarragoRepos repos)
FarragoSessionPersonality
newTypeFactory
in interface FarragoSessionPersonality
repos
- a repository containing Farrago metadata
public void loadDefaultSessionVariables(FarragoSessionVariables variables)
FarragoSessionPersonality
This method should be called when initializing a new session or when loading a new session personality for an existing session. This method "leaves a mark", as it has the side effect of permanently updating the session variables. Even if the session personality is swapped out, the changes will remain.
loadDefaultSessionVariables
in interface FarragoSessionPersonality
variables
- the session variables objectpublic FarragoSessionVariables createInheritedSessionVariables(FarragoSessionVariables variables)
FarragoSessionPersonality
createInheritedSessionVariables
in interface FarragoSessionPersonality
variables
- set of variables to be inherited
public void validateSessionVariable(FarragoSessionDdlValidator ddlValidator, FarragoSessionVariables variables, String name, String value)
FarragoSessionPersonality
EigenbaseException
. Possible errors include when no
session variable has the specified name, when a non-numeric value was
specified for a numeric variable, when a directory does not exist, or
other errors.
validateSessionVariable
in interface FarragoSessionPersonality
ddlValidator
- a ddl statement validatorvariables
- a session variables objectname
- name of the session variable to be validatedvalue
- value to set for the session variablepublic JmiQueryProcessor newJmiQueryProcessor(String language)
FarragoSessionPersonality
newJmiQueryProcessor
in interface FarragoSessionPersonality
language
- query language (e.g. "LURQL")
public boolean isSupportedType(SqlTypeName type)
FarragoSessionPersonality
isSupportedType
in interface FarragoSessionPersonality
type
- Type
public boolean supportsFeature(org.eigenbase.resgen.ResourceDefinition feature)
FarragoSessionPersonality
supportsFeature
in interface FarragoSessionPersonality
feature
- EigenbaseResource
resource definition
representing the feature to be tested
public boolean shouldReplacePreserveOriginalSql()
FarragoSessionPersonality
shouldReplacePreserveOriginalSql
in interface FarragoSessionPersonality
public void registerRelMetadataProviders(ChainedRelMetadataProvider chain)
FarragoSessionPersonality
RelMetadataProvider
s in the chain which will be used to answer
relational expression metadata queries during optimization. Personalities
which define their own relational expressions will generally need to
supply corresponding metadata providers.
registerRelMetadataProviders
in interface FarragoSessionPersonality
chain
- receives personality's custom providers, if anypublic void getRowCounts(ResultSet resultSet, List<Long> rowCounts, TableModificationRelBase.Operation tableModOp) throws SQLException
FarragoSessionPersonality
getRowCounts
in interface FarragoSessionPersonality
resultSet
- result set returned by DML operationrowCounts
- list of rowcounts returned by the DML operationtableModOp
- table modification operation that caused the rowcounts
to be modified
SQLException
protected boolean addRowCount(ResultSet resultSet, List<Long> rowCounts) throws SQLException
SQLException
public long updateRowCounts(FarragoSession session, List<String> tableName, List<Long> rowCounts, TableModificationRelBase.Operation tableModOp, FarragoSessionRuntimeContext runningContext)
FarragoSessionPersonality
updateRowCounts
in interface FarragoSessionPersonality
session
- session that needs to update rowcountstableName
- fully qualified table name for which rowcounts will be
updatedrowCounts
- list of row counts returned by the DML statementtableModOp
- table modification operation that caused the rowcounts
to be modifiedrunningContext
- the currently running session context.
public void resetRowCounts(FemAbstractColumnSet table)
FarragoSessionPersonality
resetRowCounts
in interface FarragoSessionPersonality
table
- column set corresponding to tablepublic void updateIndexRoot(FemLocalIndex index, FarragoDataWrapperCache wrapperCache, FarragoSessionIndexMap baseIndexMap, Long newRoot)
FarragoSessionPersonality
updateIndexRoot
in interface FarragoSessionPersonality
index
- index whose root is being updatedwrapperCache
- cache for looking up data wrappersbaseIndexMap
- map for managing index storagenewRoot
- index's new root page
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |