public class LocalFunctionRegistry extends Object implements AutoCloseable
Constructor and Description |
---|
LocalFunctionRegistry(ScanResult classpathScan)
Registers all functions present in Drill classpath on start-up.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
List<String> |
getAllJarNames()
Returns list of jar names registered in function registry.
|
Map<String,List<FunctionHolder>> |
getAllJarsWithFunctionsHolders()
Returns a map of all function holders mapped by source jars
|
List<DrillFuncHolder> |
getMethods(String name) |
List<DrillFuncHolder> |
getMethods(String name,
AtomicInteger version) |
int |
getVersion() |
void |
register(DrillOperatorTable operatorTable)
Registers all functions present in
DrillOperatorTable ,
also sets sync registry version used at the moment of function registration. |
void |
register(List<JarScan> jars,
int version)
Registers all functions present in jar and updates registry version.
|
int |
size() |
void |
unregister(String jarName)
Removes all function associated with the given jar name.
|
List<String> |
validate(String jarName,
ScanResult scanResult)
Validates all functions, present in jars.
|
public static final String BUILT_IN
public LocalFunctionRegistry(ScanResult classpathScan)
DataChangeVersion.UNDEFINED
to ensure that upon first check both registries would be synchronized.public int getVersion()
public List<String> validate(String jarName, ScanResult scanResult)
FunctionValidationException
if:
jarName
- jar name to be validatedscanResult
- scan of all classes present in jarpublic void register(List<JarScan> jars, int version)
jars
- list of jars to be registeredversion
- remote function registry version number with which local function registry is syncedpublic void unregister(String jarName)
jarName
- jar name to be unregisteredpublic List<String> getAllJarNames()
public int size()
public List<DrillFuncHolder> getMethods(String name, AtomicInteger version)
name
- function namepublic List<DrillFuncHolder> getMethods(String name)
name
- function namepublic Map<String,List<FunctionHolder>> getAllJarsWithFunctionsHolders()
public void register(DrillOperatorTable operatorTable)
DrillOperatorTable
,
also sets sync registry version used at the moment of function registration.operatorTable
- drill operator tablepublic void close()
close
in interface AutoCloseable
Copyright © 2022 The Apache Software Foundation. All rights reserved.