This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
ABR 18: More ETEs #5911
Merged
Merged
ABR 18: More ETEs #5911
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
164d860
completeBackup ete
gsheasby a673645
Add restore methods to BackupAndRestoreResource
gsheasby d9cc93f
basic restore tests
gsheasby d1ba2e6
wiring
gsheasby 0493647
addTodo patiently
gsheasby 1ba7fa7
only register backup and restore resource if runtime config exists
gsheasby 0da4925
ignorance is bliss
gsheasby e4b85cf
check timelock is disabled/reenabled
gsheasby 6a1f76b
try commenting addTodo
gsheasby 462eb4a
fix token
gsheasby 0177cdb
[temp] alert when shutting down pooling
gsheasby b2a26aa
refactors
gsheasby 0e1c6c1
fix exception assert
gsheasby 3875630
fine, be that way
gsheasby 63cc107
fix test setup
gsheasby 4b17080
fix test interdependence
gsheasby 1d813ee
fix assert
gsheasby 72bc02b
optimism
gsheasby 98239d9
close kvs for prod only
gsheasby 2b2da18
internal
gsheasby 84febf6
Make TimestampManagementService work for disabled namespaces
gsheasby 72231c2
fix ete setup
gsheasby 62a0bf2
CassRepairHelper: use KvsRunner
gsheasby 9f2a68b
consistency
gsheasby 726c960
remove debug code
gsheasby ecfa876
check
gsheasby 7dbd4e6
Add generated changelog entries
svc-changelog c26ac47
Autorelease 0.546.0-rc1
gsheasby 61edb8b
getIgnoringDisabled should not add to cache
gsheasby 0aca074
more fixes
gsheasby 3167013
Add generated changelog entries
svc-changelog 98f11df
avoid race condition
gsheasby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
atlasdb-cassandra/src/main/java/com/palantir/atlasdb/backup/ClosingKvsRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.palantir.atlasdb.backup; | ||
|
||
import com.palantir.atlasdb.keyvalue.api.KeyValueService; | ||
import com.palantir.atlasdb.timelock.api.Namespace; | ||
import java.util.function.Function; | ||
|
||
final class ClosingKvsRunner implements KvsRunner { | ||
private final Function<Namespace, KeyValueService> keyValueServiceFactory; | ||
|
||
ClosingKvsRunner(Function<Namespace, KeyValueService> keyValueServiceFactory) { | ||
this.keyValueServiceFactory = keyValueServiceFactory; | ||
} | ||
|
||
@Override | ||
public <T> T run(Namespace namespace, Function<KeyValueService, T> function) { | ||
try (KeyValueService kvs = keyValueServiceFactory.apply(namespace)) { | ||
return function.apply(kvs); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
atlasdb-cassandra/src/main/java/com/palantir/atlasdb/backup/KvsRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.palantir.atlasdb.backup; | ||
|
||
import com.palantir.atlasdb.keyvalue.api.KeyValueService; | ||
import com.palantir.atlasdb.timelock.api.Namespace; | ||
import com.palantir.atlasdb.transaction.api.TransactionManager; | ||
import java.util.function.Function; | ||
|
||
public interface KvsRunner { | ||
<T> T run(Namespace namespace, Function<KeyValueService, T> function); | ||
|
||
static KvsRunner create(Function<Namespace, KeyValueService> kvsFactory) { | ||
return new ClosingKvsRunner(kvsFactory); | ||
} | ||
|
||
static KvsRunner create(TransactionManager txnManager) { | ||
return new TransactionManagerKvsRunner(txnManager); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
atlasdb-cassandra/src/main/java/com/palantir/atlasdb/backup/TransactionManagerKvsRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.palantir.atlasdb.backup; | ||
|
||
import com.palantir.atlasdb.keyvalue.api.KeyValueService; | ||
import com.palantir.atlasdb.timelock.api.Namespace; | ||
import com.palantir.atlasdb.transaction.api.TransactionManager; | ||
import java.util.function.Function; | ||
|
||
final class TransactionManagerKvsRunner implements KvsRunner { | ||
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. maybe rename 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.
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. I meant more agnostic and descriptive of behaviour/intent: |
||
private final TransactionManager txnManager; | ||
|
||
TransactionManagerKvsRunner(TransactionManager txnManager) { | ||
this.txnManager = txnManager; | ||
} | ||
|
||
@Override | ||
public <T> T run(Namespace _namespace, Function<KeyValueService, T> function) { | ||
return function.apply(txnManager.getKeyValueService()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Seems a bit excessive to create and close on every call -- unless we really only do it once. We should Ideally just make the service closeable and close the KVS on close if necessary
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.
For a given namespace, the KVS is indeed created and fetched exactly once per backup or restore.
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.
then gtg