[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 <mblow@apache.org>
Reviewed-by: Ian Maxon <imaxon@uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
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 @@
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;
+}