Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,30 @@
package org.apache.drill.common.config;

public interface CommonConstants {
public static final String CONFIG_DEFAULT = "drill-default.conf";
public static final String CONFIG_OVERRIDE = "drill-override.conf";

public static final String LOGICAL_OPERATOR_SCAN_PACKAGES = "drill.logical.operator.packages";
public static final String PHYSICAL_OPERATOR_SCAN_PACKAGES = "drill.physical.operator.packages";
public static final String STORAGE_PLUGIN_CONFIG_SCAN_PACKAGES = "drill.logical.storage.packages";
public static final String DRILL_JAR_MARKER_FILE = "drill-module.conf";
public static final String LOGICAL_FUNCTION_SCAN_PACKAGES = "drill.logical.function.packages";

/** Default (base) configuration file name. (Classpath resource pathname.) */
String CONFIG_DEFAULT_RESOURCE_PATHNAME = "drill-default.conf";

/** Module configuration files name. (Classpath resource pathname.) */
String DRILL_JAR_MARKER_FILE_RESOURCE_PATHNAME = "drill-module.conf";

/** Override configuration file name. (Classpath resource pathname.) */
String CONFIG_OVERRIDE_RESOURCE_PATHNAME = "drill-override.conf";

/** Configuration pathname to list of names of packages to scan for logical
* operator subclasses. */
String LOGICAL_OPERATOR_SCAN_PACKAGES = "drill.logical.operator.packages";

/** Configuration pathname to list of names of packages to scan for physical
* operator subclasses. */
String PHYSICAL_OPERATOR_SCAN_PACKAGES = "drill.physical.operator.packages";

/** Configuration pathname to list of names of packages to scan for function
* subclasses. */
String LOGICAL_FUNCTION_SCAN_PACKAGES = "drill.logical.function.packages";

/** Configuration pathname to list of packages to scan for storage plugin
* configuration subclasses. */
String STORAGE_PLUGIN_CONFIG_SCAN_PACKAGES = "drill.logical.storage.packages";

}
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ public static DrillConfig create(String overrideFileName, boolean enableServerCo
}

private static DrillConfig create(String overrideFileName, Properties overriderProps, boolean enableServerConfigs) {
overrideFileName = overrideFileName == null ? CommonConstants.CONFIG_OVERRIDE : overrideFileName;
overrideFileName = overrideFileName == null ? CommonConstants.CONFIG_OVERRIDE_RESOURCE_PATHNAME : overrideFileName;

// first we load defaults.
Config fallback = null;
final ClassLoader[] classLoaders = ClasspathHelper.classLoaders();
for (ClassLoader classLoader : classLoaders) {
if (classLoader.getResource(CommonConstants.CONFIG_DEFAULT) != null) {
fallback = ConfigFactory.load(classLoader, CommonConstants.CONFIG_DEFAULT);
if (classLoader.getResource(CommonConstants.CONFIG_DEFAULT_RESOURCE_PATHNAME) != null) {
fallback = ConfigFactory.load(classLoader, CommonConstants.CONFIG_DEFAULT_RESOURCE_PATHNAME);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ public static <T> Set<Class<? extends T>> scanForImplementations(Class<T> baseCl
}

private static Collection<URL> getMarkedPaths() {
Collection<URL> urls = forResource(CommonConstants.DRILL_JAR_MARKER_FILE, true);
Collection<URL> urls = forResource(CommonConstants.DRILL_JAR_MARKER_FILE_RESOURCE_PATHNAME, true);
return urls;
}

public static Collection<URL> getConfigURLs() {
return forResource(CommonConstants.DRILL_JAR_MARKER_FILE, false);
return forResource(CommonConstants.DRILL_JAR_MARKER_FILE_RESOURCE_PATHNAME, false);
}

public static Set<URL> forResource(String name, boolean stripName, ClassLoader... classLoaders) {
Expand Down