Skip to content
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

SNOW-1848242 + Send clientname and clientkey with every registerblobs request for metering views #922

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ private Optional<String> putRemote(String fullFilePath, byte[] data, int retryCo
fileTransferMetadataCopy,
inStream,
proxyProperties,
clientPrefix,
clientName,
clientPrefix,
sfc-gh-xhuang marked this conversation as resolved.
Show resolved Hide resolved
fullFilePath));
} else {
SnowflakeFileTransferAgent.uploadWithoutConnection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,29 @@ class RegisterBlobRequest implements IStreamingIngestRequest {
@JsonProperty("blobs")
private List<BlobMetadata> blobs;

@JsonProperty("client_name")
private String clientName;

@JsonProperty("client_key")
private String clientKey;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("is_iceberg")
private boolean enableIcebergStreaming;

RegisterBlobRequest(
String requestId, String role, List<BlobMetadata> blobs, boolean enableIcebergStreaming) {
String requestId,
String role,
List<BlobMetadata> blobs,
boolean enableIcebergStreaming,
String clientName,
String clientKey) {
this.requestId = requestId;
this.role = role;
this.blobs = blobs;
this.enableIcebergStreaming = enableIcebergStreaming;
this.clientName = clientName;
this.clientKey = clientKey;
}

String getRequestId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,11 @@ List<List<BlobMetadata>> partitionBlobListForRegistrationRequest(List<BlobMetada
*/
void registerBlobs(List<BlobMetadata> blobs, final int executionCount) {
logger.logInfo(
"Register blob request preparing for blob={}, client={}, executionCount={}",
"Register blob request preparing for blob={}, clientName={}, clientKey={},"
+ " executionCount={}",
blobs.stream().map(BlobMetadata::getPath).collect(Collectors.toList()),
this.name,
this.storageManager.getClientPrefix(),
executionCount);

RegisterBlobResponse response = null;
Expand All @@ -597,7 +599,9 @@ void registerBlobs(List<BlobMetadata> blobs, final int executionCount) {
this.storageManager.getClientPrefix() + "_" + counter.getAndIncrement(),
this.role,
blobs,
this.parameterProvider.isEnableIcebergStreaming());
this.parameterProvider.isEnableIcebergStreaming(),
this.getName(),
this.storageManager.getClientPrefix());
response = snowflakeServiceClient.registerBlob(request, executionCount);
} catch (IOException | IngestResponseException e) {
throw new SFException(e, ErrorCode.REGISTER_BLOB_FAILURE, e.getMessage());
Expand Down