Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A00E49A43 for ; Mon, 30 Jan 2012 18:12:51 +0000 (UTC) Received: (qmail 18670 invoked by uid 500); 30 Jan 2012 18:12:51 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 18545 invoked by uid 500); 30 Jan 2012 18:12:50 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 18537 invoked by uid 99); 30 Jan 2012 18:12:50 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2012 18:12:50 +0000 Received: from localhost (HELO mail-ww0-f46.google.com) (127.0.0.1) (smtp-auth username phunt, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2012 18:12:50 +0000 Received: by wgbdt14 with SMTP id dt14so4508276wgb.15 for ; Mon, 30 Jan 2012 10:12:48 -0800 (PST) Received: by 10.180.103.132 with SMTP id fw4mr21494957wib.3.1327947168360; Mon, 30 Jan 2012 10:12:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.39.94 with HTTP; Mon, 30 Jan 2012 10:12:27 -0800 (PST) In-Reply-To: References: From: Patrick Hunt Date: Mon, 30 Jan 2012 10:12:27 -0800 Message-ID: Subject: Re: getting the server version from a java client To: user@zookeeper.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable +1, that would be a good api addition. On Mon, Jan 30, 2012 at 10:10 AM, Mahadev Konar w= rote: > Keywal, > =A0Right now there isnt anyway for the client to tell which version of > server its talking to. You can probably hack something around the stat > command: > > echo stat | nc hostname clientport to get the version, but other than > that we dont have such an api. I think its probably worth having such > an api implemented. > > Here is the output of stat on my laptop: > > ----------------------- > Zookeeper version: 3.4.2--1, built on 01/30/2012 17:43 GMT > Clients: > =A0/127.0.0.1:54951[0](queued=3D0,recved=3D1,sent=3D0) > > Latency min/avg/max: 0/0/0 > Received: 1 > Sent: 0 > Outstanding: 0 > Zxid: 0x500000001 > Mode: follower > Node count: 7 > -------------------- > > thanks > mahadev > > On Mon, Jan 30, 2012 at 1:04 AM, N Keywal wrote: >> Hello, >> >> What's the recommended way for a client to get the version of the server >> it's connected to? >> >> I would like to write a (java) client that uses the "multi" function >> available since 3.4.x, with a fall-back implementation if the server is = a >> 3.3. Or at the very least to check that the server is a 3.4+ before usin= g >> "multi". >> >> I looked at the java client API but I didn't find a way to get this info= . >> >> When the client uses "multi" when connected to a 3.3 server, it hangs (I >> was hoping for something like KeeperException.UnimplementedException, bu= t >> it's not the case). >> >> Thanks in advance for your help, >> >> N. > > > > -- > Mahadev Konar > Hortonworks Inc. > http://hortonworks.com/