Return-Path: X-Original-To: apmail-tajo-commits-archive@minotaur.apache.org Delivered-To: apmail-tajo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6C32F1720E for ; Tue, 28 Oct 2014 02:21:26 +0000 (UTC) Received: (qmail 42631 invoked by uid 500); 28 Oct 2014 02:21:26 -0000 Delivered-To: apmail-tajo-commits-archive@tajo.apache.org Received: (qmail 42569 invoked by uid 500); 28 Oct 2014 02:21:26 -0000 Mailing-List: contact commits-help@tajo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tajo.apache.org Delivered-To: mailing list commits@tajo.apache.org Received: (qmail 42552 invoked by uid 99); 28 Oct 2014 02:21:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2014 02:21:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id EC2E69854BE; Tue, 28 Oct 2014 02:21:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jihoonson@apache.org To: commits@tajo.apache.org Date: Tue, 28 Oct 2014 02:21:25 -0000 Message-Id: <00c71985510e4c9397ab83bb7fb51bd8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/10] git commit: TAJO-1132: More detailed version info in tsql. Repository: tajo Updated Branches: refs/heads/index_support 561cae639 -> c669b62cd TAJO-1132: More detailed version info in tsql. Closes #211 Project: http://git-wip-us.apache.org/repos/asf/tajo/repo Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/b5f3a748 Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/b5f3a748 Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/b5f3a748 Branch: refs/heads/index_support Commit: b5f3a7481eb7af0c4004a27f0d16bf203a8c4620 Parents: d9ba02b Author: Hyunsik Choi Authored: Mon Oct 27 03:25:29 2014 -0700 Committer: Hyunsik Choi Committed: Mon Oct 27 03:25:29 2014 -0700 ---------------------------------------------------------------------- CHANGES | 2 ++ .../org/apache/tajo/cli/VersionCommand.java | 4 +-- .../java/org/apache/tajo/util/VersionInfo.java | 28 +++++++++++++++----- .../java/org/apache/tajo/master/TajoMaster.java | 2 +- 4 files changed, 26 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tajo/blob/b5f3a748/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index f4df30d..d239a19 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,8 @@ Release 0.9.1 - unreleased IMPROVEMENT + TAJO-1132: More detailed version info in tsql. (hyunsik) + TAJO-1125: Separate logical plan and optimizer into a maven module. (hyunsik) http://git-wip-us.apache.org/repos/asf/tajo/blob/b5f3a748/tajo-client/src/main/java/org/apache/tajo/cli/VersionCommand.java ---------------------------------------------------------------------- diff --git a/tajo-client/src/main/java/org/apache/tajo/cli/VersionCommand.java b/tajo-client/src/main/java/org/apache/tajo/cli/VersionCommand.java index c3a1f75..e92a8d4 100644 --- a/tajo-client/src/main/java/org/apache/tajo/cli/VersionCommand.java +++ b/tajo-client/src/main/java/org/apache/tajo/cli/VersionCommand.java @@ -33,7 +33,7 @@ public class VersionCommand extends TajoShellCommand { @Override public void invoke(String[] cmd) throws Exception { - context.getOutput().println(VersionInfo.getVersion()); + context.getOutput().println(VersionInfo.getDisplayVersion()); } @Override @@ -43,6 +43,6 @@ public class VersionCommand extends TajoShellCommand { @Override public String getDescription() { - return "show Apache License 2.0"; + return "show Tajo version"; } } http://git-wip-us.apache.org/repos/asf/tajo/blob/b5f3a748/tajo-common/src/main/java/org/apache/tajo/util/VersionInfo.java ---------------------------------------------------------------------- diff --git a/tajo-common/src/main/java/org/apache/tajo/util/VersionInfo.java b/tajo-common/src/main/java/org/apache/tajo/util/VersionInfo.java index 39e0f54..ce438dc 100644 --- a/tajo-common/src/main/java/org/apache/tajo/util/VersionInfo.java +++ b/tajo-common/src/main/java/org/apache/tajo/util/VersionInfo.java @@ -29,7 +29,7 @@ import java.io.InputStream; import java.util.Properties; /** - * This class returns build information about Hadoop components. + * This class returns build information about Tajo components. */ @InterfaceAudience.Private @InterfaceStability.Unstable @@ -95,8 +95,8 @@ public class VersionInfo { private static VersionInfo TAJO_VERSION_INFO = new VersionInfo("tajo"); /** - * Get the Hadoop version. - * @return the Hadoop version string, eg. "0.6.3-dev" + * Get the Tajo version. + * @return the Tajo version string, eg. "0.9.0-SNAPSHOT" */ public static String getVersion() { return TAJO_VERSION_INFO._getVersion(); @@ -119,7 +119,7 @@ public class VersionInfo { } /** - * The date that Hadoop was compiled. + * The date that Tajo was compiled. * @return the compilation date in unix date format */ public static String getDate() { @@ -127,7 +127,7 @@ public class VersionInfo { } /** - * The user that compiled Hadoop. + * The user that compiled Tajo. * @return the username of the user */ public static String getUser() { @@ -135,14 +135,14 @@ public class VersionInfo { } /** - * Get the subversion URL for the root Hadoop directory. + * Get the git repository URL for the root Tajo directory. */ public static String getUrl() { return TAJO_VERSION_INFO._getUrl(); } /** - * Get the checksum of the source files from which Hadoop was + * Get the checksum of the source files from which Tajo was * built. **/ public static String getSrcChecksum() { @@ -164,6 +164,20 @@ public class VersionInfo { return TAJO_VERSION_INFO._getProtocVersion(); } + /** + * Returns the display version including all information. + * @return + */ + public static String getDisplayVersion() { + StringBuilder displayVersion = new StringBuilder("Tajo ") + .append(VersionInfo.getVersion()).append(" (") + .append("rev. " + VersionInfo.getRevision().substring(0, 7)) + .append(" source checksum ").append(VersionInfo.getSrcChecksum().substring(0, 7)) + .append(" compiled by ").append(VersionInfo.getUser()).append(" ") + .append(VersionInfo.getDate()).append(")"); + return displayVersion.toString(); + } + public static void main(String[] args) { LOG.debug("version: "+ getVersion()); System.out.println("Tajo " + getVersion()); http://git-wip-us.apache.org/repos/asf/tajo/blob/b5f3a748/tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java ---------------------------------------------------------------------- diff --git a/tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java b/tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java index 8d4a41f..25e1be5 100644 --- a/tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java +++ b/tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java @@ -134,7 +134,7 @@ public class TajoMaster extends CompositeService { } public String getVersion() { - return VersionInfo.getVersion(); + return VersionInfo.getDisplayVersion(); } public TajoMasterClientService getTajoMasterClientService() {