xichen01 opened a new pull request, #5416:
URL: https://github.com/apache/ozone/pull/5416

   ## What changes were proposed in this pull request?
   Fix java.lang.UnsatisfiedLinkError: 'long 
org.rocksdb.ReadOptions.newReadOptions()' 
   ```bash
   > docker exec -it ozone-om-1 bash
   bash-4.2$ ozone debug ldb --db=/data/metadata/om.db ls
   Exception in thread "main" java.lang.UnsatisfiedLinkError: 'long 
org.rocksdb.ReadOptions.newReadOptions()'
        at org.rocksdb.ReadOptions.newReadOptions(Native Method)
        at org.rocksdb.ReadOptions.<init>(ReadOptions.java:16)
        at 
org.apache.hadoop.hdds.utils.db.managed.ManagedReadOptions.<init>(ManagedReadOptions.java:28)
        at 
org.apache.hadoop.hdds.utils.db.RocksDatabase.<clinit>(RocksDatabase.java:83)
        at org.apache.hadoop.ozone.debug.ListTables.call(ListTables.java:47)
        at org.apache.hadoop.ozone.debug.ListTables.call(ListTables.java:34)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at 
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at 
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.apache.hadoop.hdds.cli.GenericCli.execute(GenericCli.java:100)
        at org.apache.hadoop.hdds.cli.GenericCli.run(GenericCli.java:91)
        at org.apache.hadoop.ozone.debug.OzoneDebug.main(OzoneDebug.java:64) 
   ```
   
   The error `java.lang.UnsatisfiedLinkError: 
org.rocksdb.ReadOptions.newReadOptions()J` was caused because 
`ManagedReadOptions()` was statically loaded before the RocksDB native methods 
were loaded, as introduced in 
[PR#5304](https://github.com/apache/ozone/pull/5304). This PR adds the logic 
for static library loading to ensure RocksDB native methods are loaded before 
`ManagedReadOptions()` is invoked.
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-9419
   
   ## How was this patch tested?
   manually Test
   


-- 
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]

Reply via email to