public class EngineImportServiceImpl extends Object implements EngineImportService, ClassLoaderProvider
EXT_SINGLEROW_FUNCTION_TRANSPOSE
NAME
Constructor and Description |
---|
EngineImportServiceImpl(boolean allowExtendedAggregationFunc,
boolean isUdfCache,
boolean isDuckType,
boolean sortUsingCollator,
MathContext optionalDefaultMathContext,
TimeZone timeZone,
TimeAbacus timeAbacus,
ConfigurationEngineDefaults.ThreadingProfile threadingProfile,
Map<String,Object> transientConfiguration,
AggregationFactoryFactory aggregationFactoryFactory,
ConfigurationEngineDefaults.CodeGeneration codeGeneration,
String engineURI,
CodegenCompiler codegenCompiler) |
Modifier and Type | Method and Description |
---|---|
void |
addAggregation(String functionName,
ConfigurationPlugInAggregationFunction aggregationDesc)
Add an aggregation function.
|
void |
addAggregationMultiFunction(ConfigurationPlugInAggregationMultiFunction desc) |
void |
addAnnotationImport(String importName)
Add an import for annotation-only use, such as "com.mypackage.*" or "com.mypackage.MyClass".
|
void |
addImport(String importName)
Add an import, such as "com.mypackage.*" or "com.mypackage.MyClass".
|
void |
addMethodRefs(Map<String,ConfigurationMethodRef> configs)
Adds cache configs for method invocations for from-clause.
|
void |
addSingleRow(String functionName,
String singleRowFuncClass,
String methodName,
ConfigurationPlugInSingleRowFunction.ValueCache valueCache,
ConfigurationPlugInSingleRowFunction.FilterOptimizable filterOptimizable,
boolean rethrowExceptions,
String optionalEventTypeName)
Add an single-row function.
|
ClassLoader |
classloader()
Returns the classloader.
|
EventPropertyGetterIndexed |
codegenGetter(EventPropertyGetterIndexedSPI getterSPI,
String eventTypeName,
String propertyExpression) |
EventPropertyGetterMapped |
codegenGetter(EventPropertyGetterMappedSPI getterSPI,
String eventTypeName,
String propertyExpression) |
EventPropertyGetter |
codegenGetter(EventPropertyGetterSPI getterSPI,
String eventTypeName,
String propertyExpression) |
AggregationFactoryFactory |
getAggregationFactoryFactory() |
ClassForNameProvider |
getClassForNameProvider() |
ClassLoader |
getClassLoader() |
CodegenCompiler |
getCodegenCompiler() |
ConfigurationEngineDefaults.CodeGeneration |
getCodeGeneration() |
ConfigurationMethodRef |
getConfigurationMethodRef(String className)
Returns the method invocation caches for the from-clause for a class.
|
MathContext |
getDefaultMathContext() |
String |
getEngineURI() |
ClassLoader |
getFastClassClassLoader(Class clazz) |
protected String[] |
getImports()
For testing, returns imports.
|
ConfigurationEngineDefaults.ThreadingProfile |
getThreadingProfile() |
TimeAbacus |
getTimeAbacus() |
TimeZone |
getTimeZone() |
boolean |
isCodegenEventPropertyGetters() |
boolean |
isDuckType() |
boolean |
isSortUsingCollator() |
boolean |
isUdfCache() |
AdvancedIndexFactoryProvider |
resolveAdvancedIndexProvider(String indexTypeName) |
ExprNode |
resolveAggExtendedBuiltin(String name,
boolean isDistinct)
Resolve an extended (non-SQL std) builtin aggregation.
|
AggregationFunctionFactory |
resolveAggregationFactory(String name)
Used at statement compile-time to try and resolve a given function name into an
aggregation method.
|
ConfigurationPlugInAggregationMultiFunction |
resolveAggregationMultiFunction(String name) |
Class |
resolveAnnotation(String className)
Resolves a given class name, either fully qualified and simple and imported to a annotation.
|
Class |
resolveClass(String className,
boolean forAnnotation)
Resolves a given class name, either fully qualified and simple and imported to a class.
|
protected Class |
resolveClassInternal(String className,
boolean requireAnnotation,
boolean forAnnotationUse)
Finds a class by class name using the auto-import information provided.
|
Constructor |
resolveCtor(Class clazz,
Class[] paramTypes)
Resolves a constructor matching list of parameter types.
|
Method |
resolveMethod(Class clazz,
String methodName,
Class[] paramTypes,
boolean[] allowEventBeanType,
boolean[] allowEventBeanCollType)
Resolves a given method name and list of parameter types to an instance or static method exposed by the given class.
|
Method |
resolveMethodOverloadChecked(Class clazz,
String methodName) |
Method |
resolveMethodOverloadChecked(String className,
String methodName)
Resolves a given class and method name to a static method, expecting the method to exist
exactly once and not be overloaded, with any parameters.
|
Method |
resolveMethodOverloadChecked(String className,
String methodName,
Class[] paramTypes,
boolean[] allowEventBeanType,
boolean[] allowEventBeanCollType)
Resolves a given class, method and list of parameter types to a static method.
|
Method |
resolveNonStaticMethodOverloadChecked(Class clazz,
String methodName)
Resolves a given class and method name to a non-static method, expecting the method to exist
exactly once and not be overloaded, with any parameters.
|
Pair<Class,EngineImportSingleRowDesc> |
resolveSingleRow(String name)
Used at statement compile-time to try and resolve a given function name into an
single-row function.
|
ExprNode |
resolveSingleRowExtendedBuiltin(String name)
Resolve an extended (non-SQL std) single-row function.
|
public EngineImportServiceImpl(boolean allowExtendedAggregationFunc, boolean isUdfCache, boolean isDuckType, boolean sortUsingCollator, MathContext optionalDefaultMathContext, TimeZone timeZone, TimeAbacus timeAbacus, ConfigurationEngineDefaults.ThreadingProfile threadingProfile, Map<String,Object> transientConfiguration, AggregationFactoryFactory aggregationFactoryFactory, ConfigurationEngineDefaults.CodeGeneration codeGeneration, String engineURI, CodegenCompiler codegenCompiler)
public boolean isUdfCache()
isUdfCache
in interface EngineImportService
public boolean isDuckType()
isDuckType
in interface EngineImportService
public ConfigurationMethodRef getConfigurationMethodRef(String className)
EngineImportService
getConfigurationMethodRef
in interface EngineImportService
className
- the class name providing the methodpublic ClassForNameProvider getClassForNameProvider()
getClassForNameProvider
in interface EngineImportService
public ClassLoader getFastClassClassLoader(Class clazz)
getFastClassClassLoader
in interface EngineImportService
public ClassLoader getClassLoader()
getClassLoader
in interface EngineImportService
public ClassLoader classloader()
ClassLoaderProvider
classloader
in interface ClassLoaderProvider
public void addMethodRefs(Map<String,ConfigurationMethodRef> configs)
configs
- cache configspublic void addImport(String importName) throws EngineImportException
EngineImportService
addImport
in interface EngineImportService
importName
- is the import to addEngineImportException
- if the information or format is invalidpublic void addAnnotationImport(String importName) throws EngineImportException
EngineImportService
addAnnotationImport
in interface EngineImportService
importName
- is the import to addEngineImportException
- if the information or format is invalidpublic void addAggregation(String functionName, ConfigurationPlugInAggregationFunction aggregationDesc) throws EngineImportException
EngineImportService
addAggregation
in interface EngineImportService
functionName
- is the name of the function to make known.aggregationDesc
- is the descriptor for the aggregation functionEngineImportException
- throw if format or information is invalidpublic void addSingleRow(String functionName, String singleRowFuncClass, String methodName, ConfigurationPlugInSingleRowFunction.ValueCache valueCache, ConfigurationPlugInSingleRowFunction.FilterOptimizable filterOptimizable, boolean rethrowExceptions, String optionalEventTypeName) throws EngineImportException
EngineImportService
addSingleRow
in interface EngineImportService
functionName
- is the name of the function to make known.singleRowFuncClass
- is the class that provides the single row functionmethodName
- is the name of the public static method provided by the class that provides the single row functionvalueCache
- setting to control value cache behavior which may cache a result value when constant parameters are passedfilterOptimizable
- filter behavior settingrethrowExceptions
- for whether to rethrowoptionalEventTypeName
- event type name when providedEngineImportException
- throw if format or information is invalidpublic AggregationFunctionFactory resolveAggregationFactory(String name) throws EngineImportUndefinedException, EngineImportException
EngineImportService
resolveAggregationFactory
in interface EngineImportService
name
- is the function nameEngineImportUndefinedException
- if the function is not a configured aggregation functionEngineImportException
- if the aggregation providing class could not be loaded or doesn't matchpublic void addAggregationMultiFunction(ConfigurationPlugInAggregationMultiFunction desc) throws EngineImportException
addAggregationMultiFunction
in interface EngineImportService
EngineImportException
public ConfigurationPlugInAggregationMultiFunction resolveAggregationMultiFunction(String name)
resolveAggregationMultiFunction
in interface EngineImportService
public Pair<Class,EngineImportSingleRowDesc> resolveSingleRow(String name) throws EngineImportException, EngineImportUndefinedException
EngineImportService
resolveSingleRow
in interface EngineImportService
name
- is the function nameEngineImportException
- if the function providing class could not be loaded or doesn't matchEngineImportUndefinedException
- if the function is not a configured single-row functionpublic Method resolveMethodOverloadChecked(String className, String methodName, Class[] paramTypes, boolean[] allowEventBeanType, boolean[] allowEventBeanCollType) throws EngineImportException
EngineImportService
resolveMethodOverloadChecked
in interface EngineImportService
className
- is the class name to usemethodName
- is the method nameparamTypes
- is parameter types match expression sub-nodesallowEventBeanType
- flag for whether event bean is allowedallowEventBeanCollType
- flag for whether event bean array is allowedEngineImportException
- if the method cannot be resolved to a visible static methodpublic Constructor resolveCtor(Class clazz, Class[] paramTypes) throws EngineImportException
EngineImportService
resolveCtor
in interface EngineImportService
clazz
- is the class to useparamTypes
- is parameter types match expression sub-nodesEngineImportException
- if the ctor cannot be resolvedpublic Method resolveMethodOverloadChecked(String className, String methodName) throws EngineImportException
EngineImportService
resolveMethodOverloadChecked
in interface EngineImportService
className
- is the class name to usemethodName
- is the method nameEngineImportException
- if the method cannot be resolved to a visible static method, or
if the method is overloadedpublic Method resolveMethodOverloadChecked(Class clazz, String methodName) throws EngineImportException
resolveMethodOverloadChecked
in interface EngineImportService
EngineImportException
public Method resolveNonStaticMethodOverloadChecked(Class clazz, String methodName) throws EngineImportException
EngineImportService
resolveNonStaticMethodOverloadChecked
in interface EngineImportService
clazz
- is the classmethodName
- is the method nameEngineImportException
- if the method cannot be resolved to a visible static method, or
if the method is overloadedpublic Class resolveClass(String className, boolean forAnnotation) throws EngineImportException
EngineImportService
resolveClass
in interface EngineImportService
className
- is the class name to useforAnnotation
- whether we are resolving an annotationEngineImportException
- if there was an error resolving the classpublic Class resolveAnnotation(String className) throws EngineImportException
EngineImportService
resolveAnnotation
in interface EngineImportService
className
- is the class name to useEngineImportException
- if there was an error resolving the classprotected Class resolveClassInternal(String className, boolean requireAnnotation, boolean forAnnotationUse) throws ClassNotFoundException
className
- is the class name to findrequireAnnotation
- whether the class must be an annotationforAnnotationUse
- whether resolving class for use with annotationsClassNotFoundException
- if the class cannot be loadedpublic Method resolveMethod(Class clazz, String methodName, Class[] paramTypes, boolean[] allowEventBeanType, boolean[] allowEventBeanCollType) throws EngineImportException
EngineImportService
resolveMethod
in interface EngineImportService
clazz
- is the class to look for a fitting methodmethodName
- is the method nameparamTypes
- is parameter types match expression sub-nodesallowEventBeanType
- whether EventBean footprint is allowedallowEventBeanCollType
- whether EventBean array footprint is allowedEngineImportException
- if the method cannot be resolved to a visible static or instance methodpublic ExprNode resolveSingleRowExtendedBuiltin(String name)
EngineImportService
resolveSingleRowExtendedBuiltin
in interface EngineImportService
name
- of funcpublic ExprNode resolveAggExtendedBuiltin(String name, boolean isDistinct)
EngineImportService
resolveAggExtendedBuiltin
in interface EngineImportService
name
- of funcisDistinct
- indicatorpublic MathContext getDefaultMathContext()
getDefaultMathContext
in interface EngineImportService
public TimeZone getTimeZone()
getTimeZone
in interface EngineImportService
public TimeAbacus getTimeAbacus()
getTimeAbacus
in interface EngineImportService
public ConfigurationEngineDefaults.ThreadingProfile getThreadingProfile()
getThreadingProfile
in interface EngineImportService
public boolean isSortUsingCollator()
isSortUsingCollator
in interface EngineImportService
public AggregationFactoryFactory getAggregationFactoryFactory()
getAggregationFactoryFactory
in interface EngineImportService
public AdvancedIndexFactoryProvider resolveAdvancedIndexProvider(String indexTypeName) throws EngineImportException
resolveAdvancedIndexProvider
in interface EngineImportService
EngineImportException
public boolean isCodegenEventPropertyGetters()
isCodegenEventPropertyGetters
in interface EngineImportService
public ConfigurationEngineDefaults.CodeGeneration getCodeGeneration()
getCodeGeneration
in interface EngineImportService
public EventPropertyGetter codegenGetter(EventPropertyGetterSPI getterSPI, String eventTypeName, String propertyExpression)
codegenGetter
in interface EngineImportService
public EventPropertyGetterIndexed codegenGetter(EventPropertyGetterIndexedSPI getterSPI, String eventTypeName, String propertyExpression)
codegenGetter
in interface EngineImportService
public EventPropertyGetterMapped codegenGetter(EventPropertyGetterMappedSPI getterSPI, String eventTypeName, String propertyExpression)
codegenGetter
in interface EngineImportService
public String getEngineURI()
getEngineURI
in interface EngineImportService
public CodegenCompiler getCodegenCompiler()
getCodegenCompiler
in interface EngineImportService
protected String[] getImports()