-
Notifications
You must be signed in to change notification settings - Fork 466
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 config to enable PITR #1365
Conversation
private static final boolean PITR_ENABLED = true; | ||
private static final Collection<Tag> EMPTY_TAGS = DefaultSdkAutoConstructList.getInstance(); | ||
private static final Collection<Tag> TAGS = | ||
Collections.singletonList(Tag.builder().key("foo").value("bar").build()); |
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.
Thank you for making this more consistent.
@@ -159,7 +162,7 @@ public DynamoDBLeaseRefresher( | |||
tableCreatorCallback, | |||
dynamoDbRequestTimeout, | |||
BillingMode.PAY_PER_REQUEST, | |||
false); | |||
LeaseManagementConfig.DEFAULT_LEASE_TABLE_DELETION_PROTECTION_ENABLED); |
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.
Thank you for this.
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.
We check that leaseTableDeletionProtectionEnabled() and leaseTablePitrEnabled() equal true, but this will give a false positive if the default changes to true and setLeaseTable...Enabled() methods break.
This is a bit of a nit since it appears this methodology was repeated with other tests. Just including it for consideration.
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.
Good point, I've added two more tests to set the false value as well
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.
This looks okay. I particularly appreciate the inclusion of some new constants, and I included a note about potential false positives in the tests, but I don't think it should prevent merging.
MultiLangDaemonConfiguration.ResolvedConfiguration resolvedConfiguration = | ||
configuration.resolvedConfiguration(shardRecordProcessorFactory); | ||
|
||
assertThat(resolvedConfiguration.leaseManagementConfig.leaseTableDeletionProtectionEnabled(), equalTo(true)); |
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 nit, but this could just be assertTrue(...)
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.
Fixed
.pointInTimeRecoverySpecification(PointInTimeRecoverySpecification.builder() | ||
.pointInTimeRecoveryEnabled(true) | ||
.build()) |
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.
Instead of passing in a PointInTimeRecoverySpecification, you can pass in a Consumer<PointInTimeRecoverySpecification.Builder> like so:
.pointInTimeRecoverySpecification(PointInTimeRecoverySpecification.builder() | |
.pointInTimeRecoveryEnabled(true) | |
.build()) | |
.pointInTimeRecoverySpecification(builder->builder.pointInTimeRecoveryEnabled(true)) |
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.
Thank you for this shorthand, did not know about it. Updated
Issue #, if available:
Description of changes:
leaseTablePitrEnabled
leaseTableDeletionProtectionEnabled
andleaseTablePitrEnabled
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.