Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/198#discussion_r41880888
--- 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 --
Let's change the fallback to "Unknown". Also, let's move this function to a
utility method in common. We may want to grab this information elsewhere.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---