File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
test/unit/org/apache/cassandra/io/compress Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,10 @@ public void testDictionaryRefCountingDuringSchemaChange()
101101 byte [] dictBytes = "sample dictionary data for compression" .getBytes ();
102102 ZstdCompressionDictionary dictionary = new ZstdCompressionDictionary (dictId , dictBytes );
103103
104- assertThat (dictionary .selfRef (). globalCount ()). isOne ();
104+ assertThat (dictionary .selfRef ()). isNull ();
105105 CompressionDictionaryCache cache = new CompressionDictionaryCache ();
106106 cache .add (dictionary );
107+ assertThat (dictionary .selfRef ().globalCount ()).isOne ();
107108
108109 // Verify dictionary is in cache
109110 CompressionDictionary cachedDict = cache .get (dictId );
@@ -187,10 +188,12 @@ public void testMultipleMetadataInstancesSharingDictionary()
187188 byte [] dictBytes = "shared dictionary data" .getBytes ();
188189 ZstdCompressionDictionary dictionary = new ZstdCompressionDictionary (dictId , dictBytes );
189190
190- assertThat (dictionary .selfRef (). globalCount ()). isOne ();
191+ assertThat (dictionary .selfRef ()). isNull ();
191192 CompressionDictionaryCache cache = new CompressionDictionaryCache ();
192193 cache .add (dictionary );
193194
195+ assertThat (dictionary .selfRef ().globalCount ()).isOne ();
196+
194197 // Create multiple CompressionMetadata instances (simulating multiple SSTables)
195198 Memory memory1 = Memory .allocate (100 );
196199 CompressionMetadata metadata1 = new CompressionMetadata (
Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ public void testClosedDictionaryHandling()
281281 {
282282 ZstdDictionaryCompressor .invalidateCache ();
283283 ZstdCompressionDictionary closedDict = createTestDictionary ();
284+ closedDict .initRefLazily ();
284285 closedDict .close ();
285286
286287 // This should throw IllegalStateException
You can’t perform that action at this time.
0 commit comments