swamirishi commented on code in PR #4584:
URL: https://github.com/apache/ozone/pull/4584#discussion_r1195830635
##########
hadoop-hdds/rocks-native/src/main/patches/rocks-native.patch:
##########
@@ -153,36 +144,83 @@ index eefbaaeee..503ec7aa6 100644
}
return Status::OK();
-@@ -478,21 +481,26 @@ Status SstFileDumper::ReadSequential(bool print_kv,
uint64_t read_num,
+ }
+
++void write(int value, FILE* file) {
++ char b[4];
++ b[3] = value & 0x000000ff;
++ b[2] = (value & 0x0000ff00) >> 8;
++ b[1] = (value & 0x00ff0000) >> 16;
++ b[0] = (value & 0xff000000) >> 24;
++ std::fwrite(b, 4, 1, file);
++}
++
++void write(const char* value, int length, FILE* file) {
++ write(length, file);
++ fwrite(value, length, 1, file);
++}
++
++void write(const std::string& value, FILE* file) {
++ write(value.data(), (int)value.length(), file);
++
++}
Review Comment:
done
##########
hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeLibraryLoader.java:
##########
@@ -132,15 +134,17 @@ private Optional<File> copyResourceFromJarToTemp(final
String libraryName)
}
// create a temporary file to copy the library to
- final File temp = File.createTempFile(libraryName, getLibOsSuffix());
+ final File temp = File.createTempFile(libraryName, getLibOsSuffix(),
+ new File(""));
if (!temp.exists()) {
return Optional.empty();
} else {
temp.deleteOnExit();
}
Files.copy(is, temp.toPath(), StandardCopyOption.REPLACE_EXISTING);
- return Optional.ofNullable(temp);
+ ShutdownHookManager.get().addShutdownHook(temp::delete, 1);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]