You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by im...@apache.org on 2021/05/26 23:43:35 UTC

[asterixdb] 29/38: [NO ISSUE][MISC] Fix typo on active state log, += HyracksThrowingSupplier

This is an automated email from the ASF dual-hosted git repository.

imaxon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit b69e30e1c0b55d6216647f28e3b68a16a66028e0
Author: Michael Blow <mb...@apache.org>
AuthorDate: Wed May 12 12:06:33 2021 -0400

    [NO ISSUE][MISC] Fix typo on active state log, += HyracksThrowingSupplier
    
    Change-Id: I19ba60f6a362b06451be331449d21f3c37653570
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11443
    Reviewed-by: Michael Blow <mb...@apache.org>
    Reviewed-by: Ian Maxon <im...@uci.edu>
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
---
 .../app/active/ActiveEntityEventsListener.java     |  7 ++----
 .../hyracks/api/util/HyracksThrowingSupplier.java  | 26 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
index 2891710..e18e50c 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveEntityEventsListener.java
@@ -133,15 +133,12 @@ public abstract class ActiveEntityEventsListener implements IActiveEntityControl
         this.locations = locations;
         this.numRegistered = 0;
         this.numDeRegistered = 0;
-        this.handler =
-                (ActiveNotificationHandler) metadataProvider.getApplicationContext().getActiveNotificationHandler();
+        this.handler = (ActiveNotificationHandler) appCtx.getActiveNotificationHandler();
         handler.registerListener(this);
     }
 
     protected synchronized void setState(ActivityState newState) {
-        if (LOGGER.isEnabled(level)) {
-            LOGGER.log(level, "State of " + getEntityId() + "is being set to " + newState + " from " + state);
-        }
+        LOGGER.log(level, "State of {} is being set to {} from {}", getEntityId(), newState, state);
         this.prevState = state;
         this.state = newState;
         if (newState == ActivityState.STARTING || newState == ActivityState.RECOVERING
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/HyracksThrowingSupplier.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/HyracksThrowingSupplier.java
new file mode 100644
index 0000000..c6c3922
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/HyracksThrowingSupplier.java
@@ -0,0 +1,26 @@
+/*
+ * 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.hyracks.api.util;
+
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+
+@FunctionalInterface
+public interface HyracksThrowingSupplier<T> {
+    T get() throws HyracksDataException;
+}