Skip to content

Conversation

@abernardi597
Copy link

In most places, the byte order is BIG_ENDIAN due to:

  • DataInput/DataOutput method contracts
  • Explicit calls to ByteBuffer.order(ByteOrder.BIG_ENDIAN)

The exception is the bulk-float write call in ArrayVectorProvider, which will default to the native byte-order.

While changing the byte order there to BIG_ENDIAN would fix this, it still does not allow consumers of this library to override this behavior (where they may wish to read LITTLE_ENDIAN in their implementation of RandomAccessReader due to the static initialization of the VectorTypeSupport.

So this PR adds a bulk writeFloats to IndexWriter and uses that interface over DataOutput where necessary.
I also took the liberty to add a missing .order(BIG_ENDIAN) call in SimpleMappedReader.

Unrelated changes include:

  • Adding jdtls LSP files to .gitignore
  • Fixing a pre-existing compilation error in ProductQuantization related to type inference of Runnable rather than Callable

Closes #576.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use consistent byte-order when writing to disk

1 participant