You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2015/04/24 15:45:29 UTC

[2/9] storm git commit: Adding license, formatting and improving comments

Adding license, formatting and improving comments

Conflicts:
	storm-core/src/jvm/backtype/storm/utils/Utils.java


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

Branch: refs/heads/master
Commit: 720a93ee92903d4ad4c4ab299042624fe4202b37
Parents: 58da201
Author: Kishor Patil <kp...@yahoo-inc.com>
Authored: Fri Feb 20 17:43:19 2015 -0600
Committer: Kishor Patil <kp...@yahoo-inc.com>
Committed: Wed Mar 18 12:02:31 2015 -0500

----------------------------------------------------------------------
 .../security/auth/SaslTransportPlugin.java      |  5 ++--
 .../storm/utils/ExtendedThreadPoolExecutor.java | 24 +++++++++++++++++---
 .../src/jvm/backtype/storm/utils/Utils.java     |  1 -
 3 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/720a93ee/storm-core/src/jvm/backtype/storm/security/auth/SaslTransportPlugin.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/security/auth/SaslTransportPlugin.java b/storm-core/src/jvm/backtype/storm/security/auth/SaslTransportPlugin.java
index 91f1d69..7208a17 100644
--- a/storm-core/src/jvm/backtype/storm/security/auth/SaslTransportPlugin.java
+++ b/storm-core/src/jvm/backtype/storm/security/auth/SaslTransportPlugin.java
@@ -84,12 +84,11 @@ public abstract class SaslTransportPlugin implements ITransportPlugin {
         }
         BlockingQueue workQueue = new SynchronousQueue();
         if (queueSize != null) {
-          workQueue = new ArrayBlockingQueue(queueSize);
+            workQueue = new ArrayBlockingQueue(queueSize);
         }
         ThreadPoolExecutor executorService = new ExtendedThreadPoolExecutor(numWorkerThreads, numWorkerThreads,
-        60, TimeUnit.SECONDS, workQueue);
+            60, TimeUnit.SECONDS, workQueue);
         server_args.executorService(executorService);
-
         return new TThreadPoolServer(server_args);
     }
 

http://git-wip-us.apache.org/repos/asf/storm/blob/720a93ee/storm-core/src/jvm/backtype/storm/utils/ExtendedThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/ExtendedThreadPoolExecutor.java b/storm-core/src/jvm/backtype/storm/utils/ExtendedThreadPoolExecutor.java
index 36eeefa..6730780 100644
--- a/storm-core/src/jvm/backtype/storm/utils/ExtendedThreadPoolExecutor.java
+++ b/storm-core/src/jvm/backtype/storm/utils/ExtendedThreadPoolExecutor.java
@@ -1,5 +1,23 @@
 package backtype.storm.utils;
 
+/**
+ * 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.
+ */
+
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.ExecutionException;
@@ -27,6 +45,7 @@ public class ExtendedThreadPoolExecutor extends ThreadPoolExecutor{
     super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);
   }
 
+  @Override
   protected void afterExecute(Runnable r, Throwable t) {
     super.afterExecute(r, t);
     if (t == null && r instanceof Future<?>) {
@@ -36,12 +55,11 @@ public class ExtendedThreadPoolExecutor extends ThreadPoolExecutor{
         t = ce;
       } catch (ExecutionException ee) {
         t = ee.getCause();
-
       } catch (InterruptedException ie) {
-        Thread.currentThread().interrupt(); // ignore/reset
+        // If future got interrupted exception, we want to main parent thread itself.
+        Thread.currentThread().interrupt();
       }
     }
     Utils.handleUncaughtException(t);
   }
-
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/720a93ee/storm-core/src/jvm/backtype/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/Utils.java b/storm-core/src/jvm/backtype/storm/utils/Utils.java
index 6220bb4..927683b 100644
--- a/storm-core/src/jvm/backtype/storm/utils/Utils.java
+++ b/storm-core/src/jvm/backtype/storm/utils/Utils.java
@@ -543,5 +543,4 @@ public class Utils {
       }
       Runtime.getRuntime().halt(-1);
     }
-  }
 }