File manifestFile = directories.tryGetLeveledManifest();
if (manifestFile == null)
return;
LegacyLeveledManifest legacyManifest = new LegacyLeveledManifest(manifestFile);
for (Map.Entry<Descriptor, Set<Component>> entry : directories.sstableLister().includeBackups(false).skipTemporary(true).list().entrySet())
{
Descriptor d = entry.getKey();
Pair<SSTableMetadata, Set<Integer>> oldMetadata = SSTableMetadata.serializer.deserialize(d, false);
String metadataFilename = d.filenameFor(Component.STATS);
LeveledManifest.mutateLevel(oldMetadata, d, metadataFilename, legacyManifest.levelOf(d.generation));