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