drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tgrall <...@git.apache.org>
Subject [GitHub] drill pull request: Add Drill version, from Manifest, same as SqlL...
Date Tue, 13 Oct 2015 15:36:04 GMT
Github user tgrall commented on a diff in the pull request:

    https://github.com/apache/drill/pull/198#discussion_r41883009
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/VersionIterator.java
---
    @@ -73,5 +78,33 @@ public void remove() {
         throw new UnsupportedOperationException();
       }
     
    +  /**
    +   *
    +   * @return version number x.y.z from Manifest file
    +   */
    +  private static String getDrillVersionFromManifest() {
    +    String appName = "";
    +    String appVersion = "";
    +    try {
    +      Enumeration<URL> resources = VersionInfo.class.getClassLoader()
    +              .getResources("META-INF/MANIFEST.MF");
    +      while (resources.hasMoreElements()) {
    +        Manifest manifest = new Manifest(resources.nextElement().openStream());
    +        // check that this is your manifest and do what you need or
    +        // get the next one
    +        appName = manifest.getMainAttributes()
    +                .getValue("Implementation-Title");
    +        if (appName != null && appName.toLowerCase().contains("drill")) {
    +          appVersion = manifest.getMainAttributes()
    +                  .getValue("Implementation-Version");
    +        }
    +      }
    +    } catch (IOException except) {
    +      appVersion = "";
    --- End diff --
    
    Do you want me to move the getVersion method in this package:
    https://github.com/apache/drill/tree/master/common/src/main/java/org/apache/drill/common/util
?
    
    Should I move the full VersionIterator there? and call it from the store.sys?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message