lhotari commented on code in PR #4909:
URL: https://github.com/apache/bookkeeper/pull/4909#discussion_r4288650441
##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDBTest.java:
##########
@@ -97,6 +99,47 @@ public void
testCompatibleSstFormatWithAndWithoutConfigurationFiles() throws Exc
}
}
+ @Test
+ public void testEntryLocationPartitionedIndexAndFilters() throws Exception
{
+ File directory = temporaryFolder.newFolder();
+ ServerConfiguration configuration = new ServerConfiguration();
+ configuration.setEntryLocationRocksdbConf(new File(directory,
"entry.conf").toString());
+ assertEntryLocationSstLayout(configuration, true);
+
+
configuration.setProperty("dbStorage_rocksDB_partitionedIndexAndFiltersEnabled",
false);
+ assertEntryLocationSstLayout(configuration, false);
+
+ configuration = new ServerConfiguration();
+ configuration.setEntryLocationRocksdbConf(
+
getClass().getClassLoader().getResource("conf/entry_location_rocksdb.conf").getPath());
+ assertEntryLocationSstLayout(configuration, true);
+ }
+
+ private void assertEntryLocationSstLayout(ServerConfiguration
configuration, boolean partitioned)
+ throws Exception {
+ File directory = temporaryFolder.newFolder();
+ try (KeyValueStorageRocksDB storage = new KeyValueStorageRocksDB(
+ directory.toString(), "db",
KeyValueStorageFactory.DbConfigType.EntryLocation, configuration)) {
+ storage.put(new byte[]{1}, new byte[]{2});
Review Comment:
**[QUALITY] layout test only exercises a single-partition SST**
Optional: with one key the SST has a single index/filter partition, so this
checks that the layout is selected but not that lookups work across several
partitions. Writing a few thousand keys (enough to span multiple 4 KiB metadata
blocks), compacting, then reading some of them back (hits and misses) would
cover the two-level search path too.
--
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]