-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code refactor for Iceberg support #792
Merged
+1,379
−511
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c6dfbf3
SNOW-1437885 Disable blob interleaving when in Iceberg mode (#763)
sfc-gh-alhuang a9aa682
SNOW-1483230 Disable blob encryption / Add class for storage metadata…
sfc-gh-alhuang eac448a
SNOW-1497358 Support multiple storage for Iceberg mode (#783)
sfc-gh-alhuang e3f9d65
merge
sfc-gh-alhuang 6eb0fff
post merge
sfc-gh-alhuang c1d7116
eliminate iceberg logic
sfc-gh-alhuang 28dea75
fix
sfc-gh-alhuang c7fbc8c
update comments style
sfc-gh-alhuang 73edfb4
merge in master
sfc-gh-alhuang 4507637
mrege in master
sfc-gh-alhuang 796a533
format
sfc-gh-alhuang ca1d767
rename interface / undo error code change
sfc-gh-alhuang 6dc4c6f
Merge branch 'master' into iceberg-support-refactor
sfc-gh-alhuang 1c70aa4
Merge branch 'master' into iceberg-support-refactor
sfc-gh-alhuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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); | ||
sfc-gh-alhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
@Override | ||
public String getStringForLogging() { | ||
return String.format("ClientConfigureRequest(role=%s, file_name=%s)", getRole(), getFileName()); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
src/main/java/net/snowflake/ingest/streaming/internal/ClientConfigureResponse.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,75 @@ | ||
/* | ||
* 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 configure endpoint */ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
class ClientConfigureResponse 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; | ||
} | ||
|
||
String getClientPrefix() { | ||
if (this.deploymentId == null) { | ||
return this.prefix; | ||
} | ||
return this.prefix + "_" + this.deploymentId; | ||
} | ||
} |
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(); | ||
} |
92 changes: 92 additions & 0 deletions
92
src/main/java/net/snowflake/ingest/streaming/internal/DropChannelRequestInternal.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,92 @@ | ||
/* | ||
* 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; | ||
import net.snowflake.ingest.streaming.DropChannelRequest; | ||
import net.snowflake.ingest.utils.Utils; | ||
|
||
/** Class used to serialize the {@link DropChannelRequest} */ | ||
class DropChannelRequestInternal implements StreamingIngestRequest { | ||
@JsonProperty("request_id") | ||
private String requestId; | ||
|
||
@JsonProperty("role") | ||
private String role; | ||
|
||
@JsonProperty("channel") | ||
private String channel; | ||
|
||
@JsonProperty("table") | ||
private String table; | ||
|
||
@JsonProperty("database") | ||
private String database; | ||
|
||
@JsonProperty("schema") | ||
private String schema; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
sfc-gh-alhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@JsonProperty("client_sequencer") | ||
Long clientSequencer; | ||
|
||
DropChannelRequestInternal( | ||
String requestId, | ||
String role, | ||
String database, | ||
String schema, | ||
String table, | ||
String channel, | ||
Long clientSequencer) { | ||
this.requestId = requestId; | ||
this.role = role; | ||
this.database = database; | ||
this.schema = schema; | ||
this.table = table; | ||
this.channel = channel; | ||
this.clientSequencer = clientSequencer; | ||
} | ||
|
||
String getRequestId() { | ||
return requestId; | ||
} | ||
|
||
String getRole() { | ||
return role; | ||
} | ||
|
||
String getChannel() { | ||
return channel; | ||
} | ||
|
||
String getTable() { | ||
return table; | ||
} | ||
|
||
String getDatabase() { | ||
return database; | ||
} | ||
|
||
String getSchema() { | ||
return schema; | ||
} | ||
|
||
Long getClientSequencer() { | ||
return clientSequencer; | ||
} | ||
|
||
String getFullyQualifiedTableName() { | ||
return Utils.getFullyQualifiedTableName(database, schema, table); | ||
} | ||
|
||
@Override | ||
public String getStringForLogging() { | ||
return String.format( | ||
"DropChannelRequest(requestId=%s, role=%s, db=%s, schema=%s, table=%s, channel=%s," | ||
+ " clientSequencer=%s)", | ||
requestId, role, database, schema, table, channel, clientSequencer); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please undo these changes. you're changing public API surface of a released SDK.
@sfc-gh-tzhang do we have CI tools to catch changes to public API surface? If not lets add a backlog item to catch accidental API surface area changes before a release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo changes.