Blob Blame History Raw
From d689c943b09f1b88d9294a43691b3964093fe021 Mon Sep 17 00:00:00 2001
From: Peter MacKinnon <pmackinn@redhat.com>
Date: Wed, 8 Jan 2014 12:10:20 -0500
Subject: [PATCH 05/10] service mods

---
 .../apache/hive/service/cli/thrift/ThriftCLIService.java |  2 +-
 .../hive/service/cli/thrift/ThriftHttpCLIService.java    | 16 +++++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java
index 857e627..1098f08 100644
--- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java
+++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java
@@ -59,7 +59,7 @@
   protected int portNum;
   protected InetSocketAddress serverAddress;
   protected TServer server;
-  protected org.mortbay.jetty.Server httpServer;
+  protected org.eclipse.jetty.server.Server httpServer;
 
   private boolean isStarted = false;
   protected boolean isEmbedded = false;
diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java
index e487a7f..b73df7d 100644
--- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java
+++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java
@@ -26,10 +26,10 @@
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.server.TServlet;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.ServletHolder;
-import org.mortbay.thread.QueuedThreadPool;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
 
 
 public class ThriftHttpCLIService extends ThriftCLIService {
@@ -75,13 +75,11 @@ public void run() {
         }
       }
 
-      httpServer = new org.mortbay.jetty.Server();
-
       QueuedThreadPool threadPool = new QueuedThreadPool();
       threadPool.setMinThreads(minWorkerThreads);
       threadPool.setMaxThreads(maxWorkerThreads);
-      httpServer.setThreadPool(threadPool);
-      SelectChannelConnector connector = new SelectChannelConnector();
+      httpServer = new org.eclipse.jetty.server.Server(threadPool);
+      ServerConnector connector = new ServerConnector(httpServer);
       connector.setPort(portNum);
 
       // Linux:yes, Windows:no
@@ -93,7 +91,7 @@ public void run() {
 
       TProtocolFactory protocolFactory = new TBinaryProtocol.Factory();
       TServlet thriftHttpServlet = new ThriftHttpServlet(processor, protocolFactory);
-      final Context context = new Context(httpServer, "/", Context.SESSIONS);
+      final ServletContextHandler context = new ServletContextHandler(httpServer, "/", ServletContextHandler.SESSIONS);
       context.addServlet(new ServletHolder(thriftHttpServlet), httpPath);
 
       // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc.
-- 
1.8.5.2