-
Couldn't load subscription status.
- Fork 114
Add new KeySpacePath.exportAllData #3566
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
Merged
alecgrieser
merged 33 commits into
FoundationDB:main
from
ScottDugas:keyspacepath-export
Oct 29, 2025
+1,781
−157
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
8f4922e
Add tests for a KeySpacePath export method to export all the data wit…
ScottDugas f79e912
Add continuation tests
ScottDugas 80cbad2
Fix checkstyle
ScottDugas 1959c73
Reduce duplication in KeySpacePathDataExportTest and remove exportAll…
ScottDugas 9f7c8f2
Implement KeySpacePath.exportAllData, and update the tests to make it…
ScottDugas 5cadd88
Remove usage of asyncToSync in exportAllData
ScottDugas 6b975d7
Add initial implementation of a class for resolved path & value
ScottDugas ed9702b
Validate remainder in more places
ScottDugas 0820b97
Cleanup some of the assertions
ScottDugas 0750e00
Change exportAllData to return DataInKeySpacePath instead of raw data
ScottDugas a6572f1
Move EnvironmentKeySpace out into its own file, move wrappers into it
ScottDugas 439ea52
Add tests of KeySPacePathWrapper.exportAllData
ScottDugas d9b92ab
Cleanup style of test
ScottDugas cc2420e
Fix bug when exporting at the leaf node
ScottDugas e2da4ea
Reduce repetitive tests, and repetitive code for assertions
ScottDugas 5a24630
Dleete some more redundant tests
ScottDugas f1e436a
Some minor test cleanup
ScottDugas 039f53d
Merge branch 'main' into keyspacepath-export
ScottDugas 5e310ea
Fix test that doesn't account for remainder
ScottDugas 2a5da68
Add unit tests of withRemainder
ScottDugas 9207a3e
Test reverse continuations
ScottDugas c43d878
Remove DataInKeySpacePath.getRawKeyValue
ScottDugas 56c3f0e
Test continuation behavior while exporting a single key
ScottDugas 60ad1d1
Move code for resolving a key to KeySpacePath and add tests
ScottDugas fc517e9
Add path checks & negative tests
ScottDugas 4f5737d
Use TupleHelpers.isPrefix
ScottDugas 714a42a
Default implementations for backwards compatibility
ScottDugas 118cad7
Resolve from different depths
ScottDugas a36a55e
Use assertArrayEquals for byte[]
ScottDugas 1ac438c
Test new default methods
ScottDugas 5595a93
Some cleanup
ScottDugas 1a58550
Respond to PR #3566 comments from @ohadzeliger
ScottDugas f7f2da2
Mark DataInKeySpacePath as EXPERIMENTAL
ScottDugas 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 hidden or 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
60 changes: 60 additions & 0 deletions
60
...java/com/apple/foundationdb/record/provider/foundationdb/keyspace/DataInKeySpacePath.java
This file contains hidden or 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,60 @@ | ||
| /* | ||
| * DataInKeySpacePath.java | ||
| * | ||
| * This source file is part of the FoundationDB open source project | ||
| * | ||
| * Copyright 2015-2025 Apple Inc. and the FoundationDB project authors | ||
| * | ||
| * 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.apple.foundationdb.record.provider.foundationdb.keyspace; | ||
|
|
||
| import com.apple.foundationdb.KeyValue; | ||
| import com.apple.foundationdb.annotation.API; | ||
| import com.apple.foundationdb.record.RecordCoreArgumentException; | ||
| import com.apple.foundationdb.record.logging.LogMessageKeys; | ||
| import com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext; | ||
| import com.apple.foundationdb.tuple.ByteArrayUtil2; | ||
|
|
||
| import javax.annotation.Nonnull; | ||
| import java.util.concurrent.CompletableFuture; | ||
|
|
||
| /** | ||
| * Class representing a {@link KeyValue} pair within in {@link KeySpacePath}. | ||
| */ | ||
| @API(API.Status.EXPERIMENTAL) | ||
| public class DataInKeySpacePath { | ||
alecgrieser marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @Nonnull | ||
| private final CompletableFuture<ResolvedKeySpacePath> resolvedPath; | ||
| @Nonnull | ||
| private final byte[] value; | ||
|
|
||
| public DataInKeySpacePath(KeySpacePath path, KeyValue rawKeyValue, FDBRecordContext context) { | ||
| this.resolvedPath = path.toResolvedPathAsync(context, rawKeyValue.getKey()); | ||
| this.value = rawKeyValue.getValue(); | ||
| if (this.value == null) { | ||
| throw new RecordCoreArgumentException("Value cannot be null") | ||
| .addLogInfo(LogMessageKeys.KEY, ByteArrayUtil2.loggable(rawKeyValue.getKey())); | ||
| } | ||
| } | ||
|
|
||
| public CompletableFuture<ResolvedKeySpacePath> getResolvedPath() { | ||
| return resolvedPath; | ||
| } | ||
|
|
||
| public byte[] getValue() { | ||
| return this.value; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.