[ 
https://issues.apache.org/jira/browse/CASSANDRA-13974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sam Tunnicliffe updated CASSANDRA-13974:
----------------------------------------
    Status: Changes Suggested  (was: Review In Progress)

Although most of the changes to 3.11+ aren't applicable to 3.0, the change to 
{{Directories::getLocationForDisk}} is.

In {{FileUtils::isContained}}, have you considered using {{Path::startsWith}} 
rather than string wrangling?
 Comparing the strings is probably faster/more efficient, but using paths is a 
bit clearer. e.g.:

{code}
 Path folderPath = Paths.get(getCanonicalPath(folder));
 Path filePath = Paths.get(getCanonicalPath(file));
 return filePath.startsWith(folderPath);
 {code}

The difference isn't huge though, so I'll leave it to you to decide.

> Bad prefix matching when figuring out data directory for an sstable
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-13974
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13974
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core
>            Reporter: Marcus Eriksson
>            Assignee: Marcus Eriksson
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.x
>
>
> We do a "startsWith" check when getting data directory for an sstable, we 
> should match including File.separator



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to