zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f..@apache.org
Subject svn commit: r1564946 [4/4] - in /zookeeper/bookkeeper/trunk: ./ bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/ bookkeeper-benchmark/src/test/java/org/apache/bookkeeper/benchmark/ bookkeeper-server/src/main/java/org/apache/bookkeepe...
Date Wed, 05 Feb 2014 21:43:40 GMT
Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java?rev=1564946&r1=1564945&r2=1564946&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
Wed Feb  5 21:43:39 2014
@@ -22,7 +22,6 @@ package org.apache.bookkeeper.test;
  */
 
 import java.io.File;
-import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.concurrent.Executors;
@@ -32,6 +31,7 @@ import junit.framework.TestCase;
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.conf.ServerConfiguration;
+import org.apache.bookkeeper.net.BookieSocketAddress;
 import org.apache.bookkeeper.conf.TestBKConfiguration;
 import org.apache.bookkeeper.proto.BookieClient;
 import org.apache.bookkeeper.proto.BookieProtocol;
@@ -116,7 +116,7 @@ public class BookieClientTest extends Te
     };
 
     WriteCallback wrcb = new WriteCallback() {
-        public void writeComplete(int rc, long ledgerId, long entryId, InetSocketAddress
addr, Object ctx) {
+        public void writeComplete(int rc, long ledgerId, long entryId, BookieSocketAddress
addr, Object ctx) {
             if (ctx != null) {
                 synchronized (ctx) {
                     ctx.notifyAll();
@@ -130,7 +130,7 @@ public class BookieClientTest extends Te
         final Object notifyObject = new Object();
         byte[] passwd = new byte[20];
         Arrays.fill(passwd, (byte) 'a');
-        InetSocketAddress addr = new InetSocketAddress("127.0.0.1", port);
+        BookieSocketAddress addr = new BookieSocketAddress("127.0.0.1", port);
         ResultStruct arc = new ResultStruct();
 
         BookieClient bc = new BookieClient(new ClientConfiguration(), channelFactory, executor);
@@ -233,7 +233,7 @@ public class BookieClientTest extends Te
     @Test(timeout=60000)
     public void testNoLedger() throws Exception {
         ResultStruct arc = new ResultStruct();
-        InetSocketAddress addr = new InetSocketAddress("127.0.0.1", port);
+        BookieSocketAddress addr = new BookieSocketAddress("127.0.0.1", port);
         BookieClient bc = new BookieClient(new ClientConfiguration(), channelFactory, executor);
         synchronized (arc) {
             bc.readEntry(addr, 2, 13, recb, arc);

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConcurrentLedgerTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConcurrentLedgerTest.java?rev=1564946&r1=1564945&r2=1564946&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConcurrentLedgerTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConcurrentLedgerTest.java
Wed Feb  5 21:43:39 2014
@@ -23,7 +23,6 @@ package org.apache.bookkeeper.test;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -33,6 +32,7 @@ import junit.framework.TestCase;
 import org.apache.bookkeeper.bookie.Bookie;
 import org.apache.bookkeeper.bookie.BookieException;
 import org.apache.bookkeeper.conf.ServerConfiguration;
+import org.apache.bookkeeper.net.BookieSocketAddress;
 import org.apache.bookkeeper.conf.TestBKConfiguration;
 import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.WriteCallback;
 import org.junit.After;
@@ -158,7 +158,7 @@ public class ConcurrentLedgerTest extend
         WriteCallback cb = new WriteCallback() {
             @Override
             public void writeComplete(int rc, long ledgerId, long entryId,
-            InetSocketAddress addr, Object ctx) {
+                    BookieSocketAddress addr, Object ctx) {
                 AtomicInteger counter = (AtomicInteger)ctx;
                 counter.getAndIncrement();
                 throttle.release();

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java?rev=1564946&r1=1564945&r2=1564946&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java
Wed Feb  5 21:43:39 2014
@@ -18,12 +18,10 @@
  * under the License.
  *
  */
-
 package org.apache.bookkeeper.test;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Random;

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/LoopbackClient.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/LoopbackClient.java?rev=1564946&r1=1564945&r2=1564946&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/LoopbackClient.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/LoopbackClient.java
Wed Feb  5 21:43:39 2014
@@ -21,22 +21,21 @@ package org.apache.bookkeeper.test;
  *
  */
 
-import java.net.InetSocketAddress;
 import java.io.IOException;
-import java.lang.InterruptedException;
 import java.util.Arrays;
 import java.util.concurrent.Executors;
 
 import org.apache.bookkeeper.conf.ClientConfiguration;
+import org.apache.bookkeeper.net.BookieSocketAddress;
 import org.apache.bookkeeper.proto.BookieClient;
 import org.apache.bookkeeper.proto.BookieProtocol;
 import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.WriteCallback;
 import org.apache.bookkeeper.util.OrderedSafeExecutor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.jboss.netty.buffer.ChannelBuffers;
 import org.jboss.netty.channel.socket.ClientSocketChannelFactory;
 import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class tests BookieClient. It just sends the a new entry to itself.
@@ -73,7 +72,7 @@ class LoopbackClient implements WriteCal
         this.begin = begin;
     }
 
-    void write(long ledgerId, long entry, byte[] data, InetSocketAddress addr, WriteCallback
cb, Object ctx)
+    void write(long ledgerId, long entry, byte[] data, BookieSocketAddress addr, WriteCallback
cb, Object ctx)
             throws IOException, InterruptedException {
         LOG.info("Ledger id: " + ledgerId + ", Entry: " + entry);
         byte[] passwd = new byte[20];
@@ -82,7 +81,7 @@ class LoopbackClient implements WriteCal
         client.addEntry(addr, ledgerId, passwd, entry, ChannelBuffers.wrappedBuffer(data),
cb, ctx, BookieProtocol.FLAG_NONE);
     }
 
-    public void writeComplete(int rc, long ledgerId, long entryId, InetSocketAddress addr,
Object ctx) {
+    public void writeComplete(int rc, long ledgerId, long entryId, BookieSocketAddress addr,
Object ctx) {
         Counter counter = (Counter) ctx;
         counter.increment();
     }
@@ -99,7 +98,7 @@ class LoopbackClient implements WriteCal
                 .newCachedThreadPool());
         OrderedSafeExecutor executor = new OrderedSafeExecutor(2, "BookieClientScheduler");
         try {
-            InetSocketAddress addr = new InetSocketAddress("127.0.0.1", Integer.valueOf(args[2]).intValue());
+            BookieSocketAddress addr = new BookieSocketAddress("127.0.0.1", Integer.valueOf(args[2]).intValue());
             lb = new LoopbackClient(channelFactory, executor, begin, limit.intValue());
 
             for (int i = 0; i < limit; i++) {

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/BookieBenchmark.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/BookieBenchmark.java?rev=1564946&r1=1564945&r2=1564946&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/BookieBenchmark.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/main/java/org/apache/hedwig/server/benchmark/BookieBenchmark.java
Wed Feb  5 21:43:39 2014
@@ -17,12 +17,12 @@
  */
 package org.apache.hedwig.server.benchmark;
 
-import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Semaphore;
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.client.BKException;
+import org.apache.bookkeeper.net.BookieSocketAddress;
 import org.apache.bookkeeper.proto.BookieClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,7 +39,7 @@ public class BookieBenchmark extends Abs
     static final Logger logger = LoggerFactory.getLogger(BookkeeperBenchmark.class);
 
     BookieClient bkc;
-    InetSocketAddress addr;
+    BookieSocketAddress addr;
     ClientSocketChannelFactory channelFactory;
     OrderedSafeExecutor executor = new OrderedSafeExecutor(1, "BookieBenchmarkScheduler");
 
@@ -48,8 +48,7 @@ public class BookieBenchmark extends Abs
         channelFactory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
         bkc = new BookieClient(new ClientConfiguration(), channelFactory, executor);
         String[] hostPort = bookieHostPort.split(":");
-        addr = new InetSocketAddress(hostPort[0], Integer.parseInt(hostPort[1]));
-
+        addr = new BookieSocketAddress(hostPort[0], Integer.parseInt(hostPort[1]));
     }
 
 
@@ -64,7 +63,7 @@ public class BookieBenchmark extends Abs
 
             @Override
             public void writeComplete(int rc, long ledgerId, long entryId,
-            InetSocketAddress addr, Object ctx) {
+            BookieSocketAddress addr, Object ctx) {
                 handler.handle(rc == BKException.Code.OK, ctx);
             }
         };



Mime
View raw message