Uh oh!
There was an error while loading. Please reload this page.
HDDS-10149. New JNI layer for RawSSTFileReader & RawSSTFileReaderIterator - #6182
Conversation
# Conflicts: # hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
swamirishi
commented
Feb 15, 2024
The PR can be reviewed now. I have fixed all the issues with the patch. |
hemantk-12
left a comment
There was a problem hiding this comment.
Thanks @swamirishi for working on this.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| public static boolean loadLibrary() throws NativeLibraryNotLoadedException { | ||
| ManagedRocksObjectUtils.loadRocksDBLibrary(); | ||
| if (!NativeLibraryLoader.getInstance() | ||
| .loadLibrary(ROCKS_TOOLS_NATIVE_LIBRARY_NAME)) { | ||
| throw new NativeLibraryNotLoadedException( | ||
| ROCKS_TOOLS_NATIVE_LIBRARY_NAME); | ||
| } | ||
| return true; | ||
| } |
There was a problem hiding this comment.
nit:
I think, this code should be moved to
SnapshotDiffManager#initSSTDumpTool(). And in test should load lib wherever is needed in @BeforeAll.ManagedRawSSTFileReaderclass in itself doesn't care if native lib is loaded or not. And rely on the caller that they should load it before using it.May be call
loadNativeLibrather thaninitSSTDumpTool.
There was a problem hiding this comment.
loadLibrary is still in ManagedRawSstFileReader. Please move it to SnapshotDiffManager.
It is responsibility of the SnapshotDiffManager to make sure native-lib is loaded before using optimized SnapDiff.
There was a problem hiding this comment.
No I believe this particular piece should reside in this particular module since this class cannot run without the library being loaded. It has to be self contained.
There was a problem hiding this comment.
Even rocksdb does something similar
There was a problem hiding this comment.
I disagree with you because if ManagedRawSstFileReader has some dependency on NativeLibrary, it should be injected to it.
Since it is static loading, we can move this code inside the constructor of ManagedRawSstFileReader or static block (which I don't think possible because it is needed to be loaded based on the config) but loading this way doesn't feel good to me.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hemantk-12
left a comment
There was a problem hiding this comment.
Overall looks good to me.
There are few cosmetics comments which are not addressed. Please create follow up task if you don't intend to fix them as part of this PR.
swamirishi
commented
Feb 22, 2024
Thanks for the review @hemantk-12 and @smengcl |
smengcl
commented
Feb 22, 2024
Thanks @swamirishi for the fix and improvement. |
…leReaderIterator (apache#6182) (cherry picked from commit d883d7d) Change-Id: I5cade05d6be565acc3d93b6376e7ecf679dccf55
…ator (apache#6182) (cherry picked from commit d883d7d)
What changes were proposed in this pull request?
Including rocksdb in ozone_rocks_tools native library interferes with rocksdb lib loaded from rocksdbjni jar, which leads to issues like block checksum mismatch error. Bad file descriptor error. Instead of adding rocksdb static lib as static lib to ozone_rocks_tools adding rocksdb static lib as a shared lib should prevent such issues from occuring.
Changed the rocks tools build to use rocksdbjnlllib from rocksdb jar instead of building rocksdb from scratch.
Implemented RawSSTFileReader & RawSSTFileReaderIterator in rocksdb tools to implement an iterator in the native side to read tombstone entries.
https://issues.apache.org/jira/browse/HDDS-10149
How was this patch tested?
Refactored and changed existing unit testcases and integration tests.