-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add table metadata service #2434
base: master
Are you sure you want to change the base?
Conversation
|
||
/** The namespace of the table in ScalarDB. */ | ||
@JsonProperty("namespace") | ||
private String namespace; |
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.
[minor] This seems the name of a namespace as well as the name of a table below. So, this should be namespaceName
for consistency?
@Getter | ||
public class TableMetadataRequest { | ||
|
||
private final String namespace; |
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.
[minor] Same as above
* | ||
* @return A set of predefined metadata column names. | ||
*/ | ||
public static Set<String> getMetadataColumns() { |
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.
How about using com.scalar.db.transaction.consensuscommit.ConsensusCommitUtils#getTransactionMetaColumns
to avoid duplicated logic?
Some other methods might be replaced with ConsensusCommitUtils
methods.
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.
Left a couple comments. Please take a look when you have time!
* @param columnNames A set of all column names in the table. | ||
* @return {@code true} if the column is a metadata column; {@code false} otherwise. | ||
*/ | ||
public static boolean isMetadataColumn( |
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.
You can use ConsensusCommitUtils.isTransactionMetaColumn()
:
scalardb/core/src/main/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitUtils.java
Line 201 in 98b5e1b
public static boolean isTransactionMetaColumn(String columnName, TableMetadata tableMetadata) { |
* @param tableMetadata The metadata of the table. | ||
* @return {@code true} if the column is a metadata column; {@code false} otherwise. | ||
*/ | ||
public static boolean isMetadataColumn(String columnName, TableMetadata tableMetadata) { |
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.
Ditto.
Description
Added table metadata service and some related DTO classes
Related issues and/or PRs
NA
Changes made
Added table metadata service and some related DTO classes. The tablemetadata service is also used in data loader API.
The spotbug exlude is the same as the one added in other PR to resolve issue due lombok.
Checklist
Additional notes (optional)
Road map to merge remaining data loader core files. Current status
General
Export
Import
Release notes
NA