Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAE7018CDE for ; Wed, 24 Feb 2016 15:28:18 +0000 (UTC) Received: (qmail 39291 invoked by uid 500); 24 Feb 2016 15:28:18 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 39248 invoked by uid 500); 24 Feb 2016 15:28:18 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 39201 invoked by uid 99); 24 Feb 2016 15:28:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 15:28:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 5D9E92C1F5C for ; Wed, 24 Feb 2016 15:28:18 +0000 (UTC) Date: Wed, 24 Feb 2016 15:28:18 +0000 (UTC) From: "Joshua McKenzie (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8890) Enhance cassandra-env.sh to handle Java version output in case of OpenJDK icedtea" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15163185#comment-15163185 ] Joshua McKenzie commented on CASSANDRA-8890: -------------------------------------------- [~mshuler] - are you going to be able to get to this or should we dig up another reviewer? Thanks! > Enhance cassandra-env.sh to handle Java version output in case of OpenJDK icedtea" > ---------------------------------------------------------------------------------- > > Key: CASSANDRA-8890 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8890 > Project: Cassandra > Issue Type: Improvement > Components: Configuration > Environment: Red Hat Enterprise Linux Server release 6.4 (Santiago) > Reporter: Sumod Pawgi > Assignee: Brandon Williams > Priority: Minor > Labels: conf, icedtea > Fix For: 3.x > > Attachments: 8890-v2.txt, trunk-8890.patch, trunk-8890.txt > > > Where observed - > Cassandra node has OpenJDK - > java version "1.7.0_09-icedtea" > In some situations, external agents trying to monitor a C* cluster would need to run cassandra -v command to determine the Cassandra version and would expect a numerical output e.g. java version "1.7.0_75" as in case of Oracle JDK. But if the cluster has OpenJDK IcedTea installed, then this condition is not satisfied and the agents will not work correctly as the output from "cassandra -v" is > /opt/apache/cassandra/bin/../conf/cassandra-env.sh: line 102: [: 09-icedtea: integer expression expected > Cause - > The line which is causing this behavior is - > jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR==1 {print $2}'` > Suggested enhancement - > If we change the line to - > jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR==1 {print $2}' | awk 'BEGIN {FS="-"};{print $1}'`, > it will give $jvmver as - 1.7.0_09 for the above case. > Can we add this enhancement in the cassandra-env.sh? I would like to add it myself and submit for review, but I am not familiar with C* check in process. There might be better ways to do this, but I thought of this to be simplest and as the edition is at the end of the line, it will be easy to reverse if needed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)