You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Uwe Schindler (Jira)" <ji...@apache.org> on 2021/09/19 21:53:00 UTC

[jira] [Commented] (LUCENE-10114) Remove unused byte order mark in Lucene90PostingsWriter

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

Uwe Schindler commented on LUCENE-10114:
----------------------------------------

I found out by Git Blame: It is a relic added by [~jpountz] when he added SIMD instructions. in 8.4: https://github.com/apache/lucene/commit/7755cdf03fc250e310c3b7d9b2e785f2939d3dc9

At this time he wanted to allow Lucene to write postings in platform format, but then we decided to always go with little endian. The code was not removed from the postings writer. It was not figured out during testing, as the byte is just a filler, as access to this file works by offset only.

So it is safe to remove (can also be backported to 8.x), but I won't do this as it does not hurt.

> Remove unused byte order mark in Lucene90PostingsWriter
> -------------------------------------------------------
>
>                 Key: LUCENE-10114
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10114
>             Project: Lucene - Core
>          Issue Type: Task
>    Affects Versions: main (9.0)
>            Reporter: Uwe Schindler
>            Priority: Major
>
> While reviewing the byte order in lucene index, I found the following code in {{Lucene90PostingsWriter}}:
> {code:java}
> ByteOrder byteOrder = ByteOrder.nativeOrder();
> if (byteOrder == ByteOrder.BIG_ENDIAN) {
>   docOut.writeByte((byte) 'B');
> } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
>   docOut.writeByte((byte) 'L');
> } else {
>   throw new Error();
> }
> {code}
> Actually this byte is consumed nowhere, as the file is only used via seeking and the offsets are just 1 larger. We should remove this code.
> Why was this added?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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