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

Remove prefix from indexes of DynamoDB #161

Merged
merged 4 commits into from
Feb 25, 2021
Merged

Conversation

yito88
Copy link
Member

@yito88 yito88 commented Feb 22, 2021

https://scalar-labs.atlassian.net/browse/DLT-8207

For DyanmoDB recovery, the prefix for index tables is removed.

Scalar DB requires the same name about index tables after restoring the table. However, the name of the restored tables should be different from that of the source table to restore data. This requirement can be satisfied by adding the prefix. Also, the name of an index table couldn't be modified after restoring the table on DyanmoDB.
That's why I don't want to add a prefix to the index.

@yito88 yito88 added the bugfix label Feb 22, 2021
@yito88 yito88 self-assigned this Feb 22, 2021
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thank you!
Left minor naming suggestion.

* @return an {@code Optional} with the returned the full table name
*/
@Nonnull
public Optional<String> forFullTableNameWithoutPrefix() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public Optional<String> forFullTableNameWithoutPrefix() {
public Optional<String> forUnprefixedFullTableName() {

This sounds a bit better to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed.

}

/**
* Returns the full table name without the prefix with the namespace for this operation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Returns the full table name without the prefix with the namespace for this operation
* Returns the full table name without the unprefixed namespace for this operation

@brfrn169
Copy link
Collaborator

@yito88 So an index name is a table-local name? I mean, there is no conflict with the same index names between the original table and the restored table?

@yito88
Copy link
Member Author

yito88 commented Feb 25, 2021

@brfrn169 Good question! An index table is bound to the table. There is no conflict with that of the source table.

@yito88 yito88 requested a review from feeblefakie February 25, 2021 01:30
Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yito88 Thank you! LGTM!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 159622c into master Feb 25, 2021
@feeblefakie feeblefakie deleted the no_prefix_dynamo_index branch February 25, 2021 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants