storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/6] storm git commit: [STORM-2537] Resolved checkstyle violations for storm-webapp module
Date Fri, 02 Jun 2017 15:55:05 GMT
Repository: storm
Updated Branches:
  refs/heads/master 3f5bac032 -> 716ca5e5c


[STORM-2537] Resolved checkstyle violations for storm-webapp module


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/c46b49a9
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/c46b49a9
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/c46b49a9

Branch: refs/heads/master
Commit: c46b49a973fae5c0624801d7ecc51c5775f90248
Parents: 465c9c6
Author: Sumedh Shekhar <sumedhhere@gmail.com>
Authored: Tue May 30 01:09:39 2017 +0530
Committer: Sumedh Shekhar <sumedhhere@gmail.com>
Committed: Tue May 30 01:09:39 2017 +0530

----------------------------------------------------------------------
 bin/storm.py                                    |   2 +-
 .../apache/storm/daemon/drpc/DRPCServer.java    | 119 +++++++++++--------
 .../webapp/AuthorizationExceptionMapper.java    |   1 +
 .../daemon/drpc/webapp/DRPCApplication.java     |  20 ++--
 .../daemon/drpc/webapp/DRPCExceptionMapper.java |   3 +-
 .../storm/daemon/drpc/webapp/DRPCResource.java  |  23 ++--
 .../daemon/drpc/webapp/ReqContextFilter.java    |  24 +++-
 .../storm/daemon/drpc/DRPCServerTest.java       |  24 ++--
 8 files changed, 128 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/bin/storm.py
----------------------------------------------------------------------
diff --git a/bin/storm.py b/bin/storm.py
index 521895b..3ba8c85 100755
--- a/bin/storm.py
+++ b/bin/storm.py
@@ -796,7 +796,7 @@ def drpc():
     allextrajars = get_wildcard_dir(STORM_WEBAPP_LIB_DIR)
     allextrajars.append(CLUSTER_CONF_DIR)
     exec_storm_class(
-        "org.apache.storm.daemon.drpc.DRPCServer",
+        "org.apache.storm.daemon.drpc.DrpcServer",
         jvmtype="-server",
         daemonName="drpc",
         jvmopts=jvmopts,

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/DRPCServer.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/DRPCServer.java b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/DRPCServer.java
index 3e37ad7..1f13903 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/DRPCServer.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/DRPCServer.java
@@ -15,15 +15,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.daemon.drpc;
 
+import com.codahale.metrics.Meter;
+import com.google.common.annotations.VisibleForTesting;
+
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.storm.Config;
 import org.apache.storm.DaemonConfig;
-import org.apache.storm.daemon.drpc.webapp.DRPCApplication;
+import org.apache.storm.daemon.drpc.webapp.DrpcApplication;
 import org.apache.storm.daemon.drpc.webapp.ReqContextFilter;
 import org.apache.storm.generated.DistributedRPC;
 import org.apache.storm.generated.DistributedRPCInvocations;
@@ -45,14 +49,18 @@ import org.glassfish.jersey.servlet.ServletContainer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.codahale.metrics.Meter;
-import com.google.common.annotations.VisibleForTesting;
-
-public class DRPCServer implements AutoCloseable {
-    private static final Logger LOG = LoggerFactory.getLogger(DRPCServer.class);
-    private final static Meter meterShutdownCalls = StormMetricsRegistry.registerMeter("drpc:num-shutdown-calls");
+public class DrpcServer implements AutoCloseable {
+    private static final Logger LOG = LoggerFactory.getLogger(DrpcServer.class);
+    private static final Meter meterShutdownCalls = StormMetricsRegistry.registerMeter("drpc:num-shutdown-calls");
    
     //TODO in the future this might be better in a common webapp location
+
+    /**
+     * Add a request context filter to the Servlet Context Handler.
+     * @param context The Servlet Context handler
+     * @param configName Config name
+     * @param conf Conf to be added in context filter
+     */
     public static void addRequestContextFilter(ServletContextHandler context, String configName,
Map<String, Object> conf) {
         IHttpCredentialsPlugin auth = AuthUtils.GetHttpCredentialsPlugin(conf, (String)conf.get(configName));
         ReqContextFilter filter = new ReqContextFilter(auth);
@@ -95,11 +103,11 @@ public class DRPCServer implements AutoCloseable {
             final Boolean httpsNeedClientAuth = (Boolean) (conf.get(DaemonConfig.DRPC_HTTPS_NEED_CLIENT_AUTH));
 
             //TODO a better way to do this would be great.
-            DRPCApplication.setup(drpc);
+            DrpcApplication.setup(drpc);
             ret = UIHelpers.jettyCreateServer(drpcHttpPort, null, httpsPort);
             
-            UIHelpers.configSsl(ret, httpsPort, httpsKsPath, httpsKsPassword, httpsKsType,
httpsKeyPassword, httpsTsPath, httpsTsPassword, httpsTsType,
-                    httpsNeedClientAuth, httpsWantClientAuth);
+            UIHelpers.configSsl(ret, httpsPort, httpsKsPath, httpsKsPassword, httpsKsType,
httpsKeyPassword,
+                    httpsTsPath, httpsTsPassword, httpsTsType, httpsNeedClientAuth, httpsWantClientAuth);
             
             ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
             context.setContextPath("/");
@@ -107,7 +115,7 @@ public class DRPCServer implements AutoCloseable {
 
             ServletHolder jerseyServlet = context.addServlet(ServletContainer.class, "/*");
             jerseyServlet.setInitOrder(1);
-            jerseyServlet.setInitParameter("javax.ws.rs.Application", DRPCApplication.class.getName());
+            jerseyServlet.setInitParameter("javax.ws.rs.Application", DrpcApplication.class.getName());
             
             UIHelpers.configFilters(context, filterConfigurations);
             addRequestContextFilter(context, Config.DRPC_HTTP_CREDS_PLUGIN, conf);
@@ -115,96 +123,103 @@ public class DRPCServer implements AutoCloseable {
         return ret;
     }
     
-    private final DRPC _drpc;
-    private final ThriftServer _handlerServer;
-    private final ThriftServer _invokeServer;
-    private final Server _httpServer;
-    private Thread _handlerServerThread;
-    private boolean _closed = false;
-
-    public DRPCServer(Map<String, Object> conf) {
-        _drpc = new DRPC(conf);
-        DRPCThrift thrift = new DRPCThrift(_drpc);
-        _handlerServer = mkHandlerServer(thrift, ObjectReader.getInt(conf.get(Config.DRPC_PORT),
null), conf);
-        _invokeServer = mkInvokeServer(thrift, ObjectReader.getInt(conf.get(Config.DRPC_INVOCATIONS_PORT),
3773), conf);
-        _httpServer = mkHttpServer(conf, _drpc);
+    private final DRPC drpc;
+    private final ThriftServer handlerServer;
+    private final ThriftServer invokeServer;
+    private final Server httpServer;
+    private Thread handlerServerThread;
+    private boolean closed = false;
+
+    /**
+     * Constructor.
+     * @param conf Drpc conf dor the servers
+     */
+    public DrpcServer(Map<String, Object> conf) {
+        drpc = new DRPC(conf);
+        DRPCThrift thrift = new DRPCThrift(drpc);
+        handlerServer = mkHandlerServer(thrift, ObjectReader.getInt(conf.get(Config.DRPC_PORT),
null), conf);
+        invokeServer = mkInvokeServer(thrift, ObjectReader.getInt(conf.get(Config.DRPC_INVOCATIONS_PORT),
3773), conf);
+        httpServer = mkHttpServer(conf, drpc);
     }
 
     @VisibleForTesting
     void start() throws Exception {
         LOG.info("Starting Distributed RPC servers...");
-        new Thread(() -> _invokeServer.serve()).start();
+        new Thread(() -> invokeServer.serve()).start();
         
-        if (_httpServer != null) {
-            _httpServer.start();
+        if (httpServer != null) {
+            httpServer.start();
         }
         
-        if (_handlerServer != null) {
-            _handlerServerThread = new Thread(_handlerServer::serve);
-            _handlerServerThread.start();
+        if (handlerServer != null) {
+            handlerServerThread = new Thread(handlerServer::serve);
+            handlerServerThread.start();
         }
     }
     
     @VisibleForTesting
     void awaitTermination() throws InterruptedException {
-        if(_handlerServerThread != null) {
-            _handlerServerThread.join();
+        if (handlerServerThread != null) {
+            handlerServerThread.join();
         } else {
-            _httpServer.join();
+            httpServer.join();
         }
     }
 
     @Override
     public synchronized void close() {
-        if (!_closed) {
+        if (!closed) {
             //This is kind of useless...
             meterShutdownCalls.mark();
 
-            if (_handlerServer != null) {
-                _handlerServer.stop();
+            if (handlerServer != null) {
+                handlerServer.stop();
             }
 
-            if (_invokeServer != null) {
-                _invokeServer.stop();
+            if (invokeServer != null) {
+                invokeServer.stop();
             }
 
             //TODO this is causing issues...
-            //if (_httpServer != null) {
-            //    _httpServer.destroy();
+            //if (httpServer != null) {
+            //    httpServer.destroy();
             //}
             
-            _drpc.close();
-            _closed  = true;
+            drpc.close();
+            closed = true;
         }
     }
     
     /**
-     * @return The port the DRPC handler server is listening on
+     * @return The port the DRPC handler server is listening on.
      */
-    public int getDRPCPort() {
-        return _handlerServer.getPort();
+    public int getDrpcPort() {
+        return handlerServer.getPort();
     }
     
     /**
-     * @return The port the DRPC invoke server is listening on
+     * @return The port the DRPC invoke server is listening on.
      */
-    public int getDRPCInvokePort() {
-        return _invokeServer.getPort();
+    public int getDrpcInvokePort() {
+        return invokeServer.getPort();
     }
     
     /**
      * @return The port the HTTP server is listening on. Not available until {@link #start()
} has run.
      */
     public int getHttpServerPort() {
-        assert _httpServer.getConnectors().length == 1;
+        assert httpServer.getConnectors().length == 1;
         
-        return _httpServer.getConnectors()[0].getLocalPort();
+        return httpServer.getConnectors()[0].getLocalPort();
     }
-    
+
+    /**
+     * Main method to start the server.
+     */
     public static void main(String [] args) throws Exception {
         Utils.setupDefaultUncaughtExceptionHandler();
         Map<String, Object> conf = Utils.readStormConfig();
-        try (DRPCServer server = new DRPCServer(conf)) {
+        try (DrpcServer server = new DrpcServer(conf)) {
             Utils.addShutdownHookWithForceKillIn1Sec(() -> server.close());
             StormMetricsRegistry.startMetricsReporters(conf);
             server.start();

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/AuthorizationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/AuthorizationExceptionMapper.java
b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/AuthorizationExceptionMapper.java
index ef1e429..fcef715 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/AuthorizationExceptionMapper.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/AuthorizationExceptionMapper.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.daemon.drpc.webapp;
 
 import java.util.HashMap;

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCApplication.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCApplication.java
b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCApplication.java
index b209abb..5dc31ab 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCApplication.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCApplication.java
@@ -15,9 +15,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.storm.daemon.drpc.webapp;
 
-import org.apache.storm.daemon.drpc.DRPC;
+package org.apache.storm.daemon.drpc.webapp;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -25,14 +24,21 @@ import java.util.Set;
 import javax.ws.rs.ApplicationPath;
 import javax.ws.rs.core.Application;
 
+import org.apache.storm.daemon.drpc.DRPC;
+
 @ApplicationPath("")
-public class DRPCApplication extends Application {
+public class DrpcApplication extends Application {
     private static DRPC _drpc;
     private final Set<Object> singletons = new HashSet<Object>();
-    
-    public DRPCApplication() {
-        singletons.add(new DRPCResource(_drpc));
-        singletons.add(new DRPCExceptionMapper());
+
+    /**
+     * Constructor.
+     * Creates new instance of DrpcResource, DrpcExceptionMapper and AuthorizationExceptionMapper
+     * and adds them to a set which can be retrieved later.
+     */
+    public DrpcApplication() {
+        singletons.add(new DrpcResource(_drpc));
+        singletons.add(new DrpcExceptionMapper());
         singletons.add(new AuthorizationExceptionMapper());
     }
     

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCExceptionMapper.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCExceptionMapper.java
b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCExceptionMapper.java
index 34b1f8d..829e1db 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCExceptionMapper.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCExceptionMapper.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.daemon.drpc.webapp;
 
 import java.util.HashMap;
@@ -29,7 +30,7 @@ import org.apache.storm.generated.DRPCExecutionException;
 import org.json.simple.JSONValue;
 
 @Provider
-public class DRPCExceptionMapper implements ExceptionMapper<DRPCExecutionException>
{
+public class DrpcExceptionMapper implements ExceptionMapper<DRPCExecutionException>
{
 
     @Override
     public Response toResponse(DRPCExecutionException ex) {

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCResource.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCResource.java
b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCResource.java
index 3708867..04c190f 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCResource.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/DRPCResource.java
@@ -15,8 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.daemon.drpc.webapp;
 
+import com.codahale.metrics.Meter;
+
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -28,14 +31,13 @@ import org.apache.storm.daemon.drpc.DRPC;
 import org.apache.storm.metric.StormMetricsRegistry;
 import org.apache.thrift.TException;
 
-import com.codahale.metrics.Meter;
-
 @Path("/drpc/")
-public class DRPCResource {
+public class DrpcResource {
     private static final Meter meterHttpRequests = StormMetricsRegistry.registerMeter("drpc:num-execute-http-requests");
-    private final DRPC _drpc;
-    public DRPCResource(DRPC drpc) {
-        _drpc = drpc;
+    private final DRPC drpc;
+
+    public DrpcResource(DRPC drpc) {
+        this.drpc = drpc;
     }
     
     //TODO put in some better exception mapping...
@@ -44,20 +46,21 @@ public class DRPCResource {
     @Path("/{func}") 
     public String post(@PathParam("func") String func, String args, @Context HttpServletRequest
request) throws TException {
         meterHttpRequests.mark();
-        return _drpc.executeBlocking(func, args);
+        return drpc.executeBlocking(func, args);
     }
     
     @GET
     @Path("/{func}/{args}") 
-    public String get(@PathParam("func") String func, @PathParam("args") String args, @Context
HttpServletRequest request) throws TException {
+    public String get(@PathParam("func") String func, @PathParam("args") String args,
+                      @Context HttpServletRequest request) throws TException {
         meterHttpRequests.mark();
-        return _drpc.executeBlocking(func, args);
+        return drpc.executeBlocking(func, args);
     }
     
     @GET
     @Path("/{func}") 
     public String get(@PathParam("func") String func, @Context HttpServletRequest request)
throws TException {
         meterHttpRequests.mark();
-        return _drpc.executeBlocking(func, "");
+        return drpc.executeBlocking(func, "");
     }
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/ReqContextFilter.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/ReqContextFilter.java
b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/ReqContextFilter.java
index 8dcd098..cec6828 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/ReqContextFilter.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/drpc/webapp/ReqContextFilter.java
@@ -15,7 +15,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.daemon.drpc.webapp;
+
 import java.io.IOException;
 
 import javax.servlet.Filter;
@@ -31,10 +33,10 @@ import org.apache.storm.security.auth.IHttpCredentialsPlugin;
 import org.apache.storm.security.auth.ReqContext;
 
 public class ReqContextFilter implements Filter {
-    private final IHttpCredentialsPlugin _httpCredsHandler;
+    private final IHttpCredentialsPlugin httpCredsHandler;
 
     public ReqContextFilter(IHttpCredentialsPlugin httpCredsHandler) {
-        _httpCredsHandler = httpCredsHandler;
+        this.httpCredsHandler = httpCredsHandler;
     }
     
     /**
@@ -42,8 +44,8 @@ public class ReqContextFilter implements Filter {
      * @param request the request to populate
      */
     public void populateContext(HttpServletRequest request) {
-        if (_httpCredsHandler != null) {
-            _httpCredsHandler.populateContext(ReqContext.context(), request);
+        if (httpCredsHandler != null) {
+            httpCredsHandler.populateContext(ReqContext.context(), request);
         }
     }
     
@@ -52,11 +54,23 @@ public class ReqContextFilter implements Filter {
         //We could add in configs through the web.xml if we wanted something stand alone
here...
     }
 
+    /**
+     * A filter which populates the request if it is null and then passes it on to the next
entity in the chain.
+     * @param request the request to populate
+     * @param response the response to populate
+     * @param chain the next chain of entities to pass the object to
+     */
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
         handle((HttpServletRequest)request, (HttpServletResponse)response, chain);
     }
 
-    public void handle(HttpServletRequest request, HttpServletResponse response, FilterChain
chain) throws IOException, ServletException{
+    /**
+     * A method used by doFilter which populates the request if it is null and then passes
it on to the next entity in the chain.
+     * @param request the request to populate
+     * @param response the response to populate
+     * @param chain the next chain of entities to pass the object to
+     */
+    public void handle(HttpServletRequest request, HttpServletResponse response, FilterChain
chain) throws IOException, ServletException {
         if (request != null) {
             populateContext(request);
         }

http://git-wip-us.apache.org/repos/asf/storm/blob/c46b49a9/storm-webapp/src/test/java/org/apache/storm/daemon/drpc/DRPCServerTest.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/test/java/org/apache/storm/daemon/drpc/DRPCServerTest.java b/storm-webapp/src/test/java/org/apache/storm/daemon/drpc/DRPCServerTest.java
index 76652e2..d37bade 100644
--- a/storm-webapp/src/test/java/org/apache/storm/daemon/drpc/DRPCServerTest.java
+++ b/storm-webapp/src/test/java/org/apache/storm/daemon/drpc/DRPCServerTest.java
@@ -44,8 +44,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-public class DRPCServerTest {
-    private static final Logger LOG = LoggerFactory.getLogger(DRPCServerTest.class);
+public class DrpcServerTest {
+    private static final Logger LOG = LoggerFactory.getLogger(DrpcServerTest.class);
     private static final ExecutorService exec = Executors.newCachedThreadPool();
     
     @AfterClass
@@ -87,10 +87,10 @@ public class DRPCServerTest {
     @Test
     public void testGoodThrift() throws Exception {
         Map<String, Object> conf = getConf(0, 0, null);
-        try (DRPCServer server = new DRPCServer(conf)) {
+        try (DrpcServer server = new DrpcServer(conf)) {
             server.start();
-            try (DRPCClient client = new DRPCClient(conf, "localhost", server.getDRPCPort());
-                 DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDRPCInvokePort())) {
+            try (DRPCClient client = new DRPCClient(conf, "localhost", server.getDrpcPort());
+                 DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDrpcInvokePort())) {
                 Future<String> found = exec.submit(() -> client.getClient().execute("testing",
"test"));
                 DRPCRequest request = getNextAvailableRequest(invoke, "testing");
                 assertNotNull(request);
@@ -106,10 +106,10 @@ public class DRPCServerTest {
     @Test
     public void testFailedThrift() throws Exception {
         Map<String, Object> conf = getConf(0, 0, null);
-        try (DRPCServer server = new DRPCServer(conf)) {
+        try (DrpcServer server = new DrpcServer(conf)) {
             server.start();
-            try (DRPCClient client = new DRPCClient(conf, "localhost", server.getDRPCPort());
-                    DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDRPCInvokePort())) {
+            try (DRPCClient client = new DRPCClient(conf, "localhost", server.getDrpcPort());
+                    DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDrpcInvokePort())) {
                 Future<String> found = exec.submit(() -> client.getClient().execute("testing",
"test"));
                 DRPCRequest request = getNextAvailableRequest(invoke, "testing");
                 assertNotNull(request);
@@ -145,11 +145,11 @@ public class DRPCServerTest {
     public void testGoodHttpGet() throws Exception {
         LOG.info("STARTING HTTP GET TEST...");
         Map<String, Object> conf = getConf(0, 0, 0);
-        try (DRPCServer server = new DRPCServer(conf)) {
+        try (DrpcServer server = new DrpcServer(conf)) {
             server.start();
             //TODO need a better way to do this
             Thread.sleep(2000);
-            try (DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDRPCInvokePort())) {
+            try (DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDrpcInvokePort())) {
                 Future<String> found = exec.submit(() -> GET(server.getHttpServerPort(),
"testing", "test"));
                 DRPCRequest request = getNextAvailableRequest(invoke, "testing");
                 assertNotNull(request);
@@ -166,11 +166,11 @@ public class DRPCServerTest {
     public void testFailedHttpGet() throws Exception {
         LOG.info("STARTING HTTP GET (FAIL) TEST...");
         Map<String, Object> conf = getConf(0, 0, 0);
-        try (DRPCServer server = new DRPCServer(conf)) {
+        try (DrpcServer server = new DrpcServer(conf)) {
             server.start();
             //TODO need a better way to do this
             Thread.sleep(2000);
-            try (DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDRPCInvokePort())) {
+            try (DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost",
server.getDrpcInvokePort())) {
                 Future<String> found = exec.submit(() -> GET(server.getHttpServerPort(),
"testing", "test"));
                 DRPCRequest request = getNextAvailableRequest(invoke, "testing");
                 assertNotNull(request);


Mime
View raw message