-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1483230 Disable blob encryption / Add class for storage metadata…
… & configure response (#773)
- Loading branch information
1 parent
2b26107
commit 1678a6d
Showing
12 changed files
with
442 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/net/snowflake/ingest/streaming/internal/ConfigureResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** Class used to deserialize responses from configure endpoint */ | ||
class ConfigureResponse extends StreamingIngestResponse { | ||
@JsonProperty("prefix") | ||
private String prefix; | ||
|
||
@JsonProperty("status_code") | ||
private Long statusCode; | ||
|
||
@JsonProperty("message") | ||
private String message; | ||
|
||
@JsonProperty("stage_location") | ||
private FileLocationInfo stageLocation; | ||
|
||
@JsonProperty("deployment_id") | ||
private Long deploymentId; | ||
|
||
String getPrefix() { | ||
return prefix; | ||
} | ||
|
||
void setPrefix(String prefix) { | ||
this.prefix = prefix; | ||
} | ||
|
||
@Override | ||
Long getStatusCode() { | ||
return statusCode; | ||
} | ||
|
||
void setStatusCode(Long statusCode) { | ||
this.statusCode = statusCode; | ||
} | ||
|
||
String getMessage() { | ||
return message; | ||
} | ||
|
||
void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
FileLocationInfo getStageLocation() { | ||
return stageLocation; | ||
} | ||
|
||
void setStageLocation(FileLocationInfo stageLocation) { | ||
this.stageLocation = stageLocation; | ||
} | ||
|
||
Long getDeploymentId() { | ||
return deploymentId; | ||
} | ||
|
||
void setDeploymentId(Long deploymentId) { | ||
this.deploymentId = deploymentId; | ||
} | ||
} |
132 changes: 132 additions & 0 deletions
132
src/main/java/net/snowflake/ingest/streaming/internal/FileLocationInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.Map; | ||
|
||
/** Class used to deserialized volume information response by server */ | ||
class FileLocationInfo { | ||
@JsonProperty("locationType") | ||
private String locationType; // The stage type | ||
|
||
@JsonProperty("location") | ||
private String location; // The container or bucket | ||
|
||
@JsonProperty("path") | ||
private String path; // path of the target file | ||
|
||
@JsonProperty("creds") | ||
private Map<String, String> credentials; // the credentials required for the stage | ||
|
||
@JsonProperty("region") | ||
private String region; // AWS/S3/GCS region (S3/GCS only) | ||
|
||
@JsonProperty("endPoint") | ||
private String endPoint; // The Azure Storage endpoint (Azure only) | ||
|
||
@JsonProperty("storageAccount") | ||
private String storageAccount; // The Azure Storage account (Azure only) | ||
|
||
@JsonProperty("presignedUrl") | ||
private String presignedUrl; // GCS gives us back a presigned URL instead of a cred | ||
|
||
@JsonProperty("isClientSideEncrypted") | ||
private boolean isClientSideEncrypted; // whether to encrypt/decrypt files on the stage | ||
|
||
@JsonProperty("useS3RegionalUrl") | ||
private boolean useS3RegionalUrl; // whether to use s3 regional URL (AWS Only) | ||
|
||
@JsonProperty("volumeHash") | ||
private String volumeHash; // a unique id for volume assigned by server | ||
|
||
String getLocationType() { | ||
return locationType; | ||
} | ||
|
||
void setLocationType(String locationType) { | ||
this.locationType = locationType; | ||
} | ||
|
||
String getLocation() { | ||
return location; | ||
} | ||
|
||
void setLocation(String location) { | ||
this.location = location; | ||
} | ||
|
||
String getPath() { | ||
return path; | ||
} | ||
|
||
void setPath(String path) { | ||
this.path = path; | ||
} | ||
|
||
Map<String, String> getCredentials() { | ||
return credentials; | ||
} | ||
|
||
void setCredentials(Map<String, String> credentials) { | ||
this.credentials = credentials; | ||
} | ||
|
||
String getRegion() { | ||
return region; | ||
} | ||
|
||
void setRegion(String region) { | ||
this.region = region; | ||
} | ||
|
||
String getEndPoint() { | ||
return endPoint; | ||
} | ||
|
||
void setEndPoint(String endPoint) { | ||
this.endPoint = endPoint; | ||
} | ||
|
||
String getStorageAccount() { | ||
return storageAccount; | ||
} | ||
|
||
void setStorageAccount(String storageAccount) { | ||
this.storageAccount = storageAccount; | ||
} | ||
|
||
String getPresignedUrl() { | ||
return presignedUrl; | ||
} | ||
|
||
void setPresignedUrl(String presignedUrl) { | ||
this.presignedUrl = presignedUrl; | ||
} | ||
|
||
boolean getIsClientSideEncrypted() { | ||
return this.isClientSideEncrypted; | ||
} | ||
|
||
void setIsClientSideEncrypted(boolean isClientSideEncrypted) { | ||
this.isClientSideEncrypted = isClientSideEncrypted; | ||
} | ||
|
||
boolean getUseS3RegionalUrl() { | ||
return this.useS3RegionalUrl; | ||
} | ||
|
||
void setUseS3RegionalUrl(boolean useS3RegionalUrl) { | ||
this.useS3RegionalUrl = useS3RegionalUrl; | ||
} | ||
|
||
String getVolumeHash() { | ||
return this.volumeHash; | ||
} | ||
|
||
void setVolumeHash(String volumeHash) { | ||
this.volumeHash = volumeHash; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/net/snowflake/ingest/streaming/internal/InternalParameterProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
/** A class to provide non-configurable constants depends on Iceberg or non-Iceberg mode */ | ||
class InternalParameterProvider { | ||
private final boolean isIcebergMode; | ||
|
||
InternalParameterProvider(boolean isIcebergMode) { | ||
this.isIcebergMode = isIcebergMode; | ||
} | ||
|
||
boolean getEnableChunkEncryption() { | ||
// When in Iceberg mode, chunk encryption is disabled. Otherwise, it is enabled. Since Iceberg | ||
// mode does not need client-side encryption. | ||
return !isIcebergMode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.