Class ClassPathScanner

java.lang.Object
org.apache.drill.common.scanner.ClassPathScanner

public final class ClassPathScanner extends Object
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 Details

    • IMPLEMENTATIONS_SCAN_CACHE

      public static final String IMPLEMENTATIONS_SCAN_CACHE
      Configuration pathname to turn off build time caching.
      See Also:
  • Constructor Details

    • ClassPathScanner

      public ClassPathScanner()
  • Method Details

    • getConfigURLs

      public static Collection<URL> getConfigURLs(String resourcePathName)
    • forResource

      public static Set<URL> forResource(String resourcePathname, boolean returnRootPathname)
      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

      public static ScanResult fromPrescan(DrillConfig config)