-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-13070. OM Follower changes to create and place sst files from hardlink file. #8761
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dbba48f
HDDS-13070. OM Follower changes to create and place sst files from ha…
9f0dbf9
address comment
6559738
findbugs fix
7f2e037
fix compile
7b8cbee
address comment
4f6bb79
fix 1
16f55dc
checkstyle
60f7af5
fix 2
ea5b898
fix 3
b21cda3
address comments
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
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 |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ | |
| import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_INFO_WAIT_DURATION_DEFAULT; | ||
| import static org.apache.hadoop.hdds.server.ServerUtils.getOzoneMetaDirPath; | ||
| import static org.apache.hadoop.ozone.OzoneConsts.DB_TRANSIENT_MARKER; | ||
| import static org.apache.hadoop.ozone.OzoneConsts.ROCKSDB_SST_SUFFIX; | ||
| import static org.apache.hadoop.ozone.OzoneConsts.TRANSACTION_INFO_KEY; | ||
|
|
||
| import com.google.common.annotations.VisibleForTesting; | ||
|
|
@@ -319,28 +318,24 @@ public static File getMetaDir(DBDefinition definition, | |
| } | ||
|
|
||
| /** | ||
| * Scan the DB dir and return the existing SST files, | ||
| * including omSnapshot sst files. | ||
| * SSTs could be used for avoiding repeated download. | ||
| * Scan the DB dir and return the existing files, | ||
| * including omSnapshot files. | ||
| * | ||
| * @param db the file representing the DB to be scanned | ||
| * @return the list of SST file name. If db not exist, will return empty list | ||
| * @return the list of file names. If db not exist, will return empty list | ||
| */ | ||
| public static List<String> getExistingSstFiles(File db) throws IOException { | ||
| public static List<String> getExistingFiles(File db) throws IOException { | ||
| List<String> sstList = new ArrayList<>(); | ||
| if (!db.exists()) { | ||
| return sstList; | ||
| } | ||
|
|
||
| int truncateLength = db.toString().length() + 1; | ||
| // Walk the db dir and get all sst files including omSnapshot files. | ||
| try (Stream<Path> files = Files.walk(db.toPath())) { | ||
| sstList = | ||
| files.filter(path -> path.toString().endsWith(ROCKSDB_SST_SUFFIX)). | ||
| map(p -> p.toString().substring(truncateLength)). | ||
| sstList = files.filter(p -> p.toFile().isFile()) | ||
|
Contributor
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. A potential problem is flagged by Gemini: the files object could contain relative path rather than the file name only. It's okay though for rocksdb as the directory is flat with no subdirectories. |
||
| .map(p -> p.getFileName().toString()). | ||
| collect(Collectors.toList()); | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("Scanned SST files {} in {}.", sstList, db.getAbsolutePath()); | ||
| LOG.debug("Scanned files {} in {}.", sstList, db.getAbsolutePath()); | ||
| } | ||
| } | ||
| return sstList; | ||
|
|
||
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
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.
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.
To be honest getExistingFiles() shouldn't be in the HAUtils. Instead it belongs to RocksDBUtils.