Closed jpountz closed 3 months ago
For what it's worth, the change is huge because lots of tests used to use IOContext.DEFAULT
and had to be fixed. If you filter the diff to only look at the non-test source folders, this change is pretty contained.
Hi, I was thinking about it. Why do we need to differentiate between read and write? If you open an IndexInput you read, if you open IndexOutput you're going to write. If you copy, you will do both and this sequential.
How about removing READ instead and name it DEFAULT? The others are FLUSH and MERGE.
In the future we may also have a WriteAdvice enum so we have all coordinates for handling IO.
Actually my suggestion is now a rather simple rename so should be easy to apply with IDE. The diff should also get shorter.
That should work as well, let me give it a try.
@uschindler See #13242.
Perfect. Let's close this PR as won't fix.
Closed in favor of #13242.
This effectively removes the
DEFAULT
IOContext
and forces callers to use the existingIOContext.READ
context or the newIOContext.WRITE
context instead.This comes with some interesting changes:
MockDirectoryWrapper
fails when using a writing context for reading or a reading context for writing.Directory.copyFrom
no longer takes anIOContext
.LuceneTestCase#newIOContext
has been split intonewReadIOContext
andnewWriteIOContext
.