Skip to content

Commit

Permalink
remove debug action
Browse files Browse the repository at this point in the history
  • Loading branch information
FANNG1 committed Jul 3, 2024
1 parent 83c1479 commit e450db2
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 218 deletions.
2 changes: 1 addition & 1 deletion catalogs/catalog-lakehouse-iceberg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
implementation(libs.bundles.jetty)
implementation(libs.bundles.jersey)
implementation(libs.bundles.log4j)
implementation(libs.caffeine)
// implementation(libs.caffeine)
implementation(libs.cglib)
implementation(libs.commons.collections4)
implementation(libs.commons.io)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
import static com.datastrato.gravitino.connector.PropertyEntry.enumImmutablePropertyEntry;
import static com.datastrato.gravitino.connector.PropertyEntry.stringRequiredPropertyEntry;

import com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.AuthenticationConfig;
import com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos.KerberosConfig;
import com.datastrato.gravitino.connector.BaseCatalogPropertiesMetadata;
import com.datastrato.gravitino.connector.PropertyEntry;
import com.datastrato.gravitino.iceberg.common.IcebergCatalogBackend;
import com.datastrato.gravitino.iceberg.common.authentication.AuthenticationConfig;
import com.datastrato.gravitino.iceberg.common.authentication.kerberos.KerberosConfig;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import com.datastrato.gravitino.catalog.lakehouse.iceberg.IcebergSchemaPropertiesMetadata;
import com.datastrato.gravitino.catalog.lakehouse.iceberg.IcebergTable;
import com.datastrato.gravitino.catalog.lakehouse.iceberg.ops.IcebergTableOpsHelper;
import com.datastrato.gravitino.catalog.lakehouse.iceberg.utils.IcebergCatalogUtil;
import com.datastrato.gravitino.client.GravitinoMetalake;
import com.datastrato.gravitino.dto.util.DTOConverters;
import com.datastrato.gravitino.exceptions.NoSuchSchemaException;
import com.datastrato.gravitino.exceptions.SchemaAlreadyExistsException;
import com.datastrato.gravitino.exceptions.TableAlreadyExistsException;
import com.datastrato.gravitino.iceberg.common.IcebergConfig;
import com.datastrato.gravitino.iceberg.common.utils.IcebergCatalogUtil;
import com.datastrato.gravitino.integration.test.container.ContainerSuite;
import com.datastrato.gravitino.integration.test.util.AbstractIT;
import com.datastrato.gravitino.integration.test.util.GravitinoITUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*/
package com.datastrato.gravitino.catalog.lakehouse.iceberg.integration.test;

import static com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.AuthenticationConfig.AUTH_TYPE_KEY;
import static com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos.KerberosConfig.IMPERSONATION_ENABLE_KEY;
import static com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos.KerberosConfig.KET_TAB_URI_KEY;
import static com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos.KerberosConfig.PRINCIPAL_KEY;
import static com.datastrato.gravitino.connector.BaseCatalog.CATALOG_BYPASS_PREFIX;
import static com.datastrato.gravitino.iceberg.common.authentication.AuthenticationConfig.AUTH_TYPE_KEY;
import static com.datastrato.gravitino.iceberg.common.authentication.kerberos.KerberosConfig.IMPERSONATION_ENABLE_KEY;
import static com.datastrato.gravitino.iceberg.common.authentication.kerberos.KerberosConfig.KET_TAB_URI_KEY;
import static com.datastrato.gravitino.iceberg.common.authentication.kerberos.KerberosConfig.PRINCIPAL_KEY;

import com.datastrato.gravitino.Catalog;
import com.datastrato.gravitino.NameIdentifier;
Expand Down
1 change: 1 addition & 0 deletions iceberg-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
implementation(project(":server-common"))
implementation(libs.bundles.iceberg)
implementation(libs.bundles.log4j)
implementation(libs.caffeine)
implementation(libs.commons.lang3)
implementation(libs.guava)
implementation(libs.iceberg.hive.metastore)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Datastrato Pvt Ltd.
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.iceberg.common;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
* This software is licensed under the Apache License version 2.
*/

package com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication;

import static com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos.KerberosConfig.DEFAULT_IMPERSONATION_ENABLE;
package com.datastrato.gravitino.iceberg.common.authentication;

import com.datastrato.gravitino.Config;
import com.datastrato.gravitino.config.ConfigBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos;
package com.datastrato.gravitino.iceberg.common.authentication.kerberos;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* This software is licensed under the Apache License version 2.
*/

package com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos;
package com.datastrato.gravitino.iceberg.common.authentication.kerberos;

import com.datastrato.gravitino.catalog.lakehouse.iceberg.IcebergHiveCachedClientPool;
import com.datastrato.gravitino.iceberg.common.utils.IcebergHiveCachedClientPool;
import com.datastrato.gravitino.utils.PrincipalUtils;
import java.io.IOException;
import java.lang.reflect.Field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This software is licensed under the Apache License version 2.
*/

package com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos;
package com.datastrato.gravitino.iceberg.common.authentication.kerberos;

import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* This software is licensed under the Apache License version 2.
*/

package com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.kerberos;
package com.datastrato.gravitino.iceberg.common.authentication.kerberos;

import com.datastrato.gravitino.catalog.lakehouse.iceberg.authentication.AuthenticationConfig;
import com.datastrato.gravitino.config.ConfigBuilder;
import com.datastrato.gravitino.config.ConfigConstants;
import com.datastrato.gravitino.config.ConfigEntry;
import com.datastrato.gravitino.connector.PropertyEntry;
import com.datastrato.gravitino.iceberg.common.authentication.AuthenticationConfig;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
/*
* Copyright 2023 Datastrato Pvt Ltd.
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.iceberg.common.utils;

import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION;
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION;

import com.datastrato.gravitino.iceberg.common.IcebergCatalogBackend;
import com.datastrato.gravitino.iceberg.common.IcebergConfig;
import com.datastrato.gravitino.iceberg.common.IcebergConstants;
import com.datastrato.gravitino.iceberg.common.authentication.AuthenticationConfig;
import com.datastrato.gravitino.iceberg.common.authentication.kerberos.HiveBackendProxy;
import com.datastrato.gravitino.iceberg.common.authentication.kerberos.KerberosClient;
import com.google.common.base.Preconditions;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.iceberg.CatalogProperties;
import org.apache.iceberg.catalog.Catalog;
Expand Down Expand Up @@ -41,10 +50,7 @@ private static HiveCatalog loadHiveCatalog(Map<String, String> properties) {
properties.forEach(hdfsConfiguration::set);
IcebergConfig icebergConfig = new IcebergConfig(properties);
String icebergCatalogName = icebergConfig.getCatalogBackendName("hive");
hiveCatalog.setConf(hdfsConfiguration);
hiveCatalog.initialize(icebergCatalogName, properties);
return hiveCatalog;
/*

AuthenticationConfig authenticationConfig = new AuthenticationConfig(properties);
if (authenticationConfig.isSimpleAuth()) {
hiveCatalog.setConf(hdfsConfiguration);
Expand All @@ -70,10 +76,8 @@ private static HiveCatalog loadHiveCatalog(Map<String, String> properties) {
throw new UnsupportedOperationException(
"Unsupported authentication method: " + authenticationConfig.getAuthType());
}
*/
}

/*
private static String initKerberosAndReturnRealm(
Map<String, String> properties, Configuration conf) {
try {
Expand All @@ -85,15 +89,18 @@ private static String initKerberosAndReturnRealm(
throw new RuntimeException("Failed to login with kerberos", e);
}
}
*/

private static JdbcCatalog loadJdbcCatalog(Map<String, String> properties) {
IcebergConfig icebergConfig = new IcebergConfig(properties);
String driverClassName = icebergConfig.getJdbcDriver();
String icebergCatalogName = icebergConfig.getCatalogBackendName("jdbc");

Preconditions.checkNotNull(properties.get(IcebergConstants.ICEBERG_JDBC_USER), IcebergConstants.ICEBERG_JDBC_USER + " is null");
Preconditions.checkNotNull(properties.get(IcebergConstants.ICEBERG_JDBC_PASSWORD), IcebergConstants.ICEBERG_JDBC_PASSWORD + " is null");
Preconditions.checkNotNull(
properties.get(IcebergConstants.ICEBERG_JDBC_USER),
IcebergConstants.ICEBERG_JDBC_USER + " is null");
Preconditions.checkNotNull(
properties.get(IcebergConstants.ICEBERG_JDBC_PASSWORD),
IcebergConstants.ICEBERG_JDBC_PASSWORD + " is null");

try {
// Load the jdbc driver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
/*
* 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.
*
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/

package com.datastrato.gravitino.catalog.lakehouse.iceberg;
package com.datastrato.gravitino.iceberg.common.utils;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
Expand Down
Loading

0 comments on commit e450db2

Please sign in to comment.