hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-14172) Upgrade existing thrift binding using thrift 0.9.2 compiler.
Date Tue, 17 Nov 2015 23:35:11 GMT

     [ https://issues.apache.org/jira/browse/HBASE-14172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Josh Elser updated HBASE-14172:
-------------------------------
    Attachment: HBASE-14172.001.patch

001. In hopes of moving things forward: here's a patch that bumps up to 0.9.3.

As far as the actual changes (non-generated code), here's the nuts and bolts:

{noformat}
diff --git a/pom.xml b/pom.xml
index cb01cea..fa7400e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1195,7 +1195,7 @@
     <mockito-all.version>1.10.8</mockito-all.version>
     <protobuf.version>2.5.0</protobuf.version>
     <thrift.path>thrift</thrift.path>
-    <thrift.version>0.9.2</thrift.version>
+    <thrift.version>0.9.3</thrift.version>
     <zookeeper.version>3.4.6</zookeeper.version>
     <slf4j.version>1.7.7</slf4j.version>
     <clover.version>4.0.3</clover.version>
{noformat}

{noformat}
diff --git a/hbase-thrift/pom.xml b/hbase-thrift/pom.xml
index f7ab7f1..ff999dc 100644
--- a/hbase-thrift/pom.xml
+++ b/hbase-thrift/pom.xml
@@ -415,12 +415,12 @@
                     <requireProperty>
                       <property>thrift.version</property>
                       <message>"The Thrift version must be specified."</message>
-                      <regex>0\.9\.2</regex>
+                      <regex>0\.9\.3</regex>
                       <regexMessage>
 -
 -
 [FATAL] ==========================================================================================
-[FATAL] HBase Thrift requires the thrift generator version 0.9.2.
+[FATAL] HBase Thrift requires the thrift generator version 0.9.3.
 [FATAL] Setting it to something else needs to be reviewed for wire and behavior compatibility.
 [FATAL] ==========================================================================================
 -
{noformat}

{noformat}
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index c5e44d5..4d46a31 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -539,7 +539,7 @@ public class ThriftServerRunner implements Runnable {
         CallQueue callQueue =
             new CallQueue(new LinkedBlockingQueue<Call>(), metrics);
         ExecutorService executorService = createExecutor(
-            callQueue, serverArgs.getWorkerThreads());
+            callQueue, serverArgs.getMinWorkerThreads(), serverArgs.getMaxWorkerThreads());
         serverArgs.executorService(executorService)
                   .processor(processor)
                   .transportFactory(transportFactory)
@@ -551,7 +551,7 @@ public class ThriftServerRunner implements Runnable {
         CallQueue callQueue =
             new CallQueue(new LinkedBlockingQueue<Call>(), metrics);
         ExecutorService executorService = createExecutor(
-            callQueue, serverArgs.getWorkerThreads());
+            callQueue, serverArgs.getWorkerThreads(), serverArgs.getWorkerThreads());
         serverArgs.executorService(executorService)
                   .processor(processor)
                   .transportFactory(transportFactory)
@@ -597,11 +597,11 @@ public class ThriftServerRunner implements Runnable {
   }

   ExecutorService createExecutor(BlockingQueue<Runnable> callQueue,
-                                 int workerThreads) {
+                                 int minWorkers, int maxWorkers) {
     ThreadFactoryBuilder tfb = new ThreadFactoryBuilder();
     tfb.setDaemon(true);
     tfb.setNameFormat("thrift-worker-%d");
-    return new ThreadPoolExecutor(workerThreads, workerThreads,
+    return new ThreadPoolExecutor(minWorkers, maxWorkers,
             Long.MAX_VALUE, TimeUnit.SECONDS, callQueue, tfb.build());
   }
{noformat}

{noformat}
diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
index b5e17ef..a5c7275 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java
@@ -245,10 +245,11 @@ public class ThriftServer extends Configured implements Tool {
     log.info("starting HBase HsHA Thrift server on " + inetSocketAddress.toString());
     THsHaServer.Args serverArgs = new THsHaServer.Args(serverTransport);
     if (workerThreads > 0) {
-      serverArgs.workerThreads(workerThreads);
+      // Could support the min & max threads, avoiding to preserve existing functionality.
+      serverArgs.minWorkerThreads(workerThreads).maxWorkerThreads(workerThreads);
     }
     ExecutorService executorService = createExecutor(
-        serverArgs.getWorkerThreads(), metrics);
+        workerThreads, metrics);
     serverArgs.executorService(executorService);
     serverArgs.processor(processor);
     serverArgs.transportFactory(transportFactory);
{noformat}

> Upgrade existing thrift binding using thrift 0.9.2 compiler.
> ------------------------------------------------------------
>
>                 Key: HBASE-14172
>                 URL: https://issues.apache.org/jira/browse/HBASE-14172
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Srikanth Srungarapu
>            Priority: Minor
>         Attachments: HBASE-14172-branch-1.patch, HBASE-14172.001.patch, HBASE-14172.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message