maedhroz commented on code in PR #2916:
URL: https://github.com/apache/cassandra/pull/2916#discussion_r1401302306


##########
test/unit/org/apache/cassandra/index/sai/cql/StorageAttachedIndexDDLTest.java:
##########
@@ -629,45 +629,53 @@ public void 
shouldReleaseIndexFilesAfterDroppingLastIndex() throws Throwable
     {
         createTable(CREATE_TABLE_TEMPLATE);
 
-        String numericIndexName = 
createIndex(String.format(CREATE_INDEX_TEMPLATE, "v1"));
-        String literalIndexName = 
createIndex(String.format(CREATE_INDEX_TEMPLATE, "v2"));
-        IndexContext numericIndexContext = 
createIndexContext(numericIndexName, Int32Type.instance);
-        IndexContext literalIndexContext = 
createIndexContext(literalIndexName, UTF8Type.instance);
-        verifyIndexFiles(numericIndexContext, literalIndexContext, 0, 0);
+        IndexIdentifier numericIndexIdentifier = 
createIndexIdentifier(createIndex(String.format(CREATE_INDEX_TEMPLATE, "v1")));
+        IndexIdentifier literalIndexIdentifier = 
createIndexIdentifier(createIndex(String.format(CREATE_INDEX_TEMPLATE, "v2")));
+        IndexTermType numericIndexTermType = 
createIndexTermType(Int32Type.instance);
+        IndexTermType literalIndexTermType = 
createIndexTermType(UTF8Type.instance);
+
+        verifyIndexFiles(numericIndexTermType, numericIndexIdentifier, 0);
+        verifyIndexFiles(literalIndexTermType, literalIndexIdentifier, 0);
 
         execute("INSERT INTO %s (id1, v1, v2) VALUES ('0', 0, '0')");
         flush();
-        verifyIndexFiles(numericIndexContext, literalIndexContext, 1, 1);
+        verifyIndexFiles(numericIndexTermType, numericIndexIdentifier, 1);
+        verifyIndexFiles(literalIndexTermType, literalIndexIdentifier, 1);
         ResultSet rows = executeNet("SELECT id1 FROM %s WHERE v1>=0");
         assertEquals(1, rows.all().size());
         rows = executeNet("SELECT id1 FROM %s WHERE v2='0'");
         assertEquals(1, rows.all().size());
 
         execute("INSERT INTO %s (id1, v1, v2) VALUES ('1', 1, '0')");
         flush();
-        verifyIndexFiles(numericIndexContext, literalIndexContext, 2, 2);
-        verifySSTableIndexes(numericIndexName, 2, 2);
-        verifySSTableIndexes(literalIndexName, 2, 2);
+        verifyIndexFiles(numericIndexTermType, numericIndexIdentifier, 2);
+        verifyIndexFiles(literalIndexTermType, literalIndexIdentifier, 2);
+
+        verifySSTableIndexes(numericIndexIdentifier, 2, 2);
+        verifySSTableIndexes(literalIndexIdentifier, 2, 2);
         rows = executeNet("SELECT id1 FROM %s WHERE v1>=0");
         assertEquals(2, rows.all().size());
         rows = executeNet("SELECT id1 FROM %s WHERE v2='0'");
         assertEquals(2, rows.all().size());
 
-        dropIndex("DROP INDEX %s." + numericIndexName);
-        verifyIndexFiles(numericIndexContext, literalIndexContext, 0, 2);
-        verifySSTableIndexes(numericIndexName, 2, 0);
-        verifySSTableIndexes(literalIndexName, 2, 2);
+        dropIndex("DROP INDEX %s." + numericIndexIdentifier.indexName);

Review Comment:
   It would actually be nice to just have a method like 
`dropIndex(numericIndexIdentifier);` given the syntax for DROP is universal and 
doesn't really need to be constantly repeated in particular tests.



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