Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-28059: Iceberg REST Catalog #5606

Merged
merged 54 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
26d22d0
HIVE-28059 : major rebase stage 1;
henrib Jan 10, 2025
a573191
Merge branch 'master' of https://github.com/apache/hive
henrib Jan 31, 2025
23a3c90
HIVE-28059 : major rebase and simpler code;
henrib Jan 31, 2025
e90e1d8
HIVE-28059 : rollback changes that are unnecessary;
henrib Feb 3, 2025
f7da91b
HIVE-28059 : rollback changes that are unnecessary;
henrib Feb 3, 2025
ef8b220
Update iceberg_stats.q.out
henrib Feb 3, 2025
4ee1720
HIVE-28059 : increase test server startup wait time;
henrib Feb 4, 2025
8a09245
HIVE-28059 : attempting a rename on artefactId to blindfix build issue;
henrib Feb 4, 2025
92b9883
HIVE-28059 : fixing src packaging;
henrib Feb 6, 2025
822ad44
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 6, 2025
bc36af2
HIVE-28059 : fixing PR comments;
henrib Feb 11, 2025
399e25b
HIVE-28059 : fixing more PR comments (conf, pom);
henrib Feb 11, 2025
cfe85d2
HIVE-28059 : refactored cache;
henrib Feb 12, 2025
81db7e4
HIVE-28059 : remove dead class & code;
henrib Feb 12, 2025
931eff5
HIVE-28059 : remove dead code;
henrib Feb 12, 2025
37ae8f3
HIVE-28059 : moving configuration variables to the common place;
henrib Feb 12, 2025
c3c71c0
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 12, 2025
1ab4d94
HIVE-28059 : default servlet path update (iceberg);
henrib Feb 13, 2025
7cb3ce2
HIVE-28059 : pom cleanup;
henrib Feb 13, 2025
33a9cff
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 13, 2025
cae7f2f
HIVE-28059 : renamed & commented test helper class
henrib Feb 13, 2025
a4d66fd
HIVE-28059 : removed useless synchronized;
henrib Feb 13, 2025
b83cfaf
HIVE-28059 : removed SecureServletCaller;
henrib Feb 14, 2025
e79c155
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 14, 2025
107e423
HIVE-28059 : nit, javadoc;
henrib Feb 15, 2025
4921457
HIVE-28059 : nit, javadoc (again!);
henrib Feb 15, 2025
9b7eb15
HIVE-28059 : javadoc (again!!);
henrib Feb 16, 2025
4c41e9c
HIVE-28059 : fix regression on PropertyServlet & test;
henrib Feb 16, 2025
507dd6e
HIVE-28059 : fix regression on PropertyServlet test;
henrib Feb 17, 2025
cc9f4fd
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 17, 2025
edd7148
HIVE-28059 : fix nits;
henrib Feb 18, 2025
0190228
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 19, 2025
0a6381c
HIVE-28059 : fixing more nits;
henrib Feb 19, 2025
2be9327
Javadoc nit;
henrib Feb 19, 2025
4750304
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 21, 2025
6c2b930
HIVE-28059 : create only one Jetty instance for HMS property & Iceber…
henrib Feb 21, 2025
11c9718
HIVE-28059 :
henrib Feb 21, 2025
0b1add3
HIVE-28059: Update src.xml
henrib Feb 21, 2025
670ab10
HIVE-28059 :
henrib Feb 21, 2025
e84c069
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 23, 2025
77fb867
HIVE-28059 : fixing property servlet tests;
henrib Feb 23, 2025
447f48d
HIVE-28059 : adding REST catalog to packaging;
henrib Feb 24, 2025
b99d91a
HIVE-28059 : addressing easiest pr comments;
henrib Feb 26, 2025
70b8c75
HIVE-28059 : fix packaging;
henrib Feb 27, 2025
e1675bb
Merge branch 'apache:master' into HMS-Catalog
henrib Feb 27, 2025
1efdf6f
Merge branch 'apache:master' into HMS-Catalog
henrib Mar 2, 2025
7f75025
HIVE-28059 : fix jar naming;
henrib Mar 2, 2025
4e09a68
HIVE-28059 : fixing nits & javadoc;
henrib Mar 2, 2025
370a0e0
HIVE-28059 : fixing javadoc;
henrib Mar 3, 2025
edcaea3
Merge branch 'apache:master' into HMS-Catalog
henrib Mar 6, 2025
d44bfe0
HIVE-28059 : latest nits (servlet names, etc);
henrib Mar 6, 2025
1e7a8da
HIVE-28059 : fixing thrift over http servlet init;
henrib Mar 7, 2025
81041bb
Merge branch 'apache:master' into HMS-Catalog
henrib Mar 7, 2025
f0977c3
Merge branch 'apache:master' into HMS-Catalog
henrib Mar 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packaging/src/main/assembly/src.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<include>standalone-metastore/metastore-common/**/*</include>
<include>standalone-metastore/metastore-server/**/*</include>
<include>standalone-metastore/metastore-tools/**/*</include>
<include>standalone-metastore/metastore-catalog/**/*</include>
<include>standalone-metastore/src/assembly/src.xml</include>
<include>standalone-metastore/pom.xml</include>
<include>streaming/**/*</include>
Expand Down
271 changes: 271 additions & 0 deletions standalone-metastore/metastore-catalog/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hive-standalone-metastore</artifactId>
<groupId>org.apache.hive</groupId>
<version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hive-standalone-metastore-icecat</artifactId>
<name>Hive Metastore Iceberg Catalog</name>
<properties>
<standalone.metastore.path.to.root>..</standalone.metastore.path.to.root>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<log4j2.debug>false</log4j2.debug>
<hive.version>${project.parent.version}</hive.version>
<iceberg.version>1.6.1</iceberg.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-server</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-common</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-iceberg-shading</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-iceberg-handler</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-iceberg-catalog</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.iceberg</groupId>
<artifactId>iceberg-bundled-guava</artifactId>
<version>${iceberg.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-common</artifactId>
<version>${hive.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-server</artifactId>
<version>${hive.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5</artifactId>
<version>5.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>${wiremock.jre8.standalone.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-auth</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs-client</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Suppress source assembly -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>none</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>test</phase>
<configuration>
<systemProperties>
<systemProperty>
<key>log4j2.debug</key>
<value>false</value>
</systemProperty>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* 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.iceberg.rest;

import com.github.benmanes.caffeine.cache.Ticker;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.iceberg.CachingCatalog;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.catalog.Namespace;
import org.apache.iceberg.catalog.SupportsNamespaces;
import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.iceberg.exceptions.NamespaceNotEmptyException;
import org.apache.iceberg.exceptions.NoSuchNamespaceException;


/**
* Class that wraps an Iceberg Catalog to cache tables.
* @param <CATALOG> the catalog class
*/
public class HMSCachingCatalog<CATALOG extends Catalog & SupportsNamespaces> extends CachingCatalog implements SupportsNamespaces {
protected final CATALOG nsCatalog;

public HMSCachingCatalog(CATALOG catalog, long expiration) {
super(catalog, true, expiration, Ticker.systemTicker());
nsCatalog = catalog;
}

public CATALOG hmsUnwrap() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but very convenient for anyone who needs to extend behavior; avoids having to keep the wrapped catalog in a separate member.

return nsCatalog;
}

@Override
public void createNamespace(Namespace nmspc, Map<String, String> map) {
nsCatalog.createNamespace(nmspc, map);
}

@Override
public List<Namespace> listNamespaces(Namespace nmspc) throws NoSuchNamespaceException {
return nsCatalog.listNamespaces(nmspc);
}

@Override
public Map<String, String> loadNamespaceMetadata(Namespace nmspc) throws NoSuchNamespaceException {
return nsCatalog.loadNamespaceMetadata(nmspc);
}

@Override
public boolean dropNamespace(Namespace nmspc) throws NamespaceNotEmptyException {
List<TableIdentifier> tables = listTables(nmspc);
for (TableIdentifier ident : tables) {
invalidateTable(ident);
}
return nsCatalog.dropNamespace(nmspc);
}

@Override
public boolean setProperties(Namespace nmspc, Map<String, String> map) throws NoSuchNamespaceException {
return nsCatalog.setProperties(nmspc, map);
}

@Override
public boolean removeProperties(Namespace nmspc, Set<String> set) throws NoSuchNamespaceException {
return nsCatalog.removeProperties(nmspc, set);
}

}
Loading
Loading