[jira] Created: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
Allow Directory.copy() to accept a collection of file names to be copied
------------------------------------------------------------------------

                 Key: LUCENE-2339
                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
             Project: Lucene - Java
          Issue Type: Improvement
            Reporter: Earwin Burrfoot


Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org

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

Earwin Burrfoot updated LUCENE-2339:
------------------------------------

    Attachment: LUCENE-2339.patch

A simple patch

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Michael McCandless reassigned LUCENE-2339:
------------------------------------------

    Assignee: Michael McCandless

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848109#action_12848109 ]

Michael McCandless commented on LUCENE-2339:
--------------------------------------------

Patch looks good Earwin -- simple addition.  I'll commit later today...  thanks!

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848114#action_12848114 ]

Earwin Burrfoot commented on LUCENE-2339:
-----------------------------------------

I wonder if we could convert these methods from static to members, so it becomes  'from.copyTo(to, files)' ?
This opens up the possibility to override.. and.. hmm.. optimize somehow, if 'to' is of the same type as 'this'.
I believe you can rig some nio-based file copier that bypasses Java completely, so you don't have to pass multi-gb indexes through your heap when, say, backing up.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848180#action_12848180 ]

Michael McCandless commented on LUCENE-2339:
--------------------------------------------

bq. I wonder if we could convert these methods from static to members, so it becomes 'from.copyTo(to, files)' ?

I like this approach.

bq. I believe you can rig some nio-based file copier that bypasses Java completely, so you don't have to pass multi-gb indexes through your heap when, say, backing up.

NIO's transferTo, right?

For backups I wonder if we should make a copyTo/From that takes an IndexCommit... but maybe that's going too far.  EG you'd also want it to be incremental (only copy new files, maybe delete no longer referenced ones, etc.).

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848197#action_12848197 ]

Earwin Burrfoot commented on LUCENE-2339:
-----------------------------------------

bq. NIO's transferTo, right?
I didn't remember this at the point of writing, but yes, transferTo.
Google says that with certain restrictions on the size of the chunk transferred at once (eg. one huge chunk for linux, 64mb-something chunks for windows), this works crossplatform.
NIO2@Java7 has an even more simple Path.copyTo() method, so happy 7 users can use this.

bq. For backups I wonder if we should make a copyTo/From that takes an IndexCommit
Ohmigosh, no! : }
You can get file list from IC and feed it into copy(). More power with less API surface.

I'm going to add two methods copyTo(target) and copyTo(target, filenames), rewrite copy(source, target, close) to use these and deprecate it.
There's no point in keeping around slightly different versions of the same thing, and I believe people can easily close their source dirs by themselves, what a stupid option.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848284#action_12848284 ]

Michael McCandless commented on LUCENE-2339:
--------------------------------------------

OK this sounds like a good plan!

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848331#action_12848331 ]

Earwin Burrfoot commented on LUCENE-2339:
-----------------------------------------

bq. Google says that with certain restrictions on the size of the chunk transferred at once (eg. one huge chunk for linux, 64mb-something chunks for windows), this works crossplatform.
Heh. The bug existed only on 1.4 and was fixed. So I guess it works everywhere.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Earwin Burrfoot updated LUCENE-2339:
------------------------------------

    Attachment: LUCENE-2339.patch

Patch with overridable copyTo(), based off trunk+LUCENE-2328 (uses newly introduced method)

Optimized FSDir->FSDir case. Should I do special case for RAMDirs? :)

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848376#action_12848376 ]

Shai Erera commented on LUCENE-2339:
------------------------------------

Patch looks good! Few comments:

# is it safe to use NIO for all FSDirs? I thought that on Windows NIO has some bugs/limitations. In that case, would it be safer if just NIOFSDir used NIO?
# Can copyTo(Directory, Collection<String>) be changed to copyTo(Directory, Iterable<String>)? Unless we think that someone would want to use size() or something.
# I know it's a matter of style, but you "import static Arrays.asList", and then use asList directly in copyTo(Dir). It confuses me because I expect asList to be a method declared on Dir, and so I prefer to see Arrays.asList. But it's just style, don't know how others feel about that.
# On copyTo(Dir), perhaps instead of converting the listAll() to List and then remove elements from it, you can just iterate on whatever listAll() returns and add the files that pass the filter to a list? You can even optimize and if all the files Dir returned pass the filter, you can just pass the array to copyTo(Dir, Iterable), assuming we change the method to accept Iterable. But that's a minor optimization.
# copy(src, dest, boolean) - can you add a message to @deprecated so users will know what to replace it with more easily?
# I see that copy(src, dest) also accepts a boolean of whether to close the src directory. But copyTo(dIr) doesn't. I personally think it's ok, as someone can call close on src himself, but am wondering if it wouldn't be more convenient. I.e. instead of change calls from Directory.copy(src, dest, true), I now need to do src.copyTo(dest) followed by a src.close().
# closeSafely - perhaps print the stacktrace, even if you don't throw it?

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Earwin Burrfoot updated LUCENE-2339:
------------------------------------

    Attachment: LUCENE-2339.patch

1 -> I googled all around and nobody mentions any problems save for those with old 1.4 JDK. If problems arise, we can conditionalize code inside - making this optimization NIOFSDir-exclusive is just plain sad, what about MMapDir?
2 -> Don't have strong feelings there, but Uwe insists everything should be consistent and if I use Collection for sync(), then I should use it everywhere. Makes sense probably.
3 -> I feel that static imports are great. They take clutter away, but that's just my opinion. Can change this.
4 -> Applied this, without shady "optimizations".
5 -> ok
6 -> Did that on purporse. Directory.copy(src, dest, true) is way less readable than src.copyTo(dest); src.close(). There's no freaking way to tell what that true means without reading docs.
7 -> I really, really, really, really hate libraries that print something I didn't ask them for. Besides, current implementation prints nothing on similar occasion, so I'm following the trend.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848565#action_12848565 ]

Shai Erera commented on LUCENE-2339:
------------------------------------

I personally haven't seen problem using NIO on Windows, but that's perhaps just because I haven't run into them yet :). I think your proposal makes sense - let's start w/ NIO bulk-copy and then we can disable if people complain or report errors.

Consistency is important, I agree. So let's keep Collection there. I just wanted to avoid converting arrays to a Collection, just so that they can be iterated on. Seems a waste to me, but not so much to argue about :).

Re (7), I hate such libraries too. But I hate more the ones that just hide problems away from me :). The ideal thing was if Lucene would use a logging mechanism (I once started it on LUCENE-1482) so that you could include the stacktrace print if logging is enabled. But currently the code just hides the problem away ... and I'd hate to debug such thing, not realizing an IO exception is thrown from close().

So unless LUCENE-1482 springs back to life again, what do you suggest we do? Suppressing the exceptions seems wrong to me.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848591#action_12848591 ]

Uwe Schindler commented on LUCENE-2339:
---------------------------------------

bq. I just wanted to avoid converting arrays to a Collection, just so that they can be iterated on.

Sorry, for the dumb question: In which JDK do arrays implement Iterable? From my knowledge and a quick check with Java 5, it does not. Passing an array to a method taking Iterable does not work. Arrays only work in extended for statement, but not because they are Itearble. The generated code by javac is also totally different (and more effective than creating an iterator, it just uses the conventional for(i=0; i<length; i++) approach - try it out with javac and decompiling with jad or whatever)! Also arrays of native types can hardly implement Iterable without autoboxing.

See:
- [http://stackoverflow.com/questions/1160081/why-is-an-array-not-assignable-to-iterable]
- [http://72.5.124.102/thread.jspa?threadID=558036&tstart=607]

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848591#action_12848591 ]

Uwe Schindler edited comment on LUCENE-2339 at 3/23/10 7:17 AM:
----------------------------------------------------------------

bq. I just wanted to avoid converting arrays to a Collection, just so that they can be iterated on.

Sorry, for the dumb question: In which JDK do arrays implement Iterable? From my knowledge and a quick check with Java 5, it does not. Passing an array to a method taking Iterable does not work. Arrays only work in extended for statement, but not because they are Itearble. The generated code by javac is also totally different (and more effective than creating an iterator, it just uses the conventional for(i=0; i<length; i++) approach - try it out with javac and decompiling with jad or whatever)! Also arrays of native types can hardly implement Iterable without autoboxing.

See:
- [http://stackoverflow.com/questions/1160081/why-is-an-array-not-assignable-to-iterable]
- [http://72.5.124.102/thread.jspa?threadID=558036&tstart=607]

And where is the waste of calling Arrays.asList()? This is exactly the same overhead like creating an iterator() if arrays were Iterable, both are just "views" on the array, so no copy involved.

      was (Author: thetaphi):
    bq. I just wanted to avoid converting arrays to a Collection, just so that they can be iterated on.

Sorry, for the dumb question: In which JDK do arrays implement Iterable? From my knowledge and a quick check with Java 5, it does not. Passing an array to a method taking Iterable does not work. Arrays only work in extended for statement, but not because they are Itearble. The generated code by javac is also totally different (and more effective than creating an iterator, it just uses the conventional for(i=0; i<length; i++) approach - try it out with javac and decompiling with jad or whatever)! Also arrays of native types can hardly implement Iterable without autoboxing.

See:
- [http://stackoverflow.com/questions/1160081/why-is-an-array-not-assignable-to-iterable]
- [http://72.5.124.102/thread.jspa?threadID=558036&tstart=607]
 

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848606#action_12848606 ]

Shai Erera commented on LUCENE-2339:
------------------------------------

Sorry ... I was confused w/ the for loop of Java 5 :). Let's keep it Collection then. Sorry for the hassle.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848631#action_12848631 ]

Michael McCandless commented on LUCENE-2339:
--------------------------------------------

I love CloseSafely!  We do that in a number of places and should simply call it, instead.  But can we change it to throw the first exception it encounters?

I also prefer Arrays.asList to be explicit.

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848634#action_12848634 ]

Earwin Burrfoot commented on LUCENE-2339:
-----------------------------------------

bq. So unless LUCENE-1482 springs back to life again, what do you suggest we do? Suppressing the exceptions seems wrong to me.
bq. But can we change it to throw the first exception it encounters?
That's exactly what most of lucene is doing when closing something. If you can't log, you either suppress, or mask the previous exception.
Let's mask it? That way the user may get the wrong exception, but he's not getting a situation when something failed but looks okay on the surface.

bq. I love CloseSafely! We do that in a number of places and should simply call it, instead.
I did this for readers in my reopen patch, except new utility method does decRef.

bq. I also prefer Arrays.asList to be explicit
ok :/

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848636#action_12848636 ]

Shai Erera commented on LUCENE-2339:
------------------------------------

I don't want to block the issue. If LUCENE-1482 will advance somewhere, we'll log a message in closeSafely. Otherwise between suppressing to always printing I agree we should suppress. If someone does not want to suppress he should call close(). Which makes me think we should call this method closeNoException because closeSafely is not exactly what it does :).

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848670#action_12848670 ]

Michael McCandless commented on LUCENE-2339:
--------------------------------------------

bq. Let's mask it? That way the user may get the wrong exception, but he's not getting a situation when something failed but looks okay on the surface.

By "mask it" you mean hold onto the first exception you hit, continue closing & ignoring any further exceptions, then throw that first exception, right?

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-2339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2339
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
>
>
> Par example, I want to copy files pertaining to a certain commit, and not everything there is in a Directory.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

12