-
Notifications
You must be signed in to change notification settings - Fork 58
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-928922 send spansMixedTables flag in blob registration requests #651
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,24 +18,33 @@ class BlobMetadata { | |
private final Constants.BdecVersion bdecVersion; | ||
private final List<ChunkMetadata> chunks; | ||
private final BlobStats blobStats; | ||
private final boolean spansMixedTables; | ||
|
||
// used for testing only | ||
@VisibleForTesting | ||
BlobMetadata(String path, String md5, List<ChunkMetadata> chunks, BlobStats blobStats) { | ||
this(path, md5, ParameterProvider.BLOB_FORMAT_VERSION_DEFAULT, chunks, blobStats); | ||
this( | ||
path, | ||
md5, | ||
ParameterProvider.BLOB_FORMAT_VERSION_DEFAULT, | ||
chunks, | ||
blobStats, | ||
chunks == null ? false : chunks.size() > 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because that constructor is used in tests (only) and |
||
} | ||
|
||
BlobMetadata( | ||
String path, | ||
String md5, | ||
Constants.BdecVersion bdecVersion, | ||
List<ChunkMetadata> chunks, | ||
BlobStats blobStats) { | ||
BlobStats blobStats, | ||
boolean spansMixedTables) { | ||
this.path = path; | ||
this.md5 = md5; | ||
this.bdecVersion = bdecVersion; | ||
this.chunks = chunks; | ||
this.blobStats = blobStats; | ||
this.spansMixedTables = spansMixedTables; | ||
} | ||
|
||
@JsonIgnore | ||
|
@@ -68,13 +77,19 @@ BlobStats getBlobStats() { | |
return this.blobStats; | ||
} | ||
|
||
@JsonProperty("spans_mixed_tables") | ||
boolean getSpansMixedTables() { | ||
return this.spansMixedTables; | ||
} | ||
|
||
/** Create {@link BlobMetadata}. */ | ||
static BlobMetadata createBlobMetadata( | ||
String path, | ||
String md5, | ||
Constants.BdecVersion bdecVersion, | ||
List<ChunkMetadata> chunks, | ||
BlobStats blobStats) { | ||
return new BlobMetadata(path, md5, bdecVersion, chunks, blobStats); | ||
BlobStats blobStats, | ||
boolean spansMixedTables) { | ||
return new BlobMetadata(path, md5, bdecVersion, chunks, blobStats, spansMixedTables); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -568,8 +568,15 @@ BlobMetadata upload( | |||||
blob.length, | ||||||
System.currentTimeMillis() - startTime); | ||||||
|
||||||
// at this point we know for sure if the BDEC file has data for more than one chunk, i.e. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
|
||||||
// spans mixed tables or not | ||||||
return BlobMetadata.createBlobMetadata( | ||||||
blobPath, BlobBuilder.computeMD5(blob), bdecVersion, metadata, blobStats); | ||||||
blobPath, | ||||||
BlobBuilder.computeMD5(blob), | ||||||
bdecVersion, | ||||||
metadata, | ||||||
blobStats, | ||||||
metadata == null ? false : metadata.size() > 1); | ||||||
} | ||||||
|
||||||
/** | ||||||
|
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.
want to add a comment explain this? The name is not straight forward like other fields
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.
Or I suggest we call it something like
hasMultipleTables
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.
I added a comment.