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 2021/06/27 05:06:22 UTC
[GitHub] [cassandra] scottcarey opened a new pull request #1085: Allow nodetool garbagecollect to take a user defined list of SSTables
scottcarey opened a new pull request #1085:
URL: https://github.com/apache/cassandra/pull/1085
for CASSANDRA-16767
--
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
[GitHub] [cassandra] scottcarey commented on a change in pull request #1085: Allow nodetool garbagecollect to take a user defined list of SSTables
Posted by GitBox <gi...@apache.org>.
scottcarey commented on a change in pull request #1085:
URL: https://github.com/apache/cassandra/pull/1085#discussion_r659263962
##########
File path: src/java/org/apache/cassandra/tools/nodetool/GarbageCollect.java
##########
@@ -27,10 +27,12 @@
import org.apache.cassandra.tools.NodeProbe;
import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
+
@Command(name = "garbagecollect", description = "Remove deleted data from one or more tables")
public class GarbageCollect extends NodeToolCmd
{
- @Arguments(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables")
+
+ @Arguments(usage = "[<keyspace> <tables>...] or <SSTable file>...", description = "The keyspace followed by one or many tables or list of SSTable data files when using --user-defined")
Review comment:
The language used here was copied from nodetool compact
--
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
[GitHub] [cassandra] scottcarey commented on a change in pull request #1085: Allow nodetool garbagecollect to take a user defined list of SSTables
Posted by GitBox <gi...@apache.org>.
scottcarey commented on a change in pull request #1085:
URL: https://github.com/apache/cassandra/pull/1085#discussion_r659263308
##########
File path: src/java/org/apache/cassandra/db/compaction/CompactionManager.java
##########
@@ -333,7 +337,7 @@ public Object call() throws Exception
}
}
FBUtilities.waitOnFutures(futures);
- assert compacting.originals().isEmpty();
+ assert (compacting.originals().size() == originalCount - tableCount);
Review comment:
this assert was incorrect.
There is no unit test for 'nodetool relocatesstables' but if there was, this assert would break there too. Any operation that reduces the number of SSTables returned from `operation.filterSSTables` would break. I assume the assert came from a time prior, when all operations were supposed to process every file.
--
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
[GitHub] [cassandra] scottcarey commented on a change in pull request #1085: Allow nodetool garbagecollect to take a user defined list of SSTables
Posted by GitBox <gi...@apache.org>.
scottcarey commented on a change in pull request #1085:
URL: https://github.com/apache/cassandra/pull/1085#discussion_r659263783
##########
File path: src/java/org/apache/cassandra/db/compaction/CompactionManager.java
##########
@@ -865,22 +884,7 @@ protected void runMayThrow() throws Exception
public void forceUserDefinedCompaction(String dataFiles)
{
- String[] filenames = dataFiles.split(",");
- Multimap<ColumnFamilyStore, Descriptor> descriptors = ArrayListMultimap.create();
-
- for (String filename : filenames)
- {
- // extract keyspace and columnfamily name from filename
- Descriptor desc = Descriptor.fromFilename(filename.trim());
- if (Schema.instance.getCFMetaData(desc) == null)
- {
- logger.warn("Schema does not exist for file {}. Skipping.", filename);
- continue;
- }
- // group by keyspace/columnfamily
- ColumnFamilyStore cfs = Keyspace.open(desc.ksname).getColumnFamilyStore(desc.cfname);
- descriptors.put(cfs, cfs.getDirectories().find(new File(filename.trim()).getName()));
- }
+ Multimap<ColumnFamilyStore, Descriptor> descriptors =Descriptor.fromFilenamesGrouped(Arrays.asList(dataFiles.split(",")));
Review comment:
this logic was repeated in a few places, so I moved it into a helper: `Descriptor.fromFilenamesGrouped`
--
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