forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move rocksdb native library resource registration to a feature
Always registers the correct native library as the logic runs on the same architecture we are targeting (even when using containers). Closes quarkusio#43319
- Loading branch information
Showing
2 changed files
with
24 additions
and
20 deletions.
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
16 changes: 16 additions & 0 deletions
16
...ams/runtime/src/main/java/io/quarkus/kafka/streams/runtime/graal/KafkaStreamsFeature.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,16 @@ | ||
package io.quarkus.kafka.streams.runtime.graal; | ||
|
||
import org.graalvm.nativeimage.hosted.Feature; | ||
import org.graalvm.nativeimage.hosted.RuntimeResourceAccess; | ||
import org.rocksdb.util.Environment; | ||
|
||
public class KafkaStreamsFeature implements Feature { | ||
|
||
@Override | ||
public void afterRegistration(AfterRegistrationAccess access) { | ||
String libraryFileName = Environment.getJniLibraryFileName("rocksdb"); | ||
RuntimeResourceAccess.addResource(Environment.class.getModule(), libraryFileName); | ||
System.out.println("Added " + libraryFileName + " to the resources"); | ||
} | ||
|
||
} |