avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r965658 - in /avro/trunk: ./ lang/java/src/java/org/apache/avro/ipc/ lang/java/src/java/org/apache/avro/mapred/tether/ lang/java/src/java/org/apache/avro/tool/ lang/java/src/test/java/org/apache/avro/ lang/java/src/test/java/org/apache/avro...
Date Mon, 19 Jul 2010 22:09:49 GMT
Author: cutting
Date: Mon Jul 19 22:09:48 2010
New Revision: 965658

URL: http://svn.apache.org/viewvc?rev=965658&view=rev
Log:
AVRO-544.  Java: Add start() and join() methods to Server interface.  Contributed by hammer
& cutting.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/src/java/org/apache/avro/ipc/DatagramServer.java
    avro/trunk/lang/java/src/java/org/apache/avro/ipc/HttpServer.java
    avro/trunk/lang/java/src/java/org/apache/avro/ipc/NettyServer.java
    avro/trunk/lang/java/src/java/org/apache/avro/ipc/Server.java
    avro/trunk/lang/java/src/java/org/apache/avro/ipc/SocketServer.java
    avro/trunk/lang/java/src/java/org/apache/avro/mapred/tether/TetheredProcess.java
    avro/trunk/lang/java/src/java/org/apache/avro/tool/RpcReceiveTool.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestBulkData.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceReflect.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceSpecific.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolDatagram.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGeneric.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGenericMeta.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolHttp.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflect.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflectMeta.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecific.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecificMeta.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/TestNettyServer.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
    avro/trunk/lang/java/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Mon Jul 19 22:09:48 2010
@@ -7,6 +7,10 @@ Avro 1.4.0 (unreleased)
     AVRO-372.  Rename GenAvro to be Avro IDL.  The tool name is now
     'idl'.  The file suffix is now '.avdl'.  (cutting)
 
+    AVRO-544. Java: Change Server interface, adding start() and join()
+    methods.  Servers are no longer started in their constructor.
+    (hammer & cutting)
+
   NEW FEATURES
 
     AVRO-493. Add support for Hadoop Mapreduce with Avro data files. (cutting)

Modified: avro/trunk/lang/java/src/java/org/apache/avro/ipc/DatagramServer.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/ipc/DatagramServer.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/ipc/DatagramServer.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/ipc/DatagramServer.java Mon Jul 19 22:09:48
2010
@@ -50,7 +50,6 @@ public class DatagramServer extends Thre
 
     setName(name);
     setDaemon(true);
-    start();
   }
 
   public int getPort() { return channel.socket().getLocalPort(); }
@@ -72,6 +71,7 @@ public class DatagramServer extends Thre
 
   public static void main(String[] arg) throws Exception {
     DatagramServer server = new DatagramServer(null, new InetSocketAddress(0));
+    server.start();
     System.out.println("started");
     server.join();
   }

Modified: avro/trunk/lang/java/src/java/org/apache/avro/ipc/HttpServer.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/ipc/HttpServer.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/ipc/HttpServer.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/ipc/HttpServer.java Mon Jul 19 22:09:48
2010
@@ -29,20 +29,15 @@ import org.mortbay.jetty.servlet.Servlet
 public class HttpServer implements Server {
   private org.mortbay.jetty.Server server;
 
-  /** Starts a server on the named port. */
+  /** Constructs a server to run on the named port. */
   public HttpServer(Responder responder, int port) throws IOException {
     this(new ResponderServlet(responder), port);
   }
 
-  /** Starts a server on the named port. */
+  /** Constructs a server to run on the named port. */
   public HttpServer(ResponderServlet servlet, int port) throws IOException {
     this.server = new org.mortbay.jetty.Server(port);
-    new Context(server,"/").addServlet(new ServletHolder(servlet), "/*");
-    try {
-      server.start();
-    } catch (Exception e) {
-      throw new AvroRuntimeException(e);
-    }
+    new Context(server, "/").addServlet(new ServletHolder(servlet), "/*");
   }
 
   @Override
@@ -56,4 +51,22 @@ public class HttpServer implements Serve
       throw new AvroRuntimeException(e);
     }
   }
+
+  /** Start the server.
+   * @throws AvroRuntimeException if the underlying Jetty server
+   * throws any exception while starting.
+  */
+  @Override
+  public void start() {
+    try {
+      server.start();
+    } catch (Exception e) {
+      throw new AvroRuntimeException(e);
+    }
+  }
+
+  @Override
+  public void join() throws InterruptedException {
+    server.join();
+  }
 }

Modified: avro/trunk/lang/java/src/java/org/apache/avro/ipc/NettyServer.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/ipc/NettyServer.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/ipc/NettyServer.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/ipc/NettyServer.java Mon Jul 19 22:09:48
2010
@@ -67,7 +67,6 @@ public class NettyServer extends Thread 
 
     setName("AvroNettyServer on " + addr);
     setDaemon(true);
-    start();
   }
 
   @Override

Modified: avro/trunk/lang/java/src/java/org/apache/avro/ipc/Server.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/ipc/Server.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/ipc/Server.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/ipc/Server.java Mon Jul 19 22:09:48 2010
@@ -23,7 +23,13 @@ public interface Server {
   /** The port this server runs on. */
   int getPort();
 
+  /** Start this server. */
+  void start();
+
   /** Stop this server. */
   void close();
   
+  /** Wait for this server to exit. */
+  void join() throws InterruptedException;
+  
 }

Modified: avro/trunk/lang/java/src/java/org/apache/avro/ipc/SocketServer.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/ipc/SocketServer.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/ipc/SocketServer.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/ipc/SocketServer.java Mon Jul 19 22:09:48
2010
@@ -49,7 +49,6 @@ public class SocketServer extends Thread
 
     setName(name);
     setDaemon(true);
-    start();
   }
 
   public int getPort() { return channel.socket().getLocalPort(); }

Modified: avro/trunk/lang/java/src/java/org/apache/avro/mapred/tether/TetheredProcess.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/mapred/tether/TetheredProcess.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/mapred/tether/TetheredProcess.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/mapred/tether/TetheredProcess.java Mon Jul
19 22:09:48 2010
@@ -63,6 +63,7 @@ class TetheredProcess  {
       this.outputServer = new SocketServer
         (new SpecificResponder(OutputProtocol.class, outputService),
          new InetSocketAddress(0));
+      outputServer.start();
       
       // start sub-process, connecting back to server
       this.subprocess = startSubprocess(job);

Modified: avro/trunk/lang/java/src/java/org/apache/avro/tool/RpcReceiveTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/java/org/apache/avro/tool/RpcReceiveTool.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/java/org/apache/avro/tool/RpcReceiveTool.java (original)
+++ avro/trunk/lang/java/src/java/org/apache/avro/tool/RpcReceiveTool.java Mon Jul 19 22:09:48
2010
@@ -162,6 +162,7 @@ public class RpcReceiveTool implements T
     
     latch = new CountDownLatch(1);
     server = new HttpServer(new SinkResponder(protocol), uri.getPort());
+    server.start();
     out.println("Port: " + server.getPort());
     return 0;
   }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestBulkData.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestBulkData.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestBulkData.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestBulkData.java Mon Jul 19 22:09:48
2010
@@ -68,6 +68,7 @@ public class TestBulkData {
     server =
       new HttpServer(new SpecificResponder(BulkData.class, new BulkDataImpl()),
                      0);
+    server.start();
     client =
       new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
     proxy = (BulkData)SpecificRequestor.getClient(BulkData.class, client);

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceReflect.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceReflect.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceReflect.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceReflect.java Mon Jul 19
22:09:48 2010
@@ -33,6 +33,7 @@ public class TestNamespaceReflect extend
     if (server != null) return;
     server = new SocketServer(new ReflectResponder(TestNamespace.class, new TestImpl()),
                               new InetSocketAddress(0));
+    server.start();
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     proxy = (TestNamespace)ReflectRequestor.getClient(TestNamespace.class, client);
   }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceSpecific.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceSpecific.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceSpecific.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestNamespaceSpecific.java Mon Jul
19 22:09:48 2010
@@ -57,6 +57,7 @@ public class TestNamespaceSpecific {
     if (server != null) return;
     server = new SocketServer(new SpecificResponder(TestNamespace.class, new TestImpl()),
                               new InetSocketAddress(0));
+    server.start();
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     proxy = (TestNamespace)SpecificRequestor.getClient(TestNamespace.class, client);
   }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolDatagram.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolDatagram.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolDatagram.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolDatagram.java Mon Jul 19
22:09:48 2010
@@ -36,6 +36,7 @@ public class TestProtocolDatagram extend
       new DatagramServer(new SpecificResponder(Simple.class, new TestImpl()),
                          new InetSocketAddress("localhost",
                                                new Random().nextInt(10000)+10000));
+    server.start();
     client = new DatagramTransceiver(new InetSocketAddress("localhost", server.getPort()));
     proxy = (Simple)SpecificRequestor.getClient(Simple.class, client);
   }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGeneric.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGeneric.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGeneric.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGeneric.java Mon Jul 19
22:09:48 2010
@@ -101,6 +101,7 @@ public class TestProtocolGeneric {
   public void testStartServer() throws Exception {
     if (server != null) return;
     server = new SocketServer(new TestResponder(), new InetSocketAddress(0));
+    server.start();
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     requestor = new GenericRequestor(PROTOCOL, client);
   }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGenericMeta.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGenericMeta.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGenericMeta.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolGenericMeta.java Mon Jul
19 22:09:48 2010
@@ -34,6 +34,7 @@ public class TestProtocolGenericMeta ext
     responder.addRPCPlugin(new RPCMetaTestPlugin("key1"));
     responder.addRPCPlugin(new RPCMetaTestPlugin("key2"));
     server = new SocketServer(responder, new InetSocketAddress(0));
+    server.start();
     
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     requestor = new GenericRequestor(PROTOCOL, client);

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolHttp.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolHttp.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolHttp.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolHttp.java Mon Jul 19 22:09:48
2010
@@ -33,6 +33,7 @@ public class TestProtocolHttp extends Te
     if (server != null) return;
     server =
       new HttpServer(new SpecificResponder(Simple.class, new TestImpl()), 0);
+    server.start();
     client =
       new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
     proxy = (Simple)SpecificRequestor.getClient(Simple.class, client);

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflect.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflect.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflect.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflect.java Mon Jul 19
22:09:48 2010
@@ -72,6 +72,7 @@ public class TestProtocolReflect {
     if (server != null) return;
     server = new SocketServer(new ReflectResponder(Simple.class, new TestImpl()),
                               new InetSocketAddress(0));
+    server.start();
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     proxy = (Simple)ReflectRequestor.getClient(Simple.class, client);
   }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflectMeta.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflectMeta.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflectMeta.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolReflectMeta.java Mon Jul
19 22:09:48 2010
@@ -35,6 +35,7 @@ public class TestProtocolReflectMeta ext
     rresp.addRPCPlugin(new RPCMetaTestPlugin("key1"));
     rresp.addRPCPlugin(new RPCMetaTestPlugin("key2"));
     server = new SocketServer(rresp, new InetSocketAddress(0));
+    server.start();
     
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     ReflectRequestor requestor = new ReflectRequestor(Simple.class, client);

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecific.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecific.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecific.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecific.java Mon Jul 19
22:09:48 2010
@@ -75,6 +75,7 @@ public class TestProtocolSpecific {
     if (server != null) return;
     server = new SocketServer(new SpecificResponder(Simple.class, new TestImpl()),
                               new InetSocketAddress(0));
+    server.start();
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     proxy = (Simple)SpecificRequestor.getClient(Simple.class, client);
   }
@@ -186,6 +187,7 @@ public class TestProtocolSpecific {
       SocketServer server = new SocketServer(
           new SpecificResponder(Simple.class, new TestImpl()),
           new InetSocketAddress(0));
+      server.start();
       File portFile = new File(SERVER_PORTS_DIR, "java-port");
       FileWriter w = new FileWriter(portFile);
       w.write(Integer.toString(server.getPort()));

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecificMeta.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecificMeta.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecificMeta.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/TestProtocolSpecificMeta.java Mon Jul
19 22:09:48 2010
@@ -36,6 +36,7 @@ public class TestProtocolSpecificMeta ex
     responder.addRPCPlugin(new RPCMetaTestPlugin("key1"));
     responder.addRPCPlugin(new RPCMetaTestPlugin("key2"));
     server = new SocketServer(responder, new InetSocketAddress(0));
+    server.start();
     
     client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
     SpecificRequestor req = new SpecificRequestor(Simple.class, client);

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/TestNettyServer.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/TestNettyServer.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/TestNettyServer.java (original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/TestNettyServer.java Mon Jul 19
22:09:48 2010
@@ -28,6 +28,7 @@ public class TestNettyServer {
     System.out.println("starting server...");
     Responder responder = new SpecificResponder(Mail.class, new MailImpl());
     Server server = new NettyServer(responder, new InetSocketAddress(0));
+    server.start();
     Thread.sleep(1000); // waiting for server startup
 
     int serverPort = server.getPort();

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java
(original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/StatsPluginOverhead.java
Mon Jul 19 22:09:48 2010
@@ -97,7 +97,9 @@ public class StatsPluginOverhead {
       r.addRPCPlugin(new StatsPlugin());
     }
     // Start Avro server
-    return new HttpServer(r, 0);
+    HttpServer server = new HttpServer(r, 0);
+    server.start();
+    return server;
   }
 
 }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
(original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
Mon Jul 19 22:09:48 2010
@@ -166,15 +166,14 @@ public class TestStatsPluginAndServlet {
     r.addRPCPlugin(p);
 
     // Start Avro server
-    new HttpServer(r, Integer.parseInt(args[0]));
+    HttpServer avroServer = new HttpServer(r, Integer.parseInt(args[0]));
+    avroServer.start();
 
     // Ideally we could use the same Jetty server
     Server httpServer = new Server(Integer.parseInt(args[1]));
     new Context(httpServer, "/").addServlet(
         new ServletHolder(new StatsServlet(p)), "/*");
     httpServer.start();
-    while(true) {
-      Thread.sleep(60*1000);
-    }
+    httpServer.join();
   }
 }

Modified: avro/trunk/lang/java/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java?rev=965658&r1=965657&r2=965658&view=diff
==============================================================================
--- avro/trunk/lang/java/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java
(original)
+++ avro/trunk/lang/java/src/test/java/org/apache/avro/mapred/tether/TetherTaskRunner.java
Mon Jul 19 22:09:48 2010
@@ -46,6 +46,7 @@ public class TetherTaskRunner implements
     this.inputServer = new SocketServer
       (new SpecificResponder(InputProtocol.class, this),
        new InetSocketAddress(0));
+    inputServer.start();
 
     // open output to parent
     task.open(inputServer.getPort());



Mime
View raw message