diff --git a/HISTORY.md b/HISTORY.md index 78bf8c6c4..e76975a99 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,9 @@ ### Public API changes * Add `rocksdb_column_family_handle_get_id`, `rocksdb_column_family_handle_get_name` to get name, id of column family in C API +### Java API Changes +* Add CompactionPriority.RoundRobin. + ## 7.6.0 (08/19/2022) ### New Features * Added `prepopulate_blob_cache` to ColumnFamilyOptions. If enabled, prepopulate warm/hot blobs which are already in memory into blob cache at the time of flush. On a flush, the blob that is in memory (in memtables) get flushed to the device. If using Direct IO, additional IO is incurred to read this blob back into memory again, which is avoided by enabling this option. This further helps if the workload exhibits high temporal locality, where most of the reads go to recently written data. This also helps in case of the remote file system since it involves network traffic and higher latencies. diff --git a/java/rocksjni/portal.h b/java/rocksjni/portal.h index b9fde668e..40615e284 100644 --- a/java/rocksjni/portal.h +++ b/java/rocksjni/portal.h @@ -4622,6 +4622,8 @@ class CompactionPriorityJni { return 0x2; case ROCKSDB_NAMESPACE::CompactionPri::kMinOverlappingRatio: return 0x3; + case ROCKSDB_NAMESPACE::CompactionPri::kRoundRobin: + return 0x4; default: return 0x0; // undefined } @@ -4640,6 +4642,8 @@ class CompactionPriorityJni { return ROCKSDB_NAMESPACE::CompactionPri::kOldestSmallestSeqFirst; case 0x3: return ROCKSDB_NAMESPACE::CompactionPri::kMinOverlappingRatio; + case 0x4: + return ROCKSDB_NAMESPACE::CompactionPri::kRoundRobin; default: // undefined/default return ROCKSDB_NAMESPACE::CompactionPri::kByCompensatedSize; diff --git a/java/src/main/java/org/rocksdb/CompactionPriority.java b/java/src/main/java/org/rocksdb/CompactionPriority.java index a4f53cd64..eda05942e 100644 --- a/java/src/main/java/org/rocksdb/CompactionPriority.java +++ b/java/src/main/java/org/rocksdb/CompactionPriority.java @@ -33,7 +33,15 @@ public enum CompactionPriority { * and its size is the smallest. It in many cases can optimize write * amplification. */ - MinOverlappingRatio((byte)0x3); + MinOverlappingRatio((byte)0x3), + + /** + * Keeps a cursor(s) of the successor of the file (key range) was/were + * compacted before, and always picks the next files (key range) in that + * level. The file picking process will cycle through all the files in a + * round-robin manner. + */ + RoundRobin((byte)0x4); private final byte value;