World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#949] fix(licence): IP issues with 3rd party code (#957)
FANNGa0573707e40e
diff --git a/LICENSE b/LICENSEindex 89e3bdbec8..655647e439 100644--- a/LICENSE+++ b/LICENSE@@ -212,6 +212,7 @@./api/src/main/java/com/datastrato/gravitino/rel/SupportsSchemas.java./api/src/main/java/com/datastrato/gravitino/rel/TableCatalog.java./api/src/main/java/com/datastrato/gravitino/rel/TableChange.java+ ./api/src/main/java/com/datastrato/gravitino/rel/expressions/Literal.java./api/src/main/java/com/datastrato/gravitino/rel/expressions/sorts/NullOrdering.java./api/src/main/java/com/datastrato/gravitino/rel/expressions/sorts/SortDirection.java./api/src/main/java/com/datastrato/gravitino/rel/expressions/sorts/SortOrder.java@@ -245,6 +246,7 @@Apache Zeppelin./integration-test/src/test/java/com/datastrato/gravitino/integration/test/util/CommandExecutor.java./integration-test/src/test/java/com/datastrato/gravitino/integration/test/util/ProcessData.java+ ./web/WEB-INF/web.xmlApache Hadoop./dev/docker/hive/hadoop-env.sh@@ -255,3 +257,6 @@Apache Submarine./bin/common.sh++ Trino+ ./integration-test/src/main/java/com/datastrato/gravitino/integration/test/util/CloseableGroup.java\ No newline at end of filediff --git a/bin/common.sh b/bin/common.shindex 982d4c824c..074a98eb46 100644--- a/bin/common.sh+++ b/bin/common.sh@@ -15,6 +15,8 @@# See the License for the specific language governing permissions and# limitations under the License.#+# Referred from Apache Submarine's common.sh implementation+# bin/common.shif [ -L "${BASH_SOURCE-$0}" ]; thenFWDIR=$(dirname "$(readlink "${BASH_SOURCE-$0}")")diff --git a/integration-test/src/main/java/com/datastrato/gravitino/integration/test/util/CloseableGroup.java b/integration-test/src/main/java/com/datastrato/gravitino/integration/test/util/CloseableGroup.javaindex 22902ce2d7..cc4b1fbcfb 100644--- a/integration-test/src/main/java/com/datastrato/gravitino/integration/test/util/CloseableGroup.java+++ b/integration-test/src/main/java/com/datastrato/gravitino/integration/test/util/CloseableGroup.java@@ -1,7 +1,18 @@/*- * Copyright 2023 Datastrato.- * This software is licensed under the Apache License version 2.+ * Licensed 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.*/+// Referred from Trino's AutoCloseableCloser implementation+// core/trino-main/src/main/java/io/trino/util/AutoCloseableCloser.javapackage com.datastrato.gravitino.integration.test.util;import static com.google.common.base.Throwables.propagateIfPossible;diff --git a/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java b/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.javaindex 7a5d9c317f..5fff7b7456 100644--- a/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java+++ b/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java@@ -16,6 +16,8 @@ import java.nio.file.DirectoryStream;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;+import java.security.AccessController;+import java.security.PrivilegedAction;import java.util.EnumSet;import java.util.Optional;import java.util.Set;@@ -402,22 +404,25 @@ public final class JettyServer {@Overridepublic Thread newThread(Runnable runnable) {- return PrivilegedThreadFactory.newThread(- () -> {- Thread thread = new Thread(runnable);- thread.setDaemon(true);- thread.setPriority(getThreadsPriority());- thread.setName(getName() + "-" + thread.getId());- thread.setUncaughtExceptionHandler(- (t, throwable) -> {- LOG.error("{} uncaught exception:", t.getName(), throwable);- });- // JettyServer maybe used by Gravitino server and Iceberg REST server with- // different classloaders, we use the classloader of current thread to- // replace the classloader of QueuedThreadPool.class.- // thread.setContextClassLoader(getClass().getClassLoader()) is removed- thread.setContextClassLoader(classLoader);- return thread;+ return AccessController.doPrivileged(+ new PrivilegedAction<Thread>() {+ @Override+ public Thread run() {+ Thread thread = new Thread(runnable);+ thread.setDaemon(true);+ thread.setPriority(getThreadsPriority());+ thread.setName(getName() + "-" + thread.getId());+ thread.setUncaughtExceptionHandler(+ (t, throwable) -> {+ LOG.error("{} uncaught exception:", t.getName(), throwable);+ });+ // JettyServer maybe used by Gravitino server and Iceberg REST server with+ // different classloaders, we use the classloader of current thread to+ // replace the classloader of QueuedThreadPool.class.+ // thread.setContextClassLoader(getClass().getClassLoader()) is removed+ thread.setContextClassLoader(classLoader);+ return thread;+ }});}};diff --git a/server-common/src/main/java/com/datastrato/gravitino/server/web/PrivilegedThreadFactory.java b/server-common/src/main/java/com/datastrato/gravitino/server/web/PrivilegedThreadFactory.javadeleted file mode 100644index 8fbb28ebff..0000000000--- a/server-common/src/main/java/com/datastrato/gravitino/server/web/PrivilegedThreadFactory.java+++ /dev/null@@ -1,39 +0,0 @@-/*- * Copyright 2023 Datastrato.- * This software is licensed under the Apache License version 2.- */--package com.datastrato.gravitino.server.web;--import java.security.AccessController;-import java.security.PrivilegedAction;-import java.util.function.Supplier;--/**- * Convenience class to ensure that a new Thread is created inside a privileged block.- *- * <p>This prevents the Thread constructor from pinning the caller's context classloader. This- * happens when the Thread constructor takes a snapshot of the current calling context - which- * contains ProtectionDomains that may reference the context classloader - and remembers it for the- * lifetime of the Thread.- *- * <p>Referred from org/eclipse/jetty/util/thread/PrivilegedThreadFactory.java;- */-class PrivilegedThreadFactory {- /**- * Use a Supplier to make a new thread, calling it within a privileged block to prevent- * classloader pinning.- *- * @param newThreadSupplier a Supplier to create a fresh thread- * @return a new thread, protected from classloader pinning.- */- static <T extends Thread> T newThread(Supplier<T> newThreadSupplier) {- return AccessController.doPrivileged(- new PrivilegedAction<T>() {- @Override- public T run() {- return newThreadSupplier.get();- }- });- }-}diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xmlindex 8a7ce0d78e..33837db9eb 100644--- a/web/WEB-INF/web.xml+++ b/web/WEB-INF/web.xml@@ -14,6 +14,9 @@~ 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.+ ~+ ~ Referred from Apache Zeppelin's web.xml implementation+ ~ zeppelin-web/src/WEB-INF/web.xml--><web-app xmlns="http://java.sun.com/xml/ns/javaee"