[ 
https://issues.apache.org/jira/browse/SOLR-9937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15805574#comment-15805574
 ] 

Mike Drob commented on SOLR-9937:
---------------------------------

The current behaviour is correct, but not optimal.efficient. Not sure what kind 
of testing you think we would benefit from.

Could do a performance test where we try to move 1000 files using 
DirectoryFactory and then move 1000 using StandardDirectoryFactory and measure 
that the second is faster. But that still sounds like we'll run into a problem 
and false failures on somebody's hardware that I haven't thought about.

> StandardDirectoryFactory::move never uses more efficient implementation
> -----------------------------------------------------------------------
>
>                 Key: SOLR-9937
>                 URL: https://issues.apache.org/jira/browse/SOLR-9937
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Mike Drob
>            Assignee: Mark Miller
>         Attachments: SOLR-9937.patch
>
>
> {noformat}
>       Path path1 = ((FSDirectory) 
> baseFromDir).getDirectory().toAbsolutePath();
>       Path path2 = ((FSDirectory) 
> baseFromDir).getDirectory().toAbsolutePath();
>       
>       try {
>         Files.move(path1.resolve(fileName), path2.resolve(fileName), 
> StandardCopyOption.ATOMIC_MOVE);
>       } catch (AtomicMoveNotSupportedException e) {
>         Files.move(path1.resolve(fileName), path2.resolve(fileName));
>       }
> {noformat}
> Because {{path1 == path2}} this code never does anything and move always 
> defaults to the less efficient implementation in DirectoryFactory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to