Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-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 DFF02F5F2 for ; Tue, 30 Apr 2013 19:48:53 +0000 (UTC) Received: (qmail 51350 invoked by uid 500); 30 Apr 2013 19:48:53 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 51329 invoked by uid 500); 30 Apr 2013 19:48:53 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 51322 invoked by uid 99); 30 Apr 2013 19:48:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 19:48:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 19:48:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E8C5123889E7; Tue, 30 Apr 2013 19:48:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1477797 - in /accumulo/branches/1.4: ./ src/ src/core/ src/proxy/src/test/java/org/apache/accumulo/proxy/ src/server/ src/server/src/ src/server/src/main/java/org/apache/accumulo/server/zookeeper/ src/test/src/main/java/org/apache/accumulo... Date: Tue, 30 Apr 2013 19:48:29 -0000 To: commits@accumulo.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130430194829.E8C5123889E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ecn Date: Tue Apr 30 19:48:29 2013 New Revision: 1477797 URL: http://svn.apache.org/r1477797 Log: ACCUMULO-1365 use the MAC mechanism for finding a random port Modified: accumulo/branches/1.4/ (props changed) accumulo/branches/1.4/src/ (props changed) accumulo/branches/1.4/src/core/ (props changed) accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java accumulo/branches/1.4/src/server/ (props changed) accumulo/branches/1.4/src/server/src/ (props changed) accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java (props changed) accumulo/branches/1.4/src/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java Propchange: accumulo/branches/1.4/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5:r1477782 Propchange: accumulo/branches/1.4/src/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5:r1477782 Merged /accumulo/branches/1.5/src:r1477782 Propchange: accumulo/branches/1.4/src/core/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/core:r1477782 Modified: accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1477797&r1=1477796&r2=1477797&view=diff ============================================================================== --- accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original) +++ accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Tue Apr 30 19:48:29 2013 @@ -120,8 +120,7 @@ public class SimpleTest { protocolFactories.add(org.apache.thrift.protocol.TBinaryProtocol.Factory.class); protocolFactories.add(org.apache.thrift.protocol.TCompactProtocol.Factory.class); - Random rand = new Random(); - return protocolFactories.get(rand.nextInt(protocolFactories.size())); + return protocolFactories.get(random.nextInt(protocolFactories.size())); } @BeforeClass @@ -137,7 +136,7 @@ public class SimpleTest { protocolClass = getRandomProtocol(); System.out.println(protocolClass.getName()); - proxyPort = 40000 + random.nextInt(20000); + proxyPort = MiniAccumuloCluster.getRandomFreePort(); proxyServer = Proxy.createProxyServer(org.apache.accumulo.proxy.thrift.AccumuloProxy.class, org.apache.accumulo.proxy.ProxyServer.class, proxyPort, protocolClass, props); thread = new Thread() { Propchange: accumulo/branches/1.4/src/server/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/server:r1477782 Propchange: accumulo/branches/1.4/src/server/src/ ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/server/src:r1477782 Propchange: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java ------------------------------------------------------------------------------ Merged /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java:r1477782 Modified: accumulo/branches/1.4/src/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java?rev=1477797&r1=1477796&r2=1477797&view=diff ============================================================================== --- accumulo/branches/1.4/src/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java (original) +++ accumulo/branches/1.4/src/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java Tue Apr 30 19:48:29 2013 @@ -124,7 +124,7 @@ public class MiniAccumuloCluster { private MiniAccumuloConfig config; private Process[] tabletServerProcesses; - private int getRandomFreePort() { + static public int getRandomFreePort() { Random r = new Random(); int count = 0;