|
Teiid 8.3.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.translator.ExecutionFactory<F,C>
public class ExecutionFactory<F,C>
The primary entry point for a Translator. This class should be extended by the custom translator writer.
The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed the "start" method is called. This class represents the basic capabilities of the translator.
Nested Class Summary | |
---|---|
static class |
ExecutionFactory.Format
|
static class |
ExecutionFactory.NullOrder
|
static class |
ExecutionFactory.SupportedJoinCriteria
|
Field Summary | |
---|---|
static int |
DEFAULT_MAX_FROM_GROUPS
|
static int |
DEFAULT_MAX_IN_CRITERIA_SIZE
|
Constructor Summary | |
---|---|
ExecutionFactory()
|
Method Summary | ||
---|---|---|
protected FunctionMethod |
addPushDownFunction(String qualifier,
String name,
String returnType,
String... paramTypes)
Adds a pushdown function. |
|
boolean |
areLobsUsableAfterClose()
Indicates if LOBs are usable after the execution is closed. |
|
void |
closeConnection(C connection,
F factory)
Closes a connection object from the given connection factory. |
|
ProcedureExecution |
createDirectExecution(List<Argument> arguments,
Command command,
ExecutionContext executionContext,
RuntimeMetadata metadata,
C connection)
|
|
Execution |
createExecution(Command command,
ExecutionContext executionContext,
RuntimeMetadata metadata,
C connection)
Create an execution object for the specified command |
|
ProcedureExecution |
createProcedureExecution(Call command,
ExecutionContext executionContext,
RuntimeMetadata metadata,
C connection)
|
|
ResultSetExecution |
createResultSetExecution(QueryExpression command,
ExecutionContext executionContext,
RuntimeMetadata metadata,
C connection)
|
|
UpdateExecution |
createUpdateExecution(Command command,
ExecutionContext executionContext,
RuntimeMetadata metadata,
C connection)
|
|
CacheDirective |
getCacheDirective(Command command,
ExecutionContext executionContext,
RuntimeMetadata metadata)
Get the CacheDirective to control command caching. |
|
C |
getConnection(F factory)
Deprecated. |
|
C |
getConnection(F factory,
ExecutionContext executionContext)
Return a connection object from the given connection factory. |
|
ExecutionFactory.NullOrder |
getDefaultNullOrder()
Returns the default null ordering |
|
static
|
getInstance(Class<T> expectedType,
String className,
Collection<?> ctorObjs,
Class<? extends T> defaultClass)
|
|
LanguageFactory |
getLanguageFactory()
Obtain a reference to the default LanguageFactory that can be used to construct new language interface objects. |
|
int |
getMaxDependentInPredicates()
Get the integer value representing the max number of dependent IN predicates. |
|
int |
getMaxFromGroups()
The number of groups supported in the from clause. |
|
int |
getMaxInCriteriaSize()
Get the integer value representing the number of values allowed in an IN criteria in the WHERE clause of a query |
|
void |
getMetadata(MetadataFactory metadataFactory,
C conn)
Implement to provide metadata to the metadata for use by the engine. |
|
String |
getNativeQueryProcedureName()
Defines the name of the procedure that need to be treated as "native" query processing procedure. |
|
List<FunctionMethod> |
getPushDownFunctions()
Get a list of FunctionMethod s that will be contributed to the SYS schema. |
|
List<String> |
getSupportedFunctions()
Get list of all supported function names. |
|
ExecutionFactory.SupportedJoinCriteria |
getSupportedJoinCriteria()
Get the supported join criteria. |
|
TypeFacility |
getTypeFacility()
Obtain a reference to the type facility, which can be used to perform many type conversions supplied by the Connector API. |
|
boolean |
isCopyLobs()
|
|
boolean |
isForkable()
When forkable the engine may use a separate thread to interact with returned Execution . |
|
boolean |
isImmutable()
Defines if the Connector is read-only connector |
|
boolean |
isSourceRequired()
Flag that indicates if a underlying source connection required for this execution factory to work |
|
boolean |
isSourceRequiredForMetadata()
Flag that indicates if a underlying source connection required for this execution factory to return metadata |
|
boolean |
requiresCriteria()
Whether the source supports queries without criteria. |
|
void |
setCopyLobs(boolean copyLobs)
|
|
void |
setImmutable(boolean arg0)
|
|
void |
setMaxDependentInPredicates(int maxDependentInPredicates)
|
|
void |
setMaxInCriteriaSize(int maxInSize)
|
|
void |
setNativeQueryProcedureName(String name)
|
|
void |
setRequiresCriteria(boolean requiresCriteria)
|
|
void |
setSourceRequired(boolean value)
|
|
void |
setSourceRequiredForMetadata(boolean sourceRequiredForMetadata)
|
|
void |
setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
|
|
void |
setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
|
|
void |
setSupportsInnerJoins(boolean supportsInnerJoins)
|
|
void |
setSupportsNativeQueries(boolean state)
|
|
void |
setSupportsOrderBy(boolean supportsOrderBy)
|
|
void |
setSupportsOuterJoins(boolean supportsOuterJoins)
|
|
void |
setSupportsSelectDistinct(boolean supportsSelectDistinct)
|
|
void |
start()
Initialize the connector with supplied configuration |
|
boolean |
supportsAdvancedOlapOperations()
|
|
boolean |
supportsAggregatesAvg()
Support indicates connector can accept the AVG aggregate function |
|
boolean |
supportsAggregatesCount()
Support indicates connector can accept the COUNT aggregate function |
|
boolean |
supportsAggregatesCountStar()
Support indicates connector can accept the COUNT(*) aggregate function |
|
boolean |
supportsAggregatesDistinct()
Support indicates connector can accept DISTINCT within aggregate functions |
|
boolean |
supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP |
|
boolean |
supportsAggregatesMax()
Support indicates connector can accept the MAX aggregate function |
|
boolean |
supportsAggregatesMin()
Support indicates connector can accept the MIN aggregate function |
|
boolean |
supportsAggregatesSum()
Support indicates connector can accept the SUM aggregate function |
|
boolean |
supportsAliasedTable()
Support indicates connector can accept groups with aliases |
|
boolean |
supportsArrayAgg()
|
|
boolean |
supportsArrayType()
The engine currently uses array types for dependent joins. |
|
boolean |
supportsBatchedUpdates()
Whether the source supports BatchedUpdates |
|
boolean |
supportsBulkUpdate()
Whether the source supports updates with multiple value sets |
|
boolean |
supportsCommonTableExpressions()
|
|
boolean |
supportsCompareCriteriaEquals()
Support indicates connector accepts criteria of form (element = constant) |
|
boolean |
supportsCompareCriteriaOrdered()
Support indicates connector accepts criteria of form (element <=|>= constant) The query engine will may pushdown queries containing < or > if NOT is also supported. |
|
boolean |
supportsConvert(int fromType,
int toType)
Used for fine grained control of convert/cast pushdown. |
|
boolean |
supportsCorrelatedSubqueries()
Support indicates connector can accept correlated subqueries wherever subqueries are accepted |
|
boolean |
supportsDependentJoins()
|
|
boolean |
supportsElementaryOlapOperations()
|
|
boolean |
supportsExcept()
Support indicates that the connector supports the EXCEPT of two queries. |
|
boolean |
supportsExistsCriteria()
Support indicates connector accepts the EXISTS criteria |
|
boolean |
supportsFormatLiteral(String literal,
ExecutionFactory.Format format)
|
|
boolean |
supportsFullOuterJoins()
Support indicates connector can accept full outer joins |
|
boolean |
supportsFunctionsInGroupBy()
Support indicates that the connector supports non-column expressions in GROUP BY, such as: SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate) |
|
boolean |
supportsGroupBy()
Whether the source supports an explicit GROUP BY clause |
|
boolean |
supportsHaving()
Whether the source supports the HAVING clause |
|
boolean |
supportsInCriteria()
Support indicates connector accepts criteria of form (element IN set) |
|
boolean |
supportsInCriteriaSubquery()
Support indicates connector accepts IN criteria with a subquery on the right side |
|
boolean |
supportsInlineViews()
Support indicates connector can accept inline views (subqueries in the FROM clause). |
|
boolean |
supportsInnerJoins()
Support indicates connector can accept inner or cross joins |
|
boolean |
supportsInsertWithQueryExpression()
Support indicates that the connector can accept INSERTs with values specified by a SetQuery or Select |
|
boolean |
supportsIntersect()
Support indicates that the connector supports the INTERSECT of two queries. |
|
boolean |
supportsIsNullCriteria()
Support indicates connector accepts criteria of form (element IS NULL) |
|
boolean |
supportsLikeCriteria()
Support indicates connector accepts criteria of form (element LIKE constant) |
|
boolean |
supportsLikeCriteriaEscapeCharacter()
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char) |
|
boolean |
supportsLikeRegex()
|
|
boolean |
supportsNativeQueries()
True, if this translator supports execution of source specific commands unaltered through 'native' procedure. |
|
boolean |
supportsNotCriteria()
Support indicates connector accepts logical criteria NOT |
|
boolean |
supportsOnlyCorrelatedSubqueries()
|
|
boolean |
supportsOnlyFormatLiterals()
See also supportsFormatLiteral(String, Format) |
|
boolean |
supportsOnlyLiteralComparison()
|
|
boolean |
supportsOnlySingleTableGroupBy()
Whether the source supports grouping only over a single table |
|
boolean |
supportsOrCriteria()
Support indicates connector accepts logical criteria connected by OR |
|
boolean |
supportsOrderBy()
Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts. |
|
boolean |
supportsOrderByNullOrdering()
Returns whether the database supports explicit join ordering. |
|
boolean |
supportsOrderByUnrelated()
Support indicates connector accepts ORDER BY clause with columns not from the select |
|
boolean |
supportsOuterJoins()
Support indicates connector can accept left outer joins |
|
boolean |
supportsQuantifiedCompareCriteriaAll()
Support indicates connector accepts the quantified comparison criteria that use ALL |
|
boolean |
supportsQuantifiedCompareCriteriaSome()
Support indicates connector accepts the quantified comparison criteria that use SOME |
|
boolean |
supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query. |
|
boolean |
supportsRowOffset()
Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return result sets that start in the middle of the resulting rows returned by a query |
|
boolean |
supportsScalarSubqueries()
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses |
|
boolean |
supportsSearchedCaseExpressions()
Support indicates connector can accept queries with searched CASE WHEN |
|
boolean |
supportsSelectDistinct()
Support indicates connector can accept queries with SELECT DISTINCT |
|
boolean |
supportsSelectExpression()
Support indicates connector can accept expressions other than element symbols in the SELECT clause. |
|
boolean |
supportsSelfJoins()
Support indicates connector can accept self-joins where a group is joined to itself with aliases. |
|
boolean |
supportsSetQueryOrderBy()
Support indicates that the connector supports an ORDER BY on a SetQuery. |
|
boolean |
supportsSimilarTo()
|
|
boolean |
supportsSubqueryInOn()
Refines subquery support. |
|
boolean |
supportsUnions()
Support indicates that the connector supports the UNION of two queries. |
|
boolean |
supportsWindowDistinctAggregates()
|
|
boolean |
supportsWindowOrderByWithAggregates()
|
|
boolean |
useAnsiJoin()
Whether the source prefers to use ANSI style joins. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAX_FROM_GROUPS
public static final int DEFAULT_MAX_IN_CRITERIA_SIZE
Constructor Detail |
---|
public ExecutionFactory()
Method Detail |
---|
public void start() throws TranslatorException
TranslatorException
@TranslatorProperty(display="Is Immutable", description="Is Immutable, True if the source never changes.", advanced=true) public boolean isImmutable()
public void setImmutable(boolean arg0)
@TranslatorProperty(display="Copy LOBs", description="If true, returned LOBs will be copied, rather than streamed from the source", advanced=true) public boolean isCopyLobs()
public void setCopyLobs(boolean copyLobs)
public C getConnection(F factory) throws TranslatorException
ConnectionFactory
. Subclasses should override, if they use
another type of connection factory.
factory
-
TranslatorException
getConnection(Object, ExecutionContext)
public C getConnection(F factory, ExecutionContext executionContext) throws TranslatorException
ConnectionFactory
. Subclasses should override, if they use
another type of connection factory or wish to use the ExecutionContext
. By default calls getConnection(Object)
factory
- executionContext
- null if this is a system request for a connection
TranslatorException
public void closeConnection(C connection, F factory)
Connection
. Subclasses should override, if they use
another type of connection.
connection
- factory
- public boolean isSourceRequired()
public void setSourceRequired(boolean value)
public boolean isSourceRequiredForMetadata()
Boolean.TRUE
if required, null if possibly required, or Boolean.FALSE
if not requiredpublic void setSourceRequiredForMetadata(boolean sourceRequiredForMetadata)
public LanguageFactory getLanguageFactory()
public TypeFacility getTypeFacility()
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
command
- the commandexecutionContext
- Provides information about the context that this command is
executing within, such as the identifiers for the command being executedmetadata
- Access to runtime metadata if needed to translate the commandconnection
- connection factory object to the data source
TranslatorException
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
public ProcedureExecution createDirectExecution(List<Argument> arguments, Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
@TranslatorProperty(display="Supports Select Distinct", description="True, if this connector supports SELECT DISTINCT", advanced=true) public boolean supportsSelectDistinct()
public void setSupportsSelectDistinct(boolean supportsSelectDistinct)
public boolean supportsSelectExpression()
public boolean supportsAliasedTable()
@TranslatorProperty(display="Supported Join Criteria", description="Returns one of any, theta, equi, or key", advanced=true) public ExecutionFactory.SupportedJoinCriteria getSupportedJoinCriteria()
ExecutionFactory.SupportedJoinCriteria.ANY
public void setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
@TranslatorProperty(display="Supports Inner Joins", description="True, if this connector supports inner joins", advanced=true) public boolean supportsInnerJoins()
public void setSupportsInnerJoins(boolean supportsInnerJoins)
public boolean supportsSelfJoins()
supportsAliasedTable()
.
@TranslatorProperty(display="Supports Outer Joins", description="True, if this connector supports outer joins", advanced=true) public boolean supportsOuterJoins()
public void setSupportsOuterJoins(boolean supportsOuterJoins)
@TranslatorProperty(display="Supports Full Outer Joins", description="True, if this connector supports full outer joins", advanced=true) public boolean supportsFullOuterJoins()
public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
public boolean supportsInlineViews()
public boolean supportsCompareCriteriaEquals()
public boolean supportsCompareCriteriaOrdered()
public boolean supportsLikeCriteria()
public boolean supportsLikeCriteriaEscapeCharacter()
public boolean supportsInCriteria()
public boolean supportsInCriteriaSubquery()
public boolean supportsIsNullCriteria()
public boolean supportsOrCriteria()
public boolean supportsNotCriteria()
public boolean supportsExistsCriteria()
public boolean supportsQuantifiedCompareCriteriaSome()
public boolean supportsQuantifiedCompareCriteriaAll()
@TranslatorProperty(display="Supports ORDER BY", description="True, if this connector supports ORDER BY", advanced=true) public boolean supportsOrderBy()
public void setSupportsOrderBy(boolean supportsOrderBy)
public boolean supportsOrderByUnrelated()
public ExecutionFactory.NullOrder getDefaultNullOrder()
ExecutionFactory.NullOrder
public boolean supportsOrderByNullOrdering()
public boolean supportsGroupBy()
public boolean supportsOnlySingleTableGroupBy()
public boolean supportsHaving()
public boolean supportsAggregatesSum()
public boolean supportsAggregatesAvg()
public boolean supportsAggregatesMin()
public boolean supportsAggregatesMax()
public boolean supportsAggregatesCount()
public boolean supportsAggregatesCountStar()
public boolean supportsAggregatesDistinct()
public boolean supportsAggregatesEnhancedNumeric()
public boolean supportsScalarSubqueries()
public boolean supportsCorrelatedSubqueries()
public boolean supportsSearchedCaseExpressions()
public boolean supportsUnions()
public boolean supportsSetQueryOrderBy()
public boolean supportsIntersect()
public boolean supportsExcept()
public List<String> getSupportedFunctions()
for a listing of system pushdown functions. Note that
not all system functions are listed as some functions will use a common name
such as CONCAT vs. the || operator, and other functions will be rewritten and
not pushed down, such as SPACE.
public List<FunctionMethod> getPushDownFunctions()
FunctionMethod
s that will be contributed to the SYS schema.
To avoid conflicts with system functions, the function name should contain a
qualifier - typically <translator name>.<function name>
ExecutionFactory#addPushDownFunction(String, String, FunctionParameter, FunctionParameter...)
protected FunctionMethod addPushDownFunction(String qualifier, String name, String returnType, String... paramTypes)
qualifier
- will be pre-pended to the namename
- returnType
- see TypeFacility.RUNTIME_NAMES
for type namesparamTypes
- see TypeFacility.RUNTIME_NAMES
for type names
@TranslatorProperty(display="Max number of IN predicate entries", advanced=true) public int getMaxInCriteriaSize()
public void setMaxInCriteriaSize(int maxInSize)
@TranslatorProperty(display="Max number of dependent IN predicates", advanced=true) public int getMaxDependentInPredicates()
public void setMaxDependentInPredicates(int maxDependentInPredicates)
public boolean supportsFunctionsInGroupBy()
Support indicates that the connector supports non-column expressions in GROUP BY, such as:
SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
public boolean supportsRowLimit()
public boolean supportsRowOffset()
public int getMaxFromGroups()
public boolean useAnsiJoin()
@TranslatorProperty(display="Requries Criteria", description="True, if this connector requires criteria on source queries", advanced=true) public boolean requiresCriteria()
public void setRequiresCriteria(boolean requiresCriteria)
public boolean supportsBatchedUpdates()
BatchedUpdates
public boolean supportsBulkUpdate()
public boolean supportsInsertWithQueryExpression()
SetQuery
or Select
public static <T> T getInstance(Class<T> expectedType, String className, Collection<?> ctorObjs, Class<? extends T> defaultClass) throws TranslatorException
TranslatorException
public void getMetadata(MetadataFactory metadataFactory, C conn) throws TranslatorException
metadataFactory
- conn
- may be null if the source is not required
TranslatorException
- to indicate a recoverable error, otherwise a RuntimeExceptionisSourceRequiredForMetadata()
public boolean areLobsUsableAfterClose()
public boolean supportsCommonTableExpressions()
public boolean supportsAdvancedOlapOperations()
public boolean supportsElementaryOlapOperations()
public boolean supportsWindowOrderByWithAggregates()
public boolean supportsWindowDistinctAggregates()
public boolean supportsArrayAgg()
public boolean supportsSimilarTo()
public boolean supportsLikeRegex()
public boolean supportsConvert(int fromType, int toType)
getSupportedFunctions()
should
contain SourceSystemFunctions.CONVERT
. This method can then return false to indicate
a lack of specific support. The engine will does not care about an unnecessary conversion
where fromType == toType.
By default lob conversion is disabled.
fromType
- @see RUNTIME_CODEStoType
- @see RUNTIME_CODES
public boolean supportsOnlyLiteralComparison()
public boolean supportsDependentJoins()
public boolean supportsOnlyFormatLiterals()
supportsFormatLiteral(String, Format)
public boolean supportsFormatLiteral(String literal, ExecutionFactory.Format format)
literal
- format
-
public boolean supportsSubqueryInOn()
public CacheDirective getCacheDirective(Command command, ExecutionContext executionContext, RuntimeMetadata metadata) throws TranslatorException
CacheDirective
to control command caching.
Use CacheDirective.Scope.NONE
to indicate to the engine that no caching should be performed by the engine.
If cache parameters on the CacheDirective
will be changed by the Execution
, then
a new instance of a CacheDirective
should be set each time.
command
- executionContext
- metadata
-
TranslatorException
public boolean isForkable()
Execution
.
Execution
s can be called in separate threads from the processing threadpublic boolean supportsArrayType()
@TranslatorProperty(display="Supports Native Queries", description="True, if this translator supports execution of source specific commands unaltered through a \'native\' procedure", advanced=true) public boolean supportsNativeQueries()
public void setSupportsNativeQueries(boolean state)
@TranslatorProperty(display="Name of the native query", description="The name of the direct query procedure", advanced=true) public String getNativeQueryProcedureName()
public void setNativeQueryProcedureName(String name)
public boolean supportsOnlyCorrelatedSubqueries()
|
Teiid 8.3.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |