You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2023/01/11 09:11:42 UTC

[GitHub] [cassandra] jacek-lewandowski commented on a diff in pull request #2047: Add compaction type output result for nodetool compactionhistory for CASSANDRA-18061

jacek-lewandowski commented on code in PR #2047:
URL: https://github.com/apache/cassandra/pull/2047#discussion_r1066738302


##########
test/distributed/org/apache/cassandra/distributed/upgrade/CompactionHistorySystemTableUpgradeTest.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.distributed.upgrade;
+
+import com.google.common.collect.Lists;
+import com.vdurmont.semver4j.Semver;
+import org.apache.cassandra.db.compaction.OperationType;
+import org.apache.cassandra.distributed.api.ConsistencyLevel;
+import org.apache.cassandra.tools.ToolRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import static org.apache.cassandra.distributed.shared.AssertUtils.assertRows;
+import static org.apache.cassandra.distributed.shared.AssertUtils.row;
+import static org.apache.cassandra.tools.ToolRunner.invokeNodetoolJvmDtest;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(Parameterized.class)
+public class CompactionHistorySystemTableUpgradeTest extends UpgradeTestBase

Review Comment:
   I'm not sure, but such things are tested in system migrator test



##########
src/java/org/apache/cassandra/db/compaction/CompactionHistoryTabularData.java:
##########
@@ -74,10 +74,14 @@ public static TabularData from(UntypedResultSet resultSet) throws OpenDataExcept
             long bytesIn = row.getLong(ITEM_NAMES[4]);
             long bytesOut = row.getLong(ITEM_NAMES[5]);
             Map<Integer, Long> rowMerged = row.getMap(ITEM_NAMES[6], Int32Type.instance, LongType.instance);
-
+            String compactionType = OperationType.UNKNOWN.type;
+            if (row.has(ITEM_NAMES[7]))

Review Comment:
   it does not seem like this check is really needed since the system table migrator should add that column before we ever execute the code here



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org