Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
lefebsy committed Oct 24, 2024
1 parent 23f8284 commit dd8d860
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
import org.apache.polaris.core.admin.model.FileStorageConfigInfo;
import org.apache.polaris.core.admin.model.GcpStorageConfigInfo;
import org.apache.polaris.core.admin.model.PolarisCatalog;
import org.apache.polaris.core.admin.model.S3StorageConfigInfo;
import org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo;
import org.apache.polaris.core.admin.model.StorageConfigInfo;
import org.apache.polaris.core.storage.FileStorageConfigurationInfo;
import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo;
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo;
import org.apache.polaris.core.storage.gcp.GcpStorageConfigurationInfo;
import org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo;
import org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -142,22 +142,22 @@ private StorageConfigInfo getStorageInfo(Map<String, String> internalProperties)
.setAllowedLocations(awsConfig.getAllowedLocations())
.build();
}
if (configInfo instanceof S3StorageConfigurationInfo) {
S3StorageConfigurationInfo s3Config = (S3StorageConfigurationInfo) configInfo;
return S3StorageConfigInfo.builder()
if (configInfo instanceof S3CompatibleStorageConfigurationInfo) {
S3CompatibleStorageConfigurationInfo s3Config = (S3CompatibleStorageConfigurationInfo) configInfo;
return S3CompatibleStorageConfigInfo.builder()
.setStorageType(StorageConfigInfo.StorageTypeEnum.S3_COMPATIBLE)
.setS3Endpoint(s3Config.getS3Endpoint())
.setS3PathStyleAccess(s3Config.getS3PathStyleAccess())
.setCredsVendingStrategy(
org.apache.polaris.core.admin.model.S3StorageConfigInfo.CredsVendingStrategyEnum
org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo.CredsVendingStrategyEnum
.valueOf(
org.apache.polaris.core.admin.model.S3StorageConfigInfo
org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo
.CredsVendingStrategyEnum.class,
s3Config.getCredsVendingStrategy().name()))
.setCredsCatalogAndClientStrategy(
org.apache.polaris.core.admin.model.S3StorageConfigInfo
org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo
.CredsCatalogAndClientStrategyEnum.valueOf(
org.apache.polaris.core.admin.model.S3StorageConfigInfo
org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo
.CredsCatalogAndClientStrategyEnum.class,
s3Config.getCredsCatalogAndClientStrategy().name()))
.setAllowedLocations(s3Config.getAllowedLocations())
Expand Down Expand Up @@ -278,17 +278,15 @@ public Builder setStorageConfigurationInfo(
break;

case S3_COMPATIBLE:
S3StorageConfigInfo s3ConfigModel = (S3StorageConfigInfo) storageConfigModel;
S3CompatibleStorageConfigInfo s3ConfigModel = (S3CompatibleStorageConfigInfo) storageConfigModel;
config =
new S3StorageConfigurationInfo(
new S3CompatibleStorageConfigurationInfo(
PolarisStorageConfigurationInfo.StorageType.S3_COMPATIBLE,
S3StorageConfigInfo.CredsVendingStrategyEnum.valueOf(
org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo
.CredsVendingStrategyEnum.class,
S3CompatibleStorageConfigInfo.CredsVendingStrategyEnum.valueOf(
org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo.CredsVendingStrategyEnum.class,
s3ConfigModel.getCredsVendingStrategy().name()),
S3StorageConfigInfo.CredsCatalogAndClientStrategyEnum.valueOf(
org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo
.CredsCatalogAndClientStrategyEnum.class,
S3CompatibleStorageConfigInfo.CredsCatalogAndClientStrategyEnum.valueOf(
org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo.CredsCatalogAndClientStrategyEnum.class,
s3ConfigModel.getCredsCatalogAndClientStrategy().name()),
s3ConfigModel.getS3Endpoint(),
s3ConfigModel.getS3CredentialsCatalogAccessKeyId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo;
import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo;
import org.apache.polaris.core.storage.gcp.GcpStorageConfigurationInfo;
import org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo;
import org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -63,7 +63,7 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
@JsonSubTypes({
@JsonSubTypes.Type(value = AwsStorageConfigurationInfo.class),
@JsonSubTypes.Type(value = S3StorageConfigurationInfo.class),
@JsonSubTypes.Type(value = S3CompatibleStorageConfigurationInfo.class),
@JsonSubTypes.Type(value = AzureStorageConfigurationInfo.class),
@JsonSubTypes.Type(value = GcpStorageConfigurationInfo.class),
@JsonSubTypes.Type(value = FileStorageConfigurationInfo.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.core.storage.s3;
package org.apache.polaris.core.storage.s3compatible;

import java.net.URI;
import java.util.EnumMap;
Expand All @@ -36,17 +36,17 @@
import software.amazon.awssdk.services.sts.model.AssumeRoleResponse;

/** Credential vendor that supports generating */
public class S3CredentialsStorageIntegration
extends InMemoryStorageIntegration<S3StorageConfigurationInfo> {
public class S3CompatibleCredentialsStorageIntegration
extends InMemoryStorageIntegration<S3CompatibleStorageConfigurationInfo> {
private static final Logger LOGGER =
LoggerFactory.getLogger(S3CredentialsStorageIntegration.class);
LoggerFactory.getLogger(S3CompatibleCredentialsStorageIntegration.class);
private StsClient stsClient;

public S3CredentialsStorageIntegration() {
super(S3CredentialsStorageIntegration.class.getName());
public S3CompatibleCredentialsStorageIntegration() {
super(S3CompatibleCredentialsStorageIntegration.class.getName());
}

public void createStsClient(S3StorageConfigurationInfo s3storageConfig) {
public void createStsClient(S3CompatibleStorageConfigurationInfo s3storageConfig) {

LOGGER.debug("S3Compatible - createStsClient()");
StsClientBuilder stsBuilder = software.amazon.awssdk.services.sts.StsClient.builder();
Expand All @@ -68,7 +68,7 @@ public void createStsClient(S3StorageConfigurationInfo s3storageConfig) {
@Override
public EnumMap<PolarisCredentialProperty, String> getSubscopedCreds(
@NotNull PolarisDiagnostics diagnostics,
@NotNull S3StorageConfigurationInfo storageConfig,
@NotNull S3CompatibleStorageConfigurationInfo storageConfig,
boolean allowListOperation,
@NotNull Set<String> allowedReadLocations,
@NotNull Set<String> allowedWriteLocations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.core.storage.s3;
package org.apache.polaris.core.storage.s3compatible;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand All @@ -28,7 +28,7 @@
import org.jetbrains.annotations.Nullable;

/** Polaris Storage Configuration information for an S3 Compatible solution, MinIO, Dell ECS... */
public class S3StorageConfigurationInfo extends PolarisStorageConfigurationInfo {
public class S3CompatibleStorageConfigurationInfo extends PolarisStorageConfigurationInfo {

// 5 is the approximate max allowed locations for the size of AccessPolicy when LIST is required
// for allowed read and write locations for subscoping creds.
Expand Down Expand Up @@ -59,7 +59,7 @@ public static enum CredsCatalogAndClientStrategyEnum {

// Constructor
@JsonCreator
public S3StorageConfigurationInfo(
public S3CompatibleStorageConfigurationInfo(
@JsonProperty(value = "storageType", required = true) @NotNull StorageType storageType,
@JsonProperty(value = "credsVendingStrategy", required = true) @NotNull
CredsVendingStrategyEnum credsVendingStrategy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.apache.polaris.core.storage.aws.AwsCredentialsStorageIntegration;
import org.apache.polaris.core.storage.azure.AzureCredentialsStorageIntegration;
import org.apache.polaris.core.storage.gcp.GcpCredentialsStorageIntegration;
import org.apache.polaris.core.storage.s3.S3CredentialsStorageIntegration;
import org.apache.polaris.core.storage.s3compatible.S3CompatibleCredentialsStorageIntegration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import software.amazon.awssdk.services.sts.StsClient;
Expand Down Expand Up @@ -67,7 +67,7 @@ PolarisStorageIntegration<T> getStorageIntegrationForConfig(
new AwsCredentialsStorageIntegration(stsClientSupplier.get());
break;
case S3_COMPATIBLE:
storageIntegration = (PolarisStorageIntegration<T>) new S3CredentialsStorageIntegration();
storageIntegration = (PolarisStorageIntegration<T>) new S3CompatibleCredentialsStorageIntegration();
break;
case GCS:
storageIntegration =
Expand Down
4 changes: 2 additions & 2 deletions spec/polaris-management-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ components:
propertyName: storageType
mapping:
S3: "#/components/schemas/AwsStorageConfigInfo"
S3_COMPATIBLE: "#/components/schemas/S3StorageConfigInfo"
S3_COMPATIBLE: "#/components/schemas/S3CompatibleStorageConfigInfo"
AZURE: "#/components/schemas/AzureStorageConfigInfo"
GCS: "#/components/schemas/GcpStorageConfigInfo"
FILE: "#/components/schemas/FileStorageConfigInfo"
Expand All @@ -903,7 +903,7 @@ components:
required:
- roleArn

S3StorageConfigInfo:
S3CompatibleStorageConfigInfo:
type: object
description: S3 compatible storage configuration info (MinIO, Dell ECS, Netapp StorageGRID, ...)
allOf:
Expand Down

0 comments on commit dd8d860

Please sign in to comment.