use of com.palantir.atlasdb.keyvalue.impl.TableSplittingKeyValueService in project atlasdb by palantir.
the class CassandraKeyValueServiceIntegrationTest method testCfEqualityChecker.
@Test
public void testCfEqualityChecker() throws TException {
CassandraKeyValueServiceImpl kvs;
if (keyValueService instanceof CassandraKeyValueService) {
kvs = (CassandraKeyValueServiceImpl) keyValueService;
} else if (keyValueService instanceof TableSplittingKeyValueService) {
// scylla tests
KeyValueService delegate = ((TableSplittingKeyValueService) keyValueService).getDelegate(testTable);
assertTrue("The nesting of Key Value Services has apparently changed", delegate instanceof CassandraKeyValueService);
kvs = (CassandraKeyValueServiceImpl) delegate;
} else {
throw new IllegalArgumentException("Can't run this cassandra-specific test against a non-cassandra KVS");
}
kvs.createTable(testTable, tableMetadata);
List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace("atlasdb").getCf_defs());
CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream().filter(cf -> cf.getName().equals(getInternalTestTableName())).collect(Collectors.toList()));
assertTrue("After serialization and deserialization to database, Cf metadata did not match.", ColumnFamilyDefinitions.isMatchingCf(kvs.getCfForTable(testTable, tableMetadata, FOUR_DAYS_IN_SECONDS), clusterSideCf));
}
Aggregations