mirror of https://github.com/apache/cassandra
Fix cf name extraction from manifest in Directories.migrateFile()
patch by Marcus Eriksson; reviewed by Aleksey Yeschenko for CASSANDRA-5242
This commit is contained in:
parent
b4d26bb4e4
commit
d4744e178d
|
|
@ -11,6 +11,7 @@
|
|||
* Add UseTLAB JVM flag (CASSANDRA-5361)
|
||||
* cli: Quote ks and cf names in schema output when needed (CASSANDRA-5052)
|
||||
* Fix bad default for min/max timestamp in SSTableMetadata (CASSANDRA-5372)
|
||||
* Fix cf name extraction from manifest in Directories.migrateFile() (CASSANDRA-5242)
|
||||
|
||||
|
||||
1.1.10
|
||||
|
|
|
|||
|
|
@ -554,7 +554,7 @@ public class Directories
|
|||
String name = file.getName();
|
||||
boolean isManifest = name.endsWith(LeveledManifest.EXTENSION);
|
||||
String cfname = isManifest
|
||||
? name.substring(0, name.length() - LeveledManifest.EXTENSION.length())
|
||||
? getCfNameFromManifest(name)
|
||||
: name.substring(0, name.indexOf(Component.separator));
|
||||
|
||||
int idx = cfname.indexOf(SECONDARY_INDEX_NAME_SEPARATOR); // idx > 0 => secondary index
|
||||
|
|
@ -571,6 +571,14 @@ public class Directories
|
|||
}
|
||||
}
|
||||
|
||||
private static String getCfNameFromManifest(String name)
|
||||
{
|
||||
String withoutExt = name.substring(0, name.length() - LeveledManifest.EXTENSION.length());
|
||||
return withoutExt.endsWith("-old") || withoutExt.endsWith("-tmp")
|
||||
? withoutExt.substring(0, withoutExt.length() - 4)
|
||||
: withoutExt;
|
||||
}
|
||||
|
||||
// Hack for tests, don't use otherwise
|
||||
static void overrideDataDirectoriesForTest(String loc)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue