@@ -194,8 +194,8 @@ private void invalidationResultSetTest(
194
194
Consumer <CqlSession > setupTestSchema , Set <String > expectedChangedTypes ) {
195
195
invalidationTestInner (
196
196
setupTestSchema ,
197
- "select f from test_table_1 where e = ?" ,
198
- "select h from test_table_2 where g = ?" ,
197
+ "select f from test_table_caching_1 where e = ?" ,
198
+ "select h from test_table_caching_2 where g = ?" ,
199
199
expectedChangedTypes );
200
200
}
201
201
@@ -206,8 +206,8 @@ private void invalidationVariableDefsTest(
206
206
String condition = isCollection ? "contains ?" : "= ?" ;
207
207
invalidationTestInner (
208
208
setupTestSchema ,
209
- String .format ("select e from test_table_1 where f %s allow filtering" , condition ),
210
- String .format ("select g from test_table_2 where h %s allow filtering" , condition ),
209
+ String .format ("select e from test_table_caching_1 where f %s allow filtering" , condition ),
210
+ String .format ("select g from test_table_caching_2 where h %s allow filtering" , condition ),
211
211
expectedChangedTypes );
212
212
}
213
213
@@ -263,8 +263,8 @@ private void invalidationTestInner(
263
263
preparedStmtCacheRemoveLatch .countDown ();
264
264
});
265
265
266
- // alter test_type_2 to trigger cache invalidation and above events
267
- session .execute ("ALTER TYPE test_type_2 add i blob" );
266
+ // alter test_type_caching_2 to trigger cache invalidation and above events
267
+ session .execute ("ALTER TYPE test_type_caching_2 add i blob" );
268
268
269
269
session .checkSchemaAgreement ();
270
270
@@ -297,17 +297,20 @@ private void invalidationTestInner(
297
297
298
298
Consumer <CqlSession > setupCacheEntryTestBasic =
299
299
(session ) -> {
300
- session .execute ("CREATE TYPE test_type_1 (a text, b int)" );
301
- session .execute ("CREATE TYPE test_type_2 (c int, d text)" );
302
- session .execute ("CREATE TABLE test_table_1 (e int primary key, f frozen<test_type_1>)" );
303
- session .execute ("CREATE TABLE test_table_2 (g int primary key, h frozen<test_type_2>)" );
300
+ session .execute ("CREATE TYPE test_type_caching_1 (a text, b int)" );
301
+ session .execute ("CREATE TYPE test_type_caching_2 (c int, d text)" );
302
+ session .execute (
303
+ "CREATE TABLE test_table_caching_1 (e int primary key, f frozen<test_type_caching_1>)" );
304
+ session .execute (
305
+ "CREATE TABLE test_table_caching_2 (g int primary key, h frozen<test_type_caching_2>)" );
304
306
};
305
307
306
308
@ Test
307
309
public void should_invalidate_cache_entry_on_basic_udt_change_result_set () {
308
310
SchemaChangeSynchronizer .withLock (
309
311
() -> {
310
- invalidationResultSetTest (setupCacheEntryTestBasic , ImmutableSet .of ("test_type_2" ));
312
+ invalidationResultSetTest (
313
+ setupCacheEntryTestBasic , ImmutableSet .of ("test_type_caching_2" ));
311
314
});
312
315
}
313
316
@@ -316,25 +319,26 @@ public void should_invalidate_cache_entry_on_basic_udt_change_variable_defs() {
316
319
SchemaChangeSynchronizer .withLock (
317
320
() -> {
318
321
invalidationVariableDefsTest (
319
- setupCacheEntryTestBasic , false , ImmutableSet .of ("test_type_2 " ));
322
+ setupCacheEntryTestBasic , false , ImmutableSet .of ("test_type_caching_2 " ));
320
323
});
321
324
}
322
325
323
326
Consumer <CqlSession > setupCacheEntryTestCollection =
324
327
(session ) -> {
325
- session .execute ("CREATE TYPE test_type_1 (a text, b int)" );
326
- session .execute ("CREATE TYPE test_type_2 (c int, d text)" );
328
+ session .execute ("CREATE TYPE test_type_caching_1 (a text, b int)" );
329
+ session .execute ("CREATE TYPE test_type_caching_2 (c int, d text)" );
327
330
session .execute (
328
- "CREATE TABLE test_table_1 (e int primary key, f list<frozen<test_type_1 >>)" );
331
+ "CREATE TABLE test_table_caching_1 (e int primary key, f list<frozen<test_type_caching_1 >>)" );
329
332
session .execute (
330
- "CREATE TABLE test_table_2 (g int primary key, h list<frozen<test_type_2 >>)" );
333
+ "CREATE TABLE test_table_caching_2 (g int primary key, h list<frozen<test_type_caching_2 >>)" );
331
334
};
332
335
333
336
@ Test
334
337
public void should_invalidate_cache_entry_on_collection_udt_change_result_set () {
335
338
SchemaChangeSynchronizer .withLock (
336
339
() -> {
337
- invalidationResultSetTest (setupCacheEntryTestCollection , ImmutableSet .of ("test_type_2" ));
340
+ invalidationResultSetTest (
341
+ setupCacheEntryTestCollection , ImmutableSet .of ("test_type_caching_2" ));
338
342
});
339
343
}
340
344
@@ -343,25 +347,26 @@ public void should_invalidate_cache_entry_on_collection_udt_change_variable_defs
343
347
SchemaChangeSynchronizer .withLock (
344
348
() -> {
345
349
invalidationVariableDefsTest (
346
- setupCacheEntryTestCollection , true , ImmutableSet .of ("test_type_2 " ));
350
+ setupCacheEntryTestCollection , true , ImmutableSet .of ("test_type_caching_2 " ));
347
351
});
348
352
}
349
353
350
354
Consumer <CqlSession > setupCacheEntryTestTuple =
351
355
(session ) -> {
352
- session .execute ("CREATE TYPE test_type_1 (a text, b int)" );
353
- session .execute ("CREATE TYPE test_type_2 (c int, d text)" );
356
+ session .execute ("CREATE TYPE test_type_caching_1 (a text, b int)" );
357
+ session .execute ("CREATE TYPE test_type_caching_2 (c int, d text)" );
354
358
session .execute (
355
- "CREATE TABLE test_table_1 (e int primary key, f tuple<int, test_type_1 , text>)" );
359
+ "CREATE TABLE test_table_caching_1 (e int primary key, f tuple<int, test_type_caching_1 , text>)" );
356
360
session .execute (
357
- "CREATE TABLE test_table_2 (g int primary key, h tuple<text, test_type_2 , int>)" );
361
+ "CREATE TABLE test_table_caching_2 (g int primary key, h tuple<text, test_type_caching_2 , int>)" );
358
362
};
359
363
360
364
@ Test
361
365
public void should_invalidate_cache_entry_on_tuple_udt_change_result_set () {
362
366
SchemaChangeSynchronizer .withLock (
363
367
() -> {
364
- invalidationResultSetTest (setupCacheEntryTestTuple , ImmutableSet .of ("test_type_2" ));
368
+ invalidationResultSetTest (
369
+ setupCacheEntryTestTuple , ImmutableSet .of ("test_type_caching_2" ));
365
370
});
366
371
}
367
372
@@ -370,26 +375,29 @@ public void should_invalidate_cache_entry_on_tuple_udt_change_variable_defs() {
370
375
SchemaChangeSynchronizer .withLock (
371
376
() -> {
372
377
invalidationVariableDefsTest (
373
- setupCacheEntryTestTuple , false , ImmutableSet .of ("test_type_2 " ));
378
+ setupCacheEntryTestTuple , false , ImmutableSet .of ("test_type_caching_2 " ));
374
379
});
375
380
}
376
381
377
382
Consumer <CqlSession > setupCacheEntryTestNested =
378
383
(session ) -> {
379
- session .execute ("CREATE TYPE test_type_1 (a text, b int)" );
380
- session .execute ("CREATE TYPE test_type_2 (c int, d text)" );
381
- session .execute ("CREATE TYPE test_type_3 (e frozen<test_type_1>, f int)" );
382
- session .execute ("CREATE TYPE test_type_4 (g int, h frozen<test_type_2>)" );
383
- session .execute ("CREATE TABLE test_table_1 (e int primary key, f frozen<test_type_3>)" );
384
- session .execute ("CREATE TABLE test_table_2 (g int primary key, h frozen<test_type_4>)" );
384
+ session .execute ("CREATE TYPE test_type_caching_1 (a text, b int)" );
385
+ session .execute ("CREATE TYPE test_type_caching_2 (c int, d text)" );
386
+ session .execute ("CREATE TYPE test_type_caching_3 (e frozen<test_type_caching_1>, f int)" );
387
+ session .execute ("CREATE TYPE test_type_caching_4 (g int, h frozen<test_type_caching_2>)" );
388
+ session .execute (
389
+ "CREATE TABLE test_table_caching_1 (e int primary key, f frozen<test_type_caching_3>)" );
390
+ session .execute (
391
+ "CREATE TABLE test_table_caching_2 (g int primary key, h frozen<test_type_caching_4>)" );
385
392
};
386
393
387
394
@ Test
388
395
public void should_invalidate_cache_entry_on_nested_udt_change_result_set () {
389
396
SchemaChangeSynchronizer .withLock (
390
397
() -> {
391
398
invalidationResultSetTest (
392
- setupCacheEntryTestNested , ImmutableSet .of ("test_type_2" , "test_type_4" ));
399
+ setupCacheEntryTestNested ,
400
+ ImmutableSet .of ("test_type_caching_2" , "test_type_caching_4" ));
393
401
});
394
402
}
395
403
@@ -398,7 +406,9 @@ public void should_invalidate_cache_entry_on_nested_udt_change_variable_defs() {
398
406
SchemaChangeSynchronizer .withLock (
399
407
() -> {
400
408
invalidationVariableDefsTest (
401
- setupCacheEntryTestNested , false , ImmutableSet .of ("test_type_2" , "test_type_4" ));
409
+ setupCacheEntryTestNested ,
410
+ false ,
411
+ ImmutableSet .of ("test_type_caching_2" , "test_type_caching_4" ));
402
412
});
403
413
}
404
414
0 commit comments