HDDS-14166. Completely get rid of byte array operations from RDBBatchOperation #9552
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.
What changes were proposed in this pull request?
Completely get rid of byte array operations for PUT and DELETE from RDBBatchOperation. A direct byte buffer copy can be still performed even if a byte array is sent from the table interface. Since the underlying rocksdb interface is going to perform the same buffer copy on the JNI side i.e. copying heap to off heap memory. Thus it would be more optimal to just copy it to direct byte buffer and get rid of the byte array for gc. This directByteBuffer can be now used for ByteWise comparisons which would be much faster on the native side done in HDDS-14238
P.S. this cannot be done for delete range yet as there is no direct byte buffer api in rocksdb yet. This tries to address the issue
facebook/rocksdb#14197
Once this patch gets merged we can do the same for delete range as well and get rid of the byte array usage from all rocksdb write operations.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14166
How was this patch tested?
Updated existing unit tests