iverase opened a new pull request #107:
URL: https://github.com/apache/lucene/pull/107


   Here is a proposal for changing the directory API to be little endian 
meanwhile keeping backwards compatibility. This effort build on top of the 
efforts of having new codecs for Lucene 9.0. In order to illustrate the 
approach, the PR is divided in 5 commits. Here is the explanation for each 
commit:
   
   **commit 1**: When changing the Directory API, the ways we write and read 
integers from DirectReader / DirectWriter needs to change as well. Therefore we 
need to make a copy of those classes to backwards codecs and make sure those 
codecs are using that version instead of the one in core.  This applies as well 
to DirectMonotonicReader / DirectMonotonicWriter.
   
   **commit 2**: I am still proposing to use IndexInput / IndexOutput wrappers 
to handle backwards compatibility. In order to make it easier to read, this 
commit wraps all directory calls in backward codecs that create an IndexInput / 
IndexOutput. 
   
   **commit 3**:  There is one file that we need to open that it does not 
belong to a codec and it might be written in big endian or little endian. The 
file is `segment.gen`. In order to make it easy, I took the approach to write 
this file always using big endian encoding. In addition I am doing the same for 
codec headers / footers. This can be improved but this approach helped me 
moving forward at this point.
   
   **commit 4**:  This commit actually changes the Directory endianness  and 
updates the DirectReader / DirectWriter integer packers to work with this 
endianness. It introduces the IndexInput / IndexOutput wrappers for backwards 
codecs.
   
   **commit 5**: Lats changes to fox the last failing test. In particular adds 
backwards compatibility for FST.
   
   The idea with this PR is to agree in the procedure. If we can agree my 
proposal is to. add commit 1 and 2 first as they are only refactors. Then we 
can focus in the last commits. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to