drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject drill git commit: DRILL-3483: Clarify CommonConstants' constants. [CommonConstants, DrillConfig, PathScanner]
Date Thu, 16 Jul 2015 22:06:28 GMT
Repository: drill
Updated Branches:
  refs/heads/master aa5519943 -> 9b351c945


DRILL-3483: Clarify CommonConstants' constants.  [CommonConstants, DrillConfig, PathScanner]

Renamed constants.
Documented constants.
Removed extraneous "public static final" (redudant and abnormal since in interface).

Edit: Unwrapped a no-longer-long line.

closes #88


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/9b351c94
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/9b351c94
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/9b351c94

Branch: refs/heads/master
Commit: 9b351c945b5f10d27cf07b9b5c1a435a029614b7
Parents: aa55199
Author: dbarclay <dbarclay@maprtech.com>
Authored: Thu Jul 2 15:04:31 2015 -0700
Committer: Jason Altekruse <altekrusejason@gmail.com>
Committed: Thu Jul 16 15:06:09 2015 -0700

----------------------------------------------------------------------
 .../drill/common/config/CommonConstants.java    | 34 +++++++++++++++-----
 .../apache/drill/common/config/DrillConfig.java |  6 ++--
 .../apache/drill/common/util/PathScanner.java   |  4 +--
 3 files changed, 31 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/9b351c94/common/src/main/java/org/apache/drill/common/config/CommonConstants.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/config/CommonConstants.java b/common/src/main/java/org/apache/drill/common/config/CommonConstants.java
index 8a23cf3..78c4356 100644
--- a/common/src/main/java/org/apache/drill/common/config/CommonConstants.java
+++ b/common/src/main/java/org/apache/drill/common/config/CommonConstants.java
@@ -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";
+
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/9b351c94/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/config/DrillConfig.java b/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
index 522303f..fe43b4a 100644
--- a/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
+++ b/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
@@ -143,14 +143,14 @@ public final class DrillConfig extends NestedConfig{
   }
 
   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;
       }
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/9b351c94/common/src/main/java/org/apache/drill/common/util/PathScanner.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/util/PathScanner.java b/common/src/main/java/org/apache/drill/common/util/PathScanner.java
index 730c770..c322643 100644
--- a/common/src/main/java/org/apache/drill/common/util/PathScanner.java
+++ b/common/src/main/java/org/apache/drill/common/util/PathScanner.java
@@ -100,12 +100,12 @@ public class PathScanner {
   }
 
   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) {


Mime
View raw message