[ 
https://issues.apache.org/jira/browse/CAMEL-12099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16326879#comment-16326879
 ] 

ASF GitHub Bot commented on CAMEL-12099:
----------------------------------------

davsclaus closed pull request #2178: CAMEL-12099: Update camel-thrift to 
libthrift 0.11.0
URL: https://github.com/apache/camel/pull/2178
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/components/camel-thrift/README.md 
b/components/camel-thrift/README.md
index 668e452c322..a3679473b63 100644
--- a/components/camel-thrift/README.md
+++ b/components/camel-thrift/README.md
@@ -9,8 +9,8 @@ For linux/osx you download the .tar distro, and untar it, and 
then
     sudo ./bootstrap.sh
     export CXXFLAGS='-Os -ffunction-sections -Wl,--gc-sections 
-fno-asynchronous-unwind-tables -Wl,--strip-all'
     sudo ./configure --without-c_glib --without-java --without-python 
--without-ruby --without-nodejs --disable-libs --disable-tests 
--disable-tutorial --disable-shared --enable-static
-    sudo ./make check
-    sudo ./make install
+    sudo make check
+    sudo make install
 
 If its succesful, you can type
 
diff --git 
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/Invocation.java
 
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/Invocation.java
deleted file mode 100644
index d61547b6d83..00000000000
--- 
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/Invocation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.thrift.server;
-
-import org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer;
-
-/**
- * Copy of the org.apache.thrift.server.Invocation
- */
-class Invocation implements Runnable {
-    private final FrameBuffer frameBuffer;
-
-    public Invocation(final FrameBuffer frameBuffer) {
-        this.frameBuffer = frameBuffer;
-    }
-
-    public void run() {
-        frameBuffer.invoke();
-    }
-}
diff --git 
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftHsHaServer.java
 
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftHsHaServer.java
index 2ae49e12d0c..6ac8ca018b2 100644
--- 
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftHsHaServer.java
+++ 
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftHsHaServer.java
@@ -17,22 +17,17 @@
 package org.apache.camel.component.thrift.server;
 
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.RejectedExecutionException;
 
 import org.apache.camel.CamelContext;
-import org.apache.thrift.server.TNonblockingServer;
+import org.apache.thrift.server.THsHaServer;
 import org.apache.thrift.transport.TNonblockingServerTransport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /*
  * Thrift HsHaServer implementation with executors controlled by the Camel 
Executor Service Manager
  */
-public class ThriftHsHaServer extends TNonblockingServer {
-    private static final Logger LOG = 
LoggerFactory.getLogger(ThriftHsHaServer.class);
+public class ThriftHsHaServer extends THsHaServer {
 
-    public static class Args extends AbstractNonblockingServerArgs<Args> {
-        private ExecutorService executorService;
+    public static class Args extends THsHaServer.Args {
         private ExecutorService startThreadPool;
         private CamelContext context;
 
@@ -40,11 +35,6 @@ public Args(TNonblockingServerTransport transport) {
             super(transport);
         }
 
-        public Args executorService(ExecutorService executorService) {
-            this.executorService = executorService;
-            return this;
-        }
-
         public Args startThreadPool(ExecutorService startThreadPool) {
             this.startThreadPool = startThreadPool;
             return this;
@@ -56,7 +46,6 @@ public Args context(CamelContext context) {
         }
     }
 
-    private final ExecutorService invoker;
     private final CamelContext context;
     private final ExecutorService startExecutor;
 
@@ -64,7 +53,6 @@ public ThriftHsHaServer(Args args) {
         super(args);
 
         this.context = args.context;
-        this.invoker = args.executorService;
         this.startExecutor = args.startThreadPool;
     }
 
@@ -97,22 +85,6 @@ public void stop() {
     @Override
     protected void waitForShutdown() {
         joinSelector();
-        context.getExecutorServiceManager().shutdownGraceful(invoker);
-    }
-
-    @Override
-    protected boolean requestInvoke(FrameBuffer frameBuffer) {
-        try {
-            Runnable invocation = getRunnable(frameBuffer);
-            invoker.execute(invocation);
-            return true;
-        } catch (RejectedExecutionException rx) {
-            LOG.warn("ExecutorService rejected execution!", rx);
-            return false;
-        }
-    }
-
-    protected Runnable getRunnable(FrameBuffer frameBuffer) {
-        return new Invocation(frameBuffer);
+        context.getExecutorServiceManager().shutdownGraceful(getInvoker());
     }
 }
diff --git 
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftThreadPoolServer.java
 
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftThreadPoolServer.java
index 1b749c9fc69..2b387e40dbe 100644
--- 
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftThreadPoolServer.java
+++ 
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/server/ThriftThreadPoolServer.java
@@ -142,7 +142,7 @@ public void serve() {
         });
     }
 
-    public void waitForShutdown() {
+    private void waitForShutdown() {
         int failureCount = 0;
         while (!stopped_) {
             try {
diff --git a/components/camel-thrift/src/test/thrift/README.md 
b/components/camel-thrift/src/test/thrift/README.md
index 5fe3aaf0b79..98f153c4d35 100644
--- a/components/camel-thrift/src/test/thrift/README.md
+++ b/components/camel-thrift/src/test/thrift/README.md
@@ -1,9 +1,9 @@
 Thrift tutorial java files generation
 -----------------------
-$ cd src/test/thrift
+cd src/test/thrift
 
-$ thrift -r --gen java -out ../java/ ./tutorial-dataformat.thrift
+thrift -r --gen java -out ../java/ ./tutorial-dataformat.thrift
 
-$ thrift -r --gen java -out ../java/ ./tutorial-component.thrift
+thrift -r --gen java -out ../java/ ./tutorial-component.thrift
 
 *Examples taken from the Apache Thrift java tutorial 
https://thrift.apache.org/tutorial/java*
\ No newline at end of file
diff --git a/parent/pom.xml b/parent/pom.xml
index b1941ee1320..cce13a52938 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -384,7 +384,7 @@
     <jettison-version>1.3.8</jettison-version>
     <jgit-version>4.10.0.201712302008-r</jgit-version>
     <jgroups-version>4.0.9.Final</jgroups-version>
-    <libthrift-version>0.10.0</libthrift-version>
+    <libthrift-version>0.11.0</libthrift-version>
     <jibx-version>1.2.6</jibx-version>
     <jing-bundle-version>20030619_5</jing-bundle-version>
     <jing-version>20030619</jing-version>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Update camel-thrift to libthrift 0.11.0
> ---------------------------------------
>
>                 Key: CAMEL-12099
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12099
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 2.21.0
>            Reporter: Dmitry Volodin
>            Assignee: Dmitry Volodin
>            Priority: Minor
>             Fix For: 2.21.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to