asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject incubator-asterixdb git commit: ASTERIXDB-1460: Fix log level crashing CC on start
Date Fri, 20 May 2016 23:38:21 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master f7f44ce60 -> fa51d4283


ASTERIXDB-1460: Fix log level crashing CC on start

The Hyracks CC would nullpoint on startup if the log level was
greater than FINEST. This works around the core issue that's in
ASTERIXDB-1460 since in this instance the way the log level was used
would cause the CC to fail on startup where the log level was
equal to or greater than FINEST.

Change-Id: I720eca41fac312fc6cbdbb880162a5bc8b0357dc
Reviewed-on: https://asterix-gerrit.ics.uci.edu/870
Reviewed-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <hubailmor@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/fa51d428
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/fa51d428
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/fa51d428

Branch: refs/heads/master
Commit: fa51d428372965603406c2498f7316cea4b895be
Parents: f7f44ce
Author: Ian Maxon <imaxon@apache.org>
Authored: Fri May 20 15:45:13 2016 -0700
Committer: Ian Maxon <imaxon@apache.org>
Committed: Fri May 20 16:37:59 2016 -0700

----------------------------------------------------------------------
 .../hyracks/control/common/work/WorkQueue.java       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fa51d428/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java
index 7786db7..1f61543 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/work/WorkQueue.java
@@ -28,7 +28,8 @@ import org.apache.hyracks.api.exceptions.HyracksException;
 
 public class WorkQueue {
     private static final Logger LOGGER = Logger.getLogger(WorkQueue.class.getName());
-    private static final Level COUNT_LOGGING_LEVEL = Level.FINEST;
+    //to be fixed when application vs. hyracks log level issues are sorted
+    private static final boolean DEBUG = false;
 
     private final LinkedBlockingQueue<AbstractWork> queue;
     private final WorkerThread thread;
@@ -48,7 +49,7 @@ public class WorkQueue {
         thread = new WorkerThread();
         stopSemaphore = new Semaphore(1);
         stopped = true;
-        if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) {
+        if(DEBUG) {
             enqueueCount = new AtomicInteger(0);
             dequeueCount = new AtomicInteger(0);
         }
@@ -60,7 +61,7 @@ public class WorkQueue {
         } catch (InterruptedException e) {
             throw new HyracksException(e);
         }
-        if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) {
+        if (DEBUG) {
             enqueueCount.set(0);
             dequeueCount.set(0);
         }
@@ -85,8 +86,8 @@ public class WorkQueue {
     }
 
     public void schedule(AbstractWork event) {
-        if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) {
-            LOGGER.log(COUNT_LOGGING_LEVEL, "Enqueue (" + hashCode() + "): " + enqueueCount.incrementAndGet());
+        if (DEBUG) {
+            LOGGER.log(Level.FINEST, "Enqueue (" + hashCode() + "): " + enqueueCount.incrementAndGet());
         }
         if (LOGGER.isLoggable(Level.FINER)) {
             LOGGER.finer("Scheduling: " + event);
@@ -120,8 +121,8 @@ public class WorkQueue {
                     } catch (InterruptedException e) {
                         continue;
                     }
-                    if (LOGGER.isLoggable(COUNT_LOGGING_LEVEL)) {
-                        LOGGER.log(COUNT_LOGGING_LEVEL,
+                    if (DEBUG) {
+                        LOGGER.log(Level.FINEST,
                                 "Dequeue (" + WorkQueue.this.hashCode() + "): " + dequeueCount.incrementAndGet()
+ "/"
                                         + enqueueCount);
                     }


Mime
View raw message