Merge branch 'gerrit/trinity' into 'master'

Change-Id: I8baf3727ddbd74595451eb2d1c3b4f4b274e0757
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIServerFactory.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIServerFactory.java
index 0128a87..6a0edc0 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIServerFactory.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/RMIServerFactory.java
@@ -39,10 +39,7 @@
     }
 
     public static RMIServerSocketFactory getSocketFactory(INetworkSecurityManager securityManager) {
-        if (securityManager.getConfiguration().isSslEnabled()) {
-            return new RMIServerFactory(securityManager);
-        }
-        return null;
+        return new RMIServerFactory(securityManager);
     }
 
     @Override
diff --git a/asterixdb/src/main/appended-resources/supplemental-models.xml b/asterixdb/src/main/appended-resources/supplemental-models.xml
index 81ed7f0..9b275d1 100644
--- a/asterixdb/src/main/appended-resources/supplemental-models.xml
+++ b/asterixdb/src/main/appended-resources/supplemental-models.xml
@@ -1774,7 +1774,7 @@
         <license.ignoreMissingEmbeddedLicense>1.43.2,1.52.1</license.ignoreMissingEmbeddedLicense>
         <license.ignoreMissingEmbeddedNotice>1.43.2,1.52.1</license.ignoreMissingEmbeddedNotice>
         <license.ignoreLicenseOverride>1.43.2,1.52.1</license.ignoreLicenseOverride>
-        <license.ignoreNoticeOverride>1.43.2</license.ignoreNoticeOverride>
+        <license.ignoreNoticeOverride>1.43.2,1.52.1</license.ignoreNoticeOverride>
       </properties>
     </project>
   </supplement>
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
index 57f9750..f4b6e20 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
@@ -32,6 +32,7 @@
 import org.apache.hyracks.util.IOThrowingAction;
 import org.apache.hyracks.util.IRetryPolicy;
 import org.apache.hyracks.util.InterruptibleAction;
+import org.apache.hyracks.util.InterruptibleSupplier;
 import org.apache.hyracks.util.Span;
 import org.apache.hyracks.util.ThrowingAction;
 import org.apache.logging.log4j.Level;
@@ -94,6 +95,27 @@
     }
 
     /**
+     * Executes the passed interruptible supplier, retrying if the operation is interrupted. Once the interruptible
+     * supplier completes, the current thread will be re-interrupted, if the original operation was interrupted.
+     */
+    public static <T> T getUninterruptibly(InterruptibleSupplier<T> interruptible) {
+        boolean interrupted = Thread.interrupted();
+        try {
+            while (true) {
+                try {
+                    return interruptible.get();
+                } catch (InterruptedException e) { // NOSONAR- we will re-interrupt the thread during unwind
+                    interrupted = true;
+                }
+            }
+        } finally {
+            if (interrupted) {
+                Thread.currentThread().interrupt();
+            }
+        }
+    }
+
+    /**
      * Executes the passed interruptible, retrying if the operation is interrupted.
      *
      * @return true if the original operation was interrupted, otherwise false
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/InterruptibleSupplier.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/InterruptibleSupplier.java
new file mode 100644
index 0000000..5de8c84
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/InterruptibleSupplier.java
@@ -0,0 +1,24 @@
+/*
+ * 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.util;
+
+@FunctionalInterface
+public interface InterruptibleSupplier<T> {
+    T get() throws InterruptedException;
+}