Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions catalogs/catalog-lakehouse-iceberg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ tasks.test {
exclude("**/integration/test/**")
} else {
dependsOn(tasks.jar)
dependsOn(":iceberg:iceberg-rest-server:jar")
dependsOn(":lance:lance-rest-server:jar")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public abstract class CatalogIcebergBaseIT extends BaseIT {

@BeforeAll
public void startup() throws Exception {
ignoreIcebergRestService = false;
super.ignoreAuxRestService = false;
super.startIntegrationTest();
containerSuite.startHiveContainer();
initIcebergCatalogProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void startIntegrationTest() {
// Config kerberos configuration for Gravitino server
addKerberosConfig();

ignoreIcebergRestService = false;
super.ignoreAuxRestService = false;
// Start Gravitino server
super.startIntegrationTest();
} catch (Exception e) {
Expand Down
2 changes: 1 addition & 1 deletion conf/gravitino.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ gravitino.authorization.serviceAdmins = anonymous

# THE CONFIGURATION FOR AUXILIARY SERVICE
# Auxiliary service names, separate by ',', currently support iceberg-rest and lance-rest
gravitino.auxService.names = iceberg-rest
gravitino.auxService.names = iceberg-rest,lance-rest
# Iceberg REST service classpath
gravitino.iceberg-rest.classpath = iceberg-rest-server/libs, iceberg-rest-server/conf
# Iceberg REST service host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected String flinkByPass(String key) {
protected abstract String getProvider();

private void initIcebergRestServiceEnv() {
ignoreIcebergRestService = false;
super.ignoreAuxRestService = false;
Map<String, String> icebergRestServiceConfigs = new HashMap<>();
icebergRestServiceConfigs.put(
"gravitino."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public MiniGravitino(MiniGravitinoContext context) throws IOException {
mockConfDir.mkdirs();
}

private void removeIcebergRestConfiguration(Properties properties) {
private void removeAuxRestConfiguration(Properties properties) {
// Disable Iceberg REST service
properties.remove(
AuxiliaryServiceManager.GRAVITINO_AUX_SERVICE_PREFIX
Expand All @@ -103,9 +103,9 @@ public void start() throws Exception {
serverConfig.loadPropertiesFromFile(
new File(ITUtils.joinPath(mockConfDir.getAbsolutePath(), "gravitino.conf")));

// Remove Iceberg rest service.
if (context.ignoreIcebergRestService) {
removeIcebergRestConfiguration(properties);
// Disable auxiliary rest service.
if (context.ignoreAuxRestService) {
removeAuxRestConfiguration(properties);
ITUtils.overwriteConfigFile(
ITUtils.joinPath(mockConfDir.getAbsolutePath(), "gravitino.conf"), properties);
}
Expand Down Expand Up @@ -230,6 +230,22 @@ Map<String, String> getIcebergRestServiceConfigs() throws IOException {
return customConfigs;
}

private Map<String, String> getLanceRestServiceConfigs() throws IOException {
Map<String, String> customConfigs = new HashMap<>();

String lanceJarPath = Paths.get("lance", "lance-rest-server", "build", "libs").toString();
String lanceConfigPath =
Paths.get("lance", "lance-rest-server", "src", "main", "resources").toString();
customConfigs.put(
"gravitino.lance-rest." + AuxiliaryServiceManager.AUX_SERVICE_CLASSPATH,
String.join(",", lanceJarPath, lanceConfigPath));

customConfigs.put(
"gravitino.lance-rest." + JettyServerConfig.WEBSERVER_HTTP_PORT.getKey(),
String.valueOf(RESTUtils.findAvailablePort(4000, 5000)));
return customConfigs;
}

// Customize the config file
private void customizeConfigFile(String configTempFileName, String configFileName)
throws IOException {
Expand All @@ -239,6 +255,7 @@ private void customizeConfigFile(String configTempFileName, String configFileNam
String.valueOf(RESTUtils.findAvailablePort(2000, 3000)));

configMap.putAll(getIcebergRestServiceConfigs());
configMap.putAll(getLanceRestServiceConfigs());
configMap.putAll(context.customConfig);

ITUtils.rewriteConfigFile(configTempFileName, configFileName, configMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

public class MiniGravitinoContext {
Map<String, String> customConfig;
final boolean ignoreIcebergRestService;
final boolean ignoreAuxRestService;

public MiniGravitinoContext(Map<String, String> customConfig, boolean ignoreIcebergRestService) {
public MiniGravitinoContext(Map<String, String> customConfig, boolean ignoreAuxRestService) {
this.customConfig = customConfig;
this.ignoreIcebergRestService = ignoreIcebergRestService;
this.ignoreAuxRestService = ignoreAuxRestService;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class BaseIT {

protected Map<String, String> customConfigs = new HashMap<>();

protected boolean ignoreIcebergRestService = true;
protected boolean ignoreAuxRestService = true;

public String DOWNLOAD_MYSQL_JDBC_DRIVER_URL =
"https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar";
Expand Down Expand Up @@ -330,8 +330,7 @@ public void startIntegrationTest() throws Exception {
serverConfig = new ServerConfig();
customConfigs.put(ENTITY_RELATIONAL_JDBC_BACKEND_PATH.getKey(), file.getAbsolutePath());
if (testMode != null && testMode.equals(ITUtils.EMBEDDED_TEST_MODE)) {
MiniGravitinoContext context =
new MiniGravitinoContext(customConfigs, ignoreIcebergRestService);
MiniGravitinoContext context = new MiniGravitinoContext(customConfigs, ignoreAuxRestService);
miniGravitino = new MiniGravitino(context);
miniGravitino.start();
serverConfig = miniGravitino.getServerConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void initHiveEnv() {
protected void initCatalogEnv() throws Exception {}

private void initIcebergRestServiceEnv() {
ignoreIcebergRestService = false;
super.ignoreAuxRestService = false;
Map<String, String> icebergRestServiceConfigs = new HashMap<>();
icebergRestServiceConfigs.put(
"gravitino."
Expand Down
1 change: 1 addition & 0 deletions spark-connector/v3.3/spark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ tasks.test {
dependsOn(":catalogs:catalog-lakehouse-iceberg:jar")
dependsOn(":catalogs:catalog-hive:jar")
dependsOn(":iceberg:iceberg-rest-server:jar")
dependsOn(":lance:lance-rest-server:jar")
dependsOn(":catalogs:catalog-lakehouse-paimon:jar")
dependsOn(":catalogs:catalog-jdbc-mysql:jar")
dependsOn(":catalogs:catalog-jdbc-postgresql:jar")
Expand Down
1 change: 1 addition & 0 deletions spark-connector/v3.4/spark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ tasks.test {
dependsOn(":catalogs:catalog-lakehouse-iceberg:jar")
dependsOn(":catalogs:catalog-hive:jar")
dependsOn(":iceberg:iceberg-rest-server:jar")
dependsOn(":lance:lance-rest-server:jar")
dependsOn(":catalogs:catalog-lakehouse-paimon:jar")
dependsOn(":catalogs:catalog-jdbc-mysql:jar")
dependsOn(":catalogs:catalog-jdbc-postgresql:jar")
Expand Down
1 change: 1 addition & 0 deletions spark-connector/v3.5/spark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ tasks.test {
dependsOn(":catalogs:catalog-lakehouse-iceberg:jar")
dependsOn(":catalogs:catalog-hive:jar")
dependsOn(":iceberg:iceberg-rest-server:jar")
dependsOn(":lance:lance-rest-server:jar")
dependsOn(":catalogs:catalog-lakehouse-paimon:jar")
dependsOn(":catalogs:catalog-jdbc-mysql:jar")
dependsOn(":catalogs:catalog-jdbc-postgresql:jar")
Expand Down