mike-tr-adamson commented on code in PR #2540:
URL: https://github.com/apache/cassandra/pull/2540#discussion_r1288493005


##########
test/unit/org/apache/cassandra/index/sai/utils/SAIRandomizedTester.java:
##########
@@ -80,6 +80,29 @@ public static IndexDescriptor newIndexDescriptor() throws 
IOException
                                                                                
.build());
     }
 
+    public static IndexDescriptor newClusteringIndexDescriptor() throws 
IOException
+    {
+        String keyspace = randomSimpleString(5, 13);
+        String table = randomSimpleString(3, 17);
+        TableMetadata metadata = TableMetadata.builder(keyspace, table)
+                                              
.addPartitionKeyColumn(randomSimpleString(3, 15), Int32Type.instance)
+                                              
.addClusteringColumn(randomSimpleString(3,25), Int32Type.instance)
+                                              
.partitioner(Murmur3Partitioner.instance)
+                                              .build();
+        return indexInputLeakDetector.newIndexDescriptor(new Descriptor(new 
File(temporaryFolder.newFolder()),
+                                                                        
randomSimpleString(5, 13),
+                                                                        
randomSimpleString(3, 17),
+                                                                        new 
SequenceBasedSSTableId(getRandom().nextIntBetween(0, 128))),
+                                                         metadata,
+                                                         
SequentialWriterOption.newBuilder()
+                                                                               
.bufferSize(getRandom().nextIntBetween(17, 1 << 13))
+                                                                               
.bufferType(getRandom().nextBoolean() ? BufferType.ON_HEAP : 
BufferType.OFF_HEAP)
+                                                                               
.trickleFsync(getRandom().nextBoolean())
+                                                                               
.trickleFsyncByteInterval(nextInt(1 << 10, 1 << 16))
+                                                                               
.finishOnClose(true)
+                                                                               
.build());

Review Comment:
   Agreed. A lot of this randomization doesn't always make sense. It definitely 
doesn't make sense for us to be testing these aspects of the writers. They 
should be tested elsewhere.



-- 
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]

Reply via email to