Package org.apache.drill.common.scanner
Class ClassPathScanner
java.lang.Object
org.apache.drill.common.scanner.ClassPathScanner
Classpath scanning utility.
The classpath should be scanned once at startup from a DrillConfig instance.
fromPrescan(DrillConfig)
The DrillConfig provides:
- the list of packages to scan. (drill.classpath.scanning.packages) IMPLEMENTATIONS_SCAN_PACKAGES
- the list of base classes to scan for implementations. (drill.classpath.scanning.base.classes) IMPLEMENTATIONS_SCAN_CLASSES
- the list of annotations to scan for. (drill.classpath.scanning.annotations) IMPLEMENTATIONS_SCAN_ANNOTATIONS
Only the class directories and jars containing a drill-module.conf will be scanned.
Drill core packages are scanned at build time and the result is saved in a JSON file.
At runtime only the locations that have not been scanned yet will be scanned.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Configuration pathname to turn off build time caching. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionforResource
(String resourcePathname, boolean returnRootPathname) Gets URLs of any classpath resources with given resource pathname.static ScanResult
fromPrescan
(DrillConfig config) static Collection<URL>
getConfigURLs
(String resourcePathName)
-
Field Details
-
IMPLEMENTATIONS_SCAN_CACHE
Configuration pathname to turn off build time caching.- See Also:
-
-
Constructor Details
-
ClassPathScanner
public ClassPathScanner()
-
-
Method Details
-
getConfigURLs
-
forResource
Gets URLs of any classpath resources with given resource pathname.- Parameters:
resourcePathname
- resource pathname of classpath resource instances to scan for (relative to specified class loaders' classpath roots)returnRootPathname
- whether to collect classpath root portion of URL for each resource instead of full URL of each resource- Returns:
- empty set if none
-
fromPrescan
-