dcapwell commented on code in PR #3416:
URL: https://github.com/apache/cassandra/pull/3416#discussion_r1674912334
##########
test/unit/org/apache/cassandra/cql3/RandomSchemaTest.java:
##########
@@ -80,38 +73,32 @@ public void test()
{
// in accord branch there is a much cleaner api for this pattern...
Gen<AbstractTypeGenerators.ValueDomain> domainGen =
SourceDSL.integers().between(1, 100).map(i -> i < 2 ?
AbstractTypeGenerators.ValueDomain.NULL : i < 4 ?
AbstractTypeGenerators.ValueDomain.EMPTY_BYTES :
AbstractTypeGenerators.ValueDomain.NORMAL);
- // make sure ordering is determanstic, else repeatability breaks
- NavigableMap<String, SSTableFormat<?, ?>> formats = new
TreeMap<>(DatabaseDescriptor.getSSTableFormats());
- Gen<SSTableFormat<?, ?>> ssTableFormatGen =
SourceDSL.arbitrary().pick(new ArrayList<>(formats.values()));
+
+ Gen<SSTableFormat<?, ?>> sstableFormatGen =
CassandraGenerators.sstableFormat();
qt().checkAssert(random -> {
resetSchema();
// TODO : when table level override of sstable format is allowed,
migrate to that
- SSTableFormat<?, ?> sstableFormat =
ssTableFormatGen.generate(random);
- DatabaseDescriptor.setSelectedSSTableFormat(sstableFormat);
+
DatabaseDescriptor.setSelectedSSTableFormat(sstableFormatGen.generate(random));
Gen<String> udtName = Generators.unique(IDENTIFIER_GEN);
TypeGenBuilder withoutUnsafeEquality =
AbstractTypeGenerators.withoutUnsafeEquality()
-
.withUserTypeKeyspace(KEYSPACE)
.withUDTNames(udtName);
TableMetadata metadata = new TableMetadataBuilder()
.withKeyspaceName(KEYSPACE)
.withTableKinds(TableMetadata.Kind.REGULAR)
.withKnownMemtables()
.withDefaultTypeGen(AbstractTypeGenerators.builder()
.withoutEmpty()
-
.withUserTypeKeyspace(KEYSPACE)
Review Comment:
when creating UDTs we respect the keyspace that is used while creating the
table... so no longer need this. This was also not that safe... recursion is
hard...
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]