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 2022/12/12 10:04:40 UTC
[GitHub] [cassandra] Claudenw commented on a diff in pull request #2045: WIP: Cassandra 8928
Claudenw commented on code in PR #2045:
URL: https://github.com/apache/cassandra/pull/2045#discussion_r1045623380
##########
src/java/org/apache/cassandra/io/sstable/format/SSTableFormat.java:
##########
@@ -43,7 +43,8 @@
public static enum Type
{
//The original sstable format
- BIG("big", BigFormat.instance);
+ BIG("big", BigFormat.instance),
+ V3("bigv3", BigFormatV3.instance);
Review Comment:
That is true, but version and format seem to be tightly coupled, unless I am missing something.
##########
src/java/org/apache/cassandra/db/compaction/OperationType.java:
##########
@@ -26,6 +26,7 @@
CLEANUP("Cleanup", true, 1),
SCRUB("Scrub", true, 1),
UPGRADE_SSTABLES("Upgrade sstables", true, 1),
+ DOWNGRADE_SSTABLES("Downgrade sstables", true, 1),
Review Comment:
fixed
##########
src/java/org/apache/cassandra/db/compaction/Downgrader.java:
##########
@@ -0,0 +1,182 @@
+/*
+ * 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.db.compaction;
+
+import java.util.Arrays;
+import java.util.function.LongPredicate;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.Sets;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.DecoratedKey;
+import org.apache.cassandra.db.SerializationHeader;
+import org.apache.cassandra.db.lifecycle.LifecycleTransaction;
+import org.apache.cassandra.io.sstable.Component;
+import org.apache.cassandra.io.sstable.Descriptor;
+import org.apache.cassandra.io.sstable.SSTableRewriter;
+import org.apache.cassandra.io.sstable.format.SSTableFormat;
+import org.apache.cassandra.io.sstable.format.SSTableReader;
+import org.apache.cassandra.io.sstable.format.SSTableWriter;
+import org.apache.cassandra.io.sstable.format.Version;
+import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
+import org.apache.cassandra.io.sstable.metadata.StatsMetadata;
+import org.apache.cassandra.io.util.File;
+import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.OutputHandler;
+
+import static org.apache.cassandra.utils.TimeUUID.Generator.nextTimeUUID;
+
+public class Downgrader
+{
+ private final ColumnFamilyStore cfs;
+ private final SSTableReader sstable;
+ private final LifecycleTransaction transaction;
+ private final File directory;
+
+ private final CompactionController controller;
+ private final CompactionStrategyManager strategyManager;
+ private final long estimatedRows;
+
+ private final SSTableFormat.Type inputType;
+ private final SSTableFormat.Type outputType;
+ private final Version outputVersion;
+
+ private final OutputHandler outputHandler;
+
+ public static SSTableFormat.Type forWriting(String version)
+ {
+ String[] v3 =
Review Comment:
fixed
--
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