mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-28 23:10:32 +00:00
Lazy semantic region summaries
- claims cache the next region shard without rebuilding its key summary - summaries are computed when a query or compaction reads them
This commit is contained in:
1 parent
08353e3bdd
commit
20e10999dd
2 files changed
+26
-1
No files matched your search
@@ -206,6 +206,27 @@ public final class GenerationSemanticIndexTest {
|
||||
new ChunkGenerationSemantics.BlockPosition(-520, 80, -8), 4)).isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void claimsDeferRegionSummariesUntilAQueryReadsThem() throws Exception {
|
||||
Path root = temporaryFolder.newFolder("lazy-summaries").toPath();
|
||||
GenerationSemanticIndex index = GenerationSemanticIndex.initialize(root);
|
||||
|
||||
index.claimAndPersist(ChunkGenerationSemantics.builder(-33, -1, 1L).addObject("iris:first").seal().build());
|
||||
assertEquals(0, index.cachedSummaryCount());
|
||||
assertEquals("iris:first", requiredMatch(index, GenerationSemanticIndex.SemanticKind.OBJECT, "iris:first").key());
|
||||
assertEquals(1, index.cachedSummaryCount());
|
||||
|
||||
index.claimAndPersist(ChunkGenerationSemantics.builder(-34, -1, 1L).addObject("iris:second").seal().build());
|
||||
assertEquals(0, index.cachedSummaryCount());
|
||||
assertEquals("iris:second", requiredMatch(index, GenerationSemanticIndex.SemanticKind.OBJECT, "iris:second").key());
|
||||
assertEquals("iris:first", requiredMatch(index, GenerationSemanticIndex.SemanticKind.OBJECT, "iris:first").key());
|
||||
assertEquals(2, sealedClaims(index, 1L).size());
|
||||
|
||||
GenerationSemanticIndex reopened = GenerationSemanticIndex.load(root);
|
||||
assertEquals("iris:second", requiredMatch(reopened, GenerationSemanticIndex.SemanticKind.OBJECT, "iris:second").key());
|
||||
assertEquals(index.recordsSnapshot(), reopened.recordsSnapshot());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void conflictingActivationsAndFactsAfterSealAreRejectedWithoutDiskChanges() throws Exception {
|
||||
Path dimensionRoot = temporaryFolder.newFolder("sealed").toPath();
|
||||
|
||||
Reference in new issue
Block a user