You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2015/08/21 16:41:48 UTC
[jira] [Created] (LUCENE-6757) Directory.openInput should not
directly return IndexInput
Michael McCandless created LUCENE-6757:
------------------------------------------
Summary: Directory.openInput should not directly return IndexInput
Key: LUCENE-6757
URL: https://issues.apache.org/jira/browse/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
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org