-
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-1497358 Support multiple storage for Iceberg mode (#783)
Co-authored-by: Hitesh Madan <[email protected]>
- Loading branch information
1 parent
a9aa682
commit eac448a
Showing
31 changed files
with
1,522 additions
and
490 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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/net/snowflake/ingest/streaming/internal/ChannelCache.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
53 changes: 53 additions & 0 deletions
53
src/main/java/net/snowflake/ingest/streaming/internal/ChannelConfigureRequest.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,53 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** Class used to serialize the channel configure request. */ | ||
class ChannelConfigureRequest extends ConfigureRequest { | ||
@JsonProperty("database") | ||
private String database; | ||
|
||
@JsonProperty("schema") | ||
private String schema; | ||
|
||
@JsonProperty("table") | ||
private String table; | ||
|
||
/** | ||
* Constructor for channel configure request | ||
* | ||
* @param role Role to be used for the request. | ||
* @param database Database name. | ||
* @param schema Schema name. | ||
* @param table Table name. | ||
*/ | ||
ChannelConfigureRequest(String role, String database, String schema, String table) { | ||
setRole(role); | ||
this.database = database; | ||
this.schema = schema; | ||
this.table = table; | ||
} | ||
|
||
String getDatabase() { | ||
return database; | ||
} | ||
|
||
String getSchema() { | ||
return schema; | ||
} | ||
|
||
String getTable() { | ||
return table; | ||
} | ||
|
||
@Override | ||
public String getStringForLogging() { | ||
return String.format( | ||
"ChannelConfigureRequest(role=%s, db=%s, schema=%s, table=%s, file_name=%s)", | ||
getRole(), database, schema, table, getFileName()); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/net/snowflake/ingest/streaming/internal/ChannelConfigureResponse.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,46 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** Class used to deserialize responses from channel configure endpoint */ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
class ChannelConfigureResponse extends StreamingIngestResponse { | ||
@JsonProperty("status_code") | ||
private Long statusCode; | ||
|
||
@JsonProperty("message") | ||
private String message; | ||
|
||
@JsonProperty("stage_location") | ||
private FileLocationInfo stageLocation; | ||
|
||
@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; | ||
} | ||
} |
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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/net/snowflake/ingest/streaming/internal/ClientConfigureRequest.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,22 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
/** Class used to serialize client configure request */ | ||
class ClientConfigureRequest extends ConfigureRequest { | ||
/** | ||
* Constructor for client configure request | ||
* | ||
* @param role Role to be used for the request. | ||
*/ | ||
ClientConfigureRequest(String role) { | ||
setRole(role); | ||
} | ||
|
||
@Override | ||
public String getStringForLogging() { | ||
return String.format("ClientConfigureRequest(role=%s, file_name=%s)", getRole(), getFileName()); | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/net/snowflake/ingest/streaming/internal/ConfigureRequest.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,38 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** Abstract class for {@link ChannelConfigureRequest} and {@link ClientConfigureRequest} */ | ||
abstract class ConfigureRequest implements StreamingIngestRequest { | ||
@JsonProperty("role") | ||
private String role; | ||
|
||
// File name for the GCS signed url request | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonProperty("file_name") | ||
private String fileName; | ||
|
||
String getRole() { | ||
return role; | ||
} | ||
|
||
void setRole(String role) { | ||
this.role = role; | ||
} | ||
|
||
String getFileName() { | ||
return fileName; | ||
} | ||
|
||
void setFileName(String fileName) { | ||
this.fileName = fileName; | ||
} | ||
|
||
@Override | ||
public abstract String getStringForLogging(); | ||
} |
Oops, something went wrong.