Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 357BA200C13 for ; Mon, 23 Jan 2017 07:12:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 341D1160B59; Mon, 23 Jan 2017 06:12:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7AE3D160B45 for ; Mon, 23 Jan 2017 07:12:33 +0100 (CET) Received: (qmail 5597 invoked by uid 500); 23 Jan 2017 06:12:32 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 5586 invoked by uid 99); 23 Jan 2017 06:12:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2017 06:12:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B341B180028 for ; Mon, 23 Jan 2017 06:12:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id NhdRYtfJ_K5H for ; Mon, 23 Jan 2017 06:12:30 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6B6425FDC3 for ; Mon, 23 Jan 2017 06:12:30 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 05104E034F for ; Mon, 23 Jan 2017 06:12:26 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6805A25288 for ; Mon, 23 Jan 2017 06:12:26 +0000 (UTC) Date: Mon, 23 Jan 2017 06:12:26 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2671) Fix compilation error in branch-3.4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 23 Jan 2017 06:12:34 -0000 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15833945#comment-15833945 ] ASF GitHub Bot commented on ZOOKEEPER-2671: ------------------------------------------- Github user arshadmohammad commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/153#discussion_r97257715 --- Diff: src/java/test/org/apache/zookeeper/test/ClientBase.java --- @@ -664,4 +664,32 @@ public static String join(String separator, Object[] parts) { } return sb.toString(); } + + public static ZooKeeper createZKClient(String cxnString) throws Exception { + return createZKClient(cxnString, CONNECTION_TIMEOUT); + } + + /** + * Returns ZooKeeper client after connecting to ZooKeeper Server. Session + * timeout is {@link #CONNECTION_TIMEOUT} + * + * @param cxnString + * connection string in the form of host:port + * @param sessionTimeout + * @throws IOException + * in cases of network failure + */ + public static ZooKeeper createZKClient(String cxnString, int sessionTimeout) throws IOException { + CountdownWatcher watcher = new CountdownWatcher(); + ZooKeeper zk = new ZooKeeper(cxnString, sessionTimeout, watcher); + try { + watcher.waitForConnected(CONNECTION_TIMEOUT); + } catch (InterruptedException e) { + Assert.fail("ZooKeeper client can not connect to " + cxnString); + } + catch (TimeoutException e) { + Assert.fail("ZooKeeper client can not connect to " + cxnString); + } + return zk; + } } --- End diff -- Thanks Rakesh. Changes LGTM, +1 > Fix compilation error in branch-3.4 > ----------------------------------- > > Key: ZOOKEEPER-2671 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2671 > Project: ZooKeeper > Issue Type: Bug > Components: server > Reporter: Arshad Mohammad > Assignee: Arshad Mohammad > Fix For: 3.4.10 > > Attachments: ZOOKEEPER-2671-01.patch > > > branch-3.4 code compilation is failing. Following are the compilation erros: > {code} > compile-test: > [mkdir] Created dir: D:\gitHome\zookeeperTrunk\build\test\classes > [javac] Compiling 146 source files to D:\gitHome\zookeeperTrunk\build\test\classes > [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6 > [javac] D:\gitHome\zookeeperTrunk\src\java\test\org\apache\zookeeper\server\PurgeTxnTest.java:464: error: cannot find symbol > [javac] ZooKeeper zk = ClientBase.createZKClient(HOSTPORT); > [javac] ^ > [javac] symbol: method createZKClient(String) > [javac] location: class ClientBase > [javac] D:\gitHome\zookeeperTrunk\src\java\test\org\apache\zookeeper\server\PurgeTxnTest.java:503: error: cannot find symbol > [javac] zk = ClientBase.createZKClient(HOSTPORT); > [javac] ^ > [javac] symbol: method createZKClient(String) > [javac] location: class ClientBase > [javac] Note: Some input files use or override a deprecated API. > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)