diff --git a/iceberg/patched-iceberg-api/pom.xml b/iceberg/patched-iceberg-api/pom.xml
index 41f72a3d2f51..6ef478159602 100644
--- a/iceberg/patched-iceberg-api/pom.xml
+++ b/iceberg/patched-iceberg-api/pom.xml
@@ -21,7 +21,6 @@
4.0.0
patched-iceberg-api
- ${revision}
Patched Iceberg API
diff --git a/iceberg/patched-iceberg-core/pom.xml b/iceberg/patched-iceberg-core/pom.xml
index 7e71078ad1c2..c1745bb021b4 100644
--- a/iceberg/patched-iceberg-core/pom.xml
+++ b/iceberg/patched-iceberg-core/pom.xml
@@ -22,7 +22,6 @@
4.0.0
patched-iceberg-core
Patched Iceberg Core
- ${revision}
diff --git a/pom.xml b/pom.xml
index 441991ac2fbb..f16874246174 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,7 +99,7 @@
3.1.0
2.16.0
3.5.0
- 3.0.0-M4
+ 3.5.1
2.7.10
2.3.0
@@ -110,7 +110,7 @@
4.9.3
1.5.7
- 12.0.0
+ 16.0.0
1.12.0
1.11.4
1.78
@@ -126,7 +126,7 @@
1.26.0
1.10
1.1
- 2.12.0
+ 2.14.0
3.12.0
3.6.1
2.12.0
@@ -151,7 +151,6 @@
4.5.13
4.4.13
- 1.6.1
2.5.2
2.16.1
2.3.4
@@ -167,8 +166,8 @@
6.0.0
1.8
4.13.2
- 5.10.0
- 5.6.3
+ 5.11.2
+ 5.11.2
2.5.0
5.5.0
1.11.9
@@ -176,10 +175,10 @@
0.9.3
0.16.0
- 2.24.1
+ 2.18.0
2.5.0
6.2.1.jre8
- 8.0.31
+ 8.2.0
42.7.3
21.3.0.0
5.9
@@ -188,12 +187,12 @@
3.4.4
4.11.0
2.0.0-M5
- 4.1.77.Final
+ 4.1.116.Final
3.10.5.Final
4.5.5
2.8
- 1.13.1
+ 1.14.4
0.16.0
1.5.6
3.25.5
@@ -1016,7 +1015,7 @@
io.netty
- netty
+ netty-all
@@ -1754,6 +1753,7 @@
org.apache.maven.plugins
maven-surefire-plugin
+ false
**/TestSerDe.java
**/TestHiveMetaStore.java
@@ -1765,8 +1765,8 @@
true
false
- false
- ${maven.test.jvm.args}
+ false
+ ${maven.test.jvm.args} -Xshare:off
false
${test.conf.dir}
@@ -1795,10 +1795,10 @@
${maven.repo.local}
local
- ${test.log4j.scheme}${test.conf.dir}/hive-log4j2.properties
-
+ ${test.log4j.scheme}${test.conf.dir}/hive-log4j2.properties
${test.console.log.level}
hive-test-cluster-id-cli
+ true
${test.tmp.dir}
@@ -1916,11 +1916,9 @@
${basedir}
-c
- ${thrift.home}/bin/thrift -version | fgrep 'Thrift version ${libthrift.version}' &&
- exit 0;
+ ${thrift.home}/bin/thrift -version | fgrep 'Thrift version ${libthrift.version}' && exit 0;
echo "=================================================================================";
- echo "========== [FATAL] Build is configured to require Thrift version ${libthrift.version}
- =========";
+ echo "========== [FATAL] Build is configured to require Thrift version ${libthrift.version} =========";
echo "========== Currently installed: ";
${thrift.home}/bin/thrift -version;
echo "=================================================================================";
diff --git a/standalone-metastore/metastore-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogServer.java b/standalone-metastore/metastore-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogServer.java
index 4b1123f30cb8..6ddaf2331d1f 100644
--- a/standalone-metastore/metastore-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogServer.java
+++ b/standalone-metastore/metastore-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogServer.java
@@ -50,14 +50,9 @@
public class HMSCatalogServer {
private static final String CACHE_EXPIRY = "hive.metastore.catalog.cache.expiry";
- private static final String CACHE_AUTHORIZATION = "hive.metastore.catalog.cache.authorization";
private static final String JETTY_THREADPOOL_MIN = "hive.metastore.catalog.jetty.threadpool.min";
private static final String JETTY_THREADPOOL_MAX = "hive.metastore.catalog.jetty.threadpool.max";
private static final String JETTY_THREADPOOL_IDLE = "hive.metastore.catalog.jetty.threadpool.idle";
- /**
- * The metric names prefix.
- */
- static final String HMS_METRIC_PREFIX = "hmscatalog.";
private static final Logger LOG = LoggerFactory.getLogger(HMSCatalogServer.class);
private static Reference catalogRef;
@@ -92,12 +87,12 @@ public static Catalog createCatalog(Configuration configuration) {
properties.put("external-warehouse", cextwarehouse);
}
catalog.initialize("hive", properties);
- long expiry = 0;//configuration.getLong(CACHE_EXPIRY, 60_000L);
+ long expiry = configuration.getLong(CACHE_EXPIRY, 60_000L);
return expiry > 0? HiveCachingCatalog.wrap(catalog, expiry) : catalog;
}
public static HttpServlet createServlet(Configuration configuration, Catalog catalog) throws IOException {
- String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.CATALOG_SERVLET_AUTH);
+ String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_AUTH);
boolean jwt = "jwt".equalsIgnoreCase(auth);
SecureServletCaller security = new ServletSecurity(configuration, jwt);
Catalog actualCatalog = catalog;
@@ -112,11 +107,12 @@ public static HttpServlet createServlet(Configuration configuration, Catalog cat
/**
* Convenience method to start a http server that only serves this servlet.
* @param conf the configuration
+ * @param catalog the catalog instance to serve
* @return the server instance
* @throws Exception if servlet initialization fails
*/
public static Server startServer(Configuration conf, HiveCatalog catalog) throws Exception {
- int port = MetastoreConf.getIntVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PORT);
+ int port = MetastoreConf.getIntVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PORT);
if (port < 0) {
return null;
}
@@ -125,7 +121,7 @@ public static Server startServer(Configuration conf, HiveCatalog catalog) throws
context.setContextPath("/");
ServletHolder servletHolder = new ServletHolder(servlet);
servletHolder.setInitParameter("javax.ws.rs.Application", "ServiceListPublic");
- final String cli = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PATH);
+ final String cli = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PATH);
context.addServlet(servletHolder, "/" + cli + "/*");
context.setVirtualHosts(null);
context.setGzipHandler(new GzipHandler());
diff --git a/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/HMSTestBase.java b/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/HMSTestBase.java
index 5af98a7198ae..8e1fb3691a53 100644
--- a/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/HMSTestBase.java
+++ b/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/HMSTestBase.java
@@ -159,9 +159,9 @@ public void setUp() throws Exception {
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.SCHEMA_INFO_CLASS, "org.apache.iceberg.rest.HMSTestBase$TestSchemaInfo");
// Events that get cleaned happen in batches of 1 to exercise batching code
MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.EVENT_CLEAN_MAX_EVENTS, 1L);
- MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PORT, 0);
- MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_AUTH, "jwt");
- MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CATALOG_SERVLET_PATH, catalogPath);
+ MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PORT, 0);
+ MetastoreConf.setVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_AUTH, "jwt");
+ MetastoreConf.setVar(conf, MetastoreConf.ConfVars.ICEBERG_CATALOG_SERVLET_PATH, catalogPath);
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.THRIFT_METASTORE_AUTHENTICATION_JWT_JWKS_URL,
"http://localhost:" + MOCK_JWKS_SERVER_PORT + "/jwks");
MOCK_JWKS_SERVER.stubFor(get("/jwks")
diff --git a/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/TestHMSCatalog.java b/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/TestHMSCatalog.java
index 459f263273da..456398909f54 100644
--- a/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/TestHMSCatalog.java
+++ b/standalone-metastore/metastore-catalog/src/test/java/org/apache/iceberg/rest/TestHMSCatalog.java
@@ -31,10 +31,6 @@
import org.apache.iceberg.Transaction;
import org.apache.iceberg.catalog.Namespace;
import org.apache.iceberg.catalog.TableIdentifier;
-import static org.apache.iceberg.rest.HMSTestBase.DB_NAME;
-import static org.apache.iceberg.rest.HMSTestBase.RND;
-import static org.apache.iceberg.rest.HMSTestBase.clientCall;
-import static org.apache.iceberg.rest.HMSTestBase.reportMetricCounters;
import org.apache.iceberg.types.Types;
import static org.apache.iceberg.types.Types.NestedField.required;
import org.junit.Assert;
@@ -59,11 +55,6 @@ public void tearDown() throws Exception {
super.tearDown();
}
- @Test
- public void testC0() throws Exception {
- testCreateNamespaceHttp();
- }
-
@Test
public void testCreateNamespaceHttp() throws Exception {
String ns = "nstesthttp";
@@ -138,7 +129,6 @@ public void testCreateTableTxnBuilder() throws Exception {
Object response = clientCall(jwt, url, "GET", null);
Assert.assertNotNull(response);
-if (false) {
// list tables in hivedb
url = new URL("http://hive@localhost:" + catalogPort + "/" + catalogPath+"/v1/namespaces/" + DB_NAME + "/tables");
// succeed
@@ -155,7 +145,6 @@ public void testCreateTableTxnBuilder() throws Exception {
// quick check on metrics
Map counters = reportMetricCounters("list_namespaces", "list_tables", "load_table");
counters.forEach((key, value) -> Assert.assertTrue(key, value > 0));
-}
table = catalog.loadTable(tableIdent);
Assert.assertNotNull(table);
} catch (Exception xany) {
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
index 544f26dd9d88..9f9e33742009 100644
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
+++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
@@ -1827,6 +1827,20 @@ public enum ConfVars {
"hive.metastore.properties.servlet.auth", "jwt",
"Property-maps servlet authentication method (simple or jwt)."
),
+ ICEBERG_CATALOG_SERVLET_PATH("hive.metastore.catalog.servlet.path",
+ "hive.metastore.catalog.servlet.path", "icecli",
+ "HMS Iceberg Catalog servlet path component of URL endpoint."
+ ),
+ ICEBERG_CATALOG_SERVLET_PORT("hive.metastore.catalog.servlet.port",
+ "hive.metastore.catalog.servlet.port", -1,
+ "HMS Iceberg Catalog servlet server port. Negative value disables the servlet," +
+ " 0 will let the system determine the catalog server port," +
+ " positive value will be used as-is."
+ ),
+ ICEBERG_CATALOG_SERVLET_AUTH("hive.metastore.catalog.servlet.auth",
+ "hive.metastore.catalog.servlet.auth", "jwt",
+ "HMS Iceberg Catalog servlet authentication method (simple or jwt)."
+ ),
// Deprecated Hive values that we are keeping for backwards compatibility.
@Deprecated
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/metasummary/SummaryMapBuilder.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/metasummary/SummaryMapBuilder.java
new file mode 100644
index 000000000000..f3b52c7f9cb8
--- /dev/null
+++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/metasummary/SummaryMapBuilder.java
@@ -0,0 +1,45 @@
+/*
+ * 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.hadoop.hive.metastore.metasummary;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class SummaryMapBuilder {
+ private final Map container = new HashMap<>();
+
+ public SummaryMapBuilder add(String key, Object value) {
+ container.put(key, value);
+ return this;
+ }
+
+ public Map build() {
+ Map result = new HashMap<>(container);
+ container.clear();
+ return result;
+ }
+
+ public T get(String key, Class type) {
+ if (!container.containsKey(key)) {
+ return null;
+ }
+ return type.cast(container.get(key));
+ }
+}
diff --git a/standalone-metastore/metastore-server/pom.xml b/standalone-metastore/metastore-server/pom.xml
index a33fd4fc5a25..883c55a48392 100644
--- a/standalone-metastore/metastore-server/pom.xml
+++ b/standalone-metastore/metastore-server/pom.xml
@@ -12,8 +12,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
+
hive-standalone-metastore
org.apache.hive
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 0fd998b2df57..3ce67f8f23ff 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -18,6 +18,8 @@
package org.apache.hadoop.hive.metastore;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import org.apache.commons.cli.OptionBuilder;
@@ -120,12 +122,17 @@ public class HiveMetaStore extends ThriftHiveMetastore {
private static String msHost = null;
private static ThriftServer thriftServer;
private static Server propertyServer = null;
+ private static Server icebergServer = null;
public static Server getPropertyServer() {
return propertyServer;
}
+ public static Server getIcebergServer() {
+ return icebergServer;
+ }
+
public static boolean isRenameAllowed(Database srcDB, Database destDB) {
if (!srcDB.getName().equalsIgnoreCase(destDB.getName())) {
if (ReplChangeManager.isSourceOfReplication(srcDB) || ReplChangeManager.isSourceOfReplication(destDB)) {
@@ -319,6 +326,23 @@ public static void main(String[] args) throws Throwable {
if (isCliVerbose) {
System.err.println(shutdownMsg);
}
+ // property server
+ if (propertyServer != null) {
+ try {
+ propertyServer.stop();
+ } catch (Exception e) {
+ LOG.error("Error stopping Property Map server.", e);
+ }
+ }
+ // iceberg server
+ if (icebergServer != null) {
+ try {
+ icebergServer.stop();
+ } catch (Exception e) {
+ LOG.error("Error stopping Iceberg API server.", e);
+ }
+ }
+ // metrics
if (MetastoreConf.getBoolVar(conf, ConfVars.METRICS_ENABLED)) {
try {
Metrics.shutdown();
@@ -389,7 +413,7 @@ private static ThriftServer startHttpMetastore(int port, Configuration conf)
throws Exception {
LOG.info("Attempting to start http metastore server on port: {}", port);
// login principal if security is enabled
- ServletSecurity.loginServerPincipal(conf);
+ ServletSecurity.loginServerPrincipal(conf);
long maxMessageSize = MetastoreConf.getLongVar(conf, ConfVars.SERVER_MAX_MESSAGE_SIZE);
int minWorkerThreads = MetastoreConf.getIntVar(conf, ConfVars.SERVER_MIN_THREADS);
@@ -742,10 +766,26 @@ public static void startMetaStore(int port, HadoopThriftAuthBridge bridge,
}
// optionally create and start the property server and servlet
propertyServer = PropertyServlet.startServer(conf);
+ // optionally create and start the Iceberg REST server and servlet
+ icebergServer = startIcebergCatalog(conf);
thriftServer.start();
}
+ static Server startIcebergCatalog(Configuration configuration) {
+ try {
+ Class> iceClazz = Class.forName("org.apache.iceberg.rest.HMSCatalogServer");
+ Method iceStart = iceClazz.getMethod("startServer", Configuration.class);
+ return (Server) iceStart.invoke(null, configuration);
+ } catch (ClassNotFoundException xnf) {
+ LOG.warn("unable to start Iceberg REST Catalog server {}, missing jar?", xnf);
+ return null;
+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+ LOG.error("unable to start Iceberg REST Catalog server {}", e);
+ return null;
+ }
+ }
+
/**
* @param port where metastore server is running
* @return metastore server instance URL. If the metastore server was bound to a configured
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HmsThriftHttpServlet.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HmsThriftHttpServlet.java
index 4572f86e0247..2ecd00810484 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HmsThriftHttpServlet.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HmsThriftHttpServlet.java
@@ -35,7 +35,7 @@
JWTs sent in the Authorization header in HTTP request.
*/
public class HmsThriftHttpServlet extends TServlet {
- private final ServletSecurity security;
+ private final SecureServletCaller security;
public HmsThriftHttpServlet(TProcessor processor,
TProtocolFactory protocolFactory, Configuration conf) {
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java
index 1d6cc9d6ade1..0f82dce30b9b 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java
@@ -37,6 +37,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
@@ -65,14 +66,22 @@ public class PropertyServlet extends HttpServlet {
/** The configuration. */
private final Configuration configuration;
/** The security. */
- private final ServletSecurity security;
+ private final SecureServletCaller security;
- PropertyServlet(Configuration configuration) {
+ static boolean isAuthJwt(Configuration configuration) {
String auth = MetastoreConf.getVar(configuration, MetastoreConf.ConfVars.PROPERTIES_SERVLET_AUTH);
- boolean jwt = auth != null && "jwt".equals(auth.toLowerCase());
- this.security = new ServletSecurity(configuration, jwt);
+ return "jwt".equalsIgnoreCase(auth);
+ }
+
+ PropertyServlet(Configuration configuration) {
+ this(configuration, new ServletSecurity(configuration, isAuthJwt(configuration)));
+ }
+
+ PropertyServlet(Configuration configuration, SecureServletCaller security) {
+ this.security = security;
this.configuration = configuration;
}
+
private String strError(String msg, Object...args) {
return String.format(PTYERROR + msg, args);
}
@@ -344,6 +353,10 @@ public static Server startServer(Configuration conf) throws Exception {
return null;
}
String cli = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.PROPERTIES_SERVLET_PATH);
+ return startServer(conf, port, cli, new PropertyServlet(conf));
+ }
+
+ public static Server startServer(Configuration conf, int port, String path, Servlet servlet) throws Exception {
// HTTP Server
Server server = new Server();
server.setStopAtShutdown(true);
@@ -359,11 +372,11 @@ public static Server startServer(Configuration conf) throws Exception {
ServletHandler handler = new ServletHandler();
server.setHandler(handler);
ServletHolder holder = handler.newServletHolder(Source.EMBEDDED);
- holder.setServlet(new PropertyServlet(conf)); //
- handler.addServletWithMapping(holder, "/"+cli+"/*");
+ holder.setServlet(servlet); //
+ handler.addServletWithMapping(holder, "/"+path+"/*");
server.start();
if (!server.isStarted()) {
- LOGGER.error("unable to start property-maps servlet server, path {}, port {}", cli, port);
+ LOGGER.error("unable to start property-maps servlet server, path {}, port {}", path, port);
} else {
LOGGER.info("started property-maps servlet server on {}", server.getURI());
}
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/SecureServletCaller.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/SecureServletCaller.java
new file mode 100644
index 000000000000..206684bf1b2e
--- /dev/null
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/SecureServletCaller.java
@@ -0,0 +1,60 @@
+/* * 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.hadoop.hive.metastore;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Secures servlet processing.
+ */
+public interface SecureServletCaller {
+ /**
+ * Should be called in Servlet.init()
+ * @throws ServletException if the jwt validator creation throws an exception
+ */
+ public void init() throws ServletException;
+
+ /**
+ * Any http method executor.
+ */
+ @FunctionalInterface
+ interface MethodExecutor {
+ /**
+ * The method to call to secure the execution of a (http) method.
+ * @param request the request
+ * @param response the response
+ * @throws ServletException if the method executor fails
+ * @throws IOException if the Json in/out fail
+ */
+ void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
+ }
+
+ /**
+ * The method to call to secure the execution of a (http) method.
+ * @param request the request
+ * @param response the response
+ * @param executor the method executor
+ */
+ void execute(HttpServletRequest request, HttpServletResponse response, MethodExecutor executor)
+ throws IOException;
+
+
+}
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java
index 48cd4ac0e110..2f2c7cda7830 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ServletSecurity.java
@@ -58,7 +58,6 @@ public ServletSecurity(Configuration conf, boolean jwt) {
this.jwtAuthEnabled = jwt;
}
-
/**
* Should be called in Servlet.init()
* @throws ServletException if the jwt validator creation throws an exception
@@ -79,7 +78,6 @@ public void init() throws ServletException {
* @param request the request
* @param response the response
* @param executor the method executor
- * @throws ServletException if the method executor fails
* @throws IOException if the Json in/out fail
*/
public void execute(HttpServletRequest request, HttpServletResponse response, MethodExecutor executor)