asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Update Jetty to Latest Released Version (9.3.11)
Date Fri, 05 Aug 2016 03:11:08 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1048

Change subject: Update Jetty to Latest Released Version (9.3.11)
......................................................................

Update Jetty to Latest Released Version (9.3.11)

Change-Id: I387198865c8c44dc0d1aabe9a8eb06eb056f694b
---
M asterixdb/asterix-app/pom.xml
M asterixdb/asterix-external-data/pom.xml
M asterixdb/pom.xml
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/WebServer.java
6 files changed, 77 insertions(+), 65 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/48/1048/1

diff --git a/asterixdb/asterix-app/pom.xml b/asterixdb/asterix-app/pom.xml
index be1c124..b06a03e 100644
--- a/asterixdb/asterix-app/pom.xml
+++ b/asterixdb/asterix-app/pom.xml
@@ -178,20 +178,20 @@
   <dependencies>
     <dependency>
       <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
+      <artifactId>javax.servlet-api</artifactId>
       <type>jar</type>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>
-      <version>8.0.0.RC0</version>
+      <version>9.3.11.v20160721</version>
       <type>jar</type>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-servlet</artifactId>
-      <version>8.0.0.RC0</version>
+      <version>9.3.11.v20160721</version>
       <type>jar</type>
       <scope>compile</scope>
     </dependency>
diff --git a/asterixdb/asterix-external-data/pom.xml b/asterixdb/asterix-external-data/pom.xml
index a05af3d..d4fa801 100644
--- a/asterixdb/asterix-external-data/pom.xml
+++ b/asterixdb/asterix-external-data/pom.xml
@@ -183,7 +183,7 @@
   <dependencies>
     <dependency>
       <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
+      <artifactId>javax.servlet-api</artifactId>
       <type>jar</type>
     </dependency>
     <dependency>
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index 4fb3e37..3172cff 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -68,7 +68,7 @@
     <hadoop.version>2.2.0</hadoop.version>
     <junit.version>4.11</junit.version>
     <commons.io.version>2.4</commons.io.version>
-    <servlet.api.version>2.5</servlet.api.version>
+    <servlet.api.version>3.1.0</servlet.api.version>
     <json.version>20090211</json.version>
     <jacoco.version>0.7.6.201602180812</jacoco.version>
   </properties>
@@ -261,6 +261,11 @@
             </configuration>
           </execution>
         </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.10</version>
       </plugin>
     </plugins>
     <pluginManagement>
@@ -756,7 +761,7 @@
       </dependency>
       <dependency>
         <groupId>javax.servlet</groupId>
-        <artifactId>servlet-api</artifactId>
+        <artifactId>javax.servlet-api</artifactId>
         <version>${servlet.api.version}</version>
         <type>jar</type>
       </dependency>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
index 2b59165..26b4cb6 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/pom.xml
@@ -41,14 +41,14 @@
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>
-      <version>8.0.0.RC0</version>
+      <version>9.3.11.v20160721</version>
       <type>jar</type>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-webapp</artifactId>
-      <version>8.0.0.RC0</version>
+      <version>9.3.11.v20160721</version>
       <type>jar</type>
       <scope>compile</scope>
     </dependency>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
index aa15c38..75b7473 100755
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/ApplicationInstallationHandler.java
@@ -31,12 +31,11 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.eclipse.jetty.http.HttpMethods;
-import org.eclipse.jetty.server.Request;
-import org.eclipse.jetty.server.handler.AbstractHandler;
-
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.common.work.SynchronizableWork;
+import org.eclipse.jetty.http.HttpMethod;
+import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.handler.AbstractHandler;
 
 public class ApplicationInstallationHandler extends AbstractHandler {
     private ClusterControllerService ccs;
@@ -64,57 +63,64 @@
             String rootDir = ccs.getServerContext().getBaseDir().toString();
             final String deploymentDir = rootDir.endsWith(File.separator) ? rootDir + "applications/"
+ deployIdString
                     : rootDir + File.separator + "/applications/" + File.separator + deployIdString;
-            if (HttpMethods.PUT.equals(request.getMethod())) {
-                class OutputStreamGetter extends SynchronizableWork {
-                    private OutputStream os;
+            switch (HttpMethod.valueOf(request.getMethod())) {
+                case PUT: {
+                    class OutputStreamGetter extends SynchronizableWork {
+                        private OutputStream os;
 
-                    @Override
-                    protected void doRun() throws Exception {
-                        FileUtils.forceMkdir(new File(deploymentDir));
-                        String fileName = params[1];
-                        File jarFile = new File(deploymentDir, fileName);
-                        os = new FileOutputStream(jarFile);
+                        @Override
+                        protected void doRun() throws Exception {
+                            FileUtils.forceMkdir(new File(deploymentDir));
+                            String fileName = params[1];
+                            File jarFile = new File(deploymentDir, fileName);
+                            os = new FileOutputStream(jarFile);
+                        }
                     }
-                }
-                OutputStreamGetter r = new OutputStreamGetter();
-                try {
-                    ccs.getWorkQueue().scheduleAndSync(r);
-                } catch (Exception e) {
-                    throw new IOException(e);
-                }
-                try {
-                    IOUtils.copyLarge(request.getInputStream(), r.os);
-                } finally {
-                    r.os.close();
-                }
-            } else if (HttpMethods.GET.equals(request.getMethod())) {
-                class InputStreamGetter extends SynchronizableWork {
-                    private InputStream is;
-
-                    @Override
-                    protected void doRun() throws Exception {
-                        String fileName = params[1];
-                        File jarFile = new File(deploymentDir, fileName);
-                        is = new FileInputStream(jarFile);
-                    }
-                }
-                InputStreamGetter r = new InputStreamGetter();
-                try {
-                    ccs.getWorkQueue().scheduleAndSync(r);
-                } catch (Exception e) {
-                    throw new IOException(e);
-                }
-                if (r.is == null) {
-                    response.setStatus(HttpServletResponse.SC_NOT_FOUND);
-                } else {
-                    response.setContentType("application/octet-stream");
-                    response.setStatus(HttpServletResponse.SC_OK);
+                    OutputStreamGetter r = new OutputStreamGetter();
                     try {
-                        IOUtils.copyLarge(r.is, response.getOutputStream());
-                    } finally {
-                        r.is.close();
+                        ccs.getWorkQueue().scheduleAndSync(r);
+                    } catch (Exception e) {
+                        throw new IOException(e);
                     }
+                    try {
+                        IOUtils.copyLarge(request.getInputStream(), r.os);
+                    } finally {
+                        r.os.close();
+                    }
+                    break;
                 }
+                case GET: {
+                    class InputStreamGetter extends SynchronizableWork {
+                        private InputStream is;
+
+                        @Override
+                        protected void doRun() throws Exception {
+                            String fileName = params[1];
+                            File jarFile = new File(deploymentDir, fileName);
+                            is = new FileInputStream(jarFile);
+                        }
+                    }
+                    InputStreamGetter r = new InputStreamGetter();
+                    try {
+                        ccs.getWorkQueue().scheduleAndSync(r);
+                    } catch (Exception e) {
+                        throw new IOException(e);
+                    }
+                    if (r.is == null) {
+                        response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+                    } else {
+                        response.setContentType("application/octet-stream");
+                        response.setStatus(HttpServletResponse.SC_OK);
+                        try {
+                            IOUtils.copyLarge(r.is, response.getOutputStream());
+                        } finally {
+                            r.is.close();
+                        }
+                    }
+                    break;
+                }
+                default:
+                    throw new IllegalArgumentException(request.getMethod());
             }
             baseRequest.setHandled(true);
         } catch (IOException e) {
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/WebServer.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/WebServer.java
index ac98b64..b55e65d 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/WebServer.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/web/WebServer.java
@@ -18,6 +18,11 @@
  */
 package org.apache.hyracks.control.cc.web;
 
+import java.util.EnumSet;
+import java.util.logging.Logger;
+
+import javax.servlet.DispatcherType;
+
 import org.apache.hyracks.control.cc.ClusterControllerService;
 import org.apache.hyracks.control.cc.adminconsole.HyracksAdminConsoleApplication;
 import org.apache.hyracks.control.cc.web.util.JSONOutputRequestHandler;
@@ -29,31 +34,27 @@
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Handler;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.server.handler.ContextHandler;
 import org.eclipse.jetty.server.handler.ContextHandlerCollection;
 import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.server.nio.SelectChannelConnector;
 import org.eclipse.jetty.servlet.DefaultServlet;
 import org.eclipse.jetty.servlet.FilterHolder;
 import org.eclipse.jetty.servlet.ServletContextHandler;
-
-import javax.servlet.DispatcherType;
-import java.util.EnumSet;
-import java.util.logging.Logger;
 
 public class WebServer {
     private final static Logger LOGGER = Logger.getLogger(WebServer.class.getName());
 
     private final ClusterControllerService ccs;
     private final Server server;
-    private final SelectChannelConnector connector;
+    private final ServerConnector connector;
     private final HandlerCollection handlerCollection;
 
     public WebServer(ClusterControllerService ccs) throws Exception {
         this.ccs = ccs;
         server = new Server();
 
-        connector = new SelectChannelConnector();
+        connector = new ServerConnector(server);
 
         server.setConnectors(new Connector[] { connector });
 

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1048
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I387198865c8c44dc0d1aabe9a8eb06eb056f694b
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>

Mime
View raw message