lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Created] (LUCENE-6757) Directory.openInput should not directly return IndexInput
Date Fri, 21 Aug 2015 14:41:48 GMT
Michael McCandless created LUCENE-6757:

             Summary: Directory.openInput should not directly return IndexInput
                 Key: LUCENE-6757
             Project: Lucene - Core
          Issue Type: Improvement
            Reporter: Michael McCandless

Spinoff from LUCENE-6745 suggested by [~rcmuir].

It's dangerous today that Directory.openInput returns an IndexInput which you can then use
for IO but also clone so other threads can do thread-private IO.

We could instead make this strongly typed, e.g. Directory.openInput returns a thingy (Handle,
Descriptor, something) whose sole purpose is to 1) produce IndexInput for thread-private use,
and 2) close.

In the meantime, we could add some simple asserts to MDW to detect if the "original" IndexInput
is ever use for anything but cloning, when other threads have cloned / do clone in the future.
 I'll explore that first ... it's a start.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message