Add IndexedByteLabels with embedded offset header for O(log n) label …#44
Draft
ZiwenWan wants to merge 1 commit intoopensearch-project:mainfrom
Draft
Add IndexedByteLabels with embedded offset header for O(log n) label …#44ZiwenWan wants to merge 1 commit intoopensearch-project:mainfrom
ZiwenWan wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
b19eeed to
702aa12
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
============================================
- Coverage 88.61% 88.44% -0.18%
- Complexity 4083 4167 +84
============================================
Files 281 283 +2
Lines 12724 13018 +294
Branches 1879 1927 +48
============================================
+ Hits 11276 11514 +238
- Misses 902 938 +36
- Partials 546 566 +20
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
54e11f9 to
551976c
Compare
…lookups Introduce IndexedByteLabels, a new Labels implementation that embeds an offset header directly in the byte array for O(log n) binary search on get() and has() with zero initialization cost at query time. Byte format: HEADER: [label_count:2][offset_0:2]...[offset_n-1:2] DATA: [name_len][name][value_len][value]... (same as ByteLabels) The offset header is written at index time and read directly during binary search — no lazy index building, no separate allocation. Add BINARY_INDEXED_BYTESLABEL as a new LabelStorageType index setting (alongside BINARY and SORTED_SET) with its own storage reader. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ziwen Wan <ziwen.wan@uber.com>
Jinny-Wang
reviewed
Feb 9, 2026
| ByteLabels other = (ByteLabels) o; | ||
| return Arrays.equals(this.data, other.data); | ||
| if (o instanceof ByteLabels other) { | ||
| return Arrays.equals(this.data, other.data); |
Contributor
551976c to
7090f56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

…lookups
Introduce IndexedByteLabels, a new Labels implementation that embeds an offset header directly in the byte array for O(log n) binary search on get() and has() with zero initialization cost at query time.
Byte format:
HEADER: [label_count:2][offset_0:2]...[offset_n-1:2]
DATA: [name_len][name][value_len][value]... (same as ByteLabels)
The offset header is written at index time and read directly during binary search — no lazy index building, no separate allocation.
Add BINARY_INDEXED_BYTESLABEL as a new LabelStorageType index setting (alongside BINARY and SORTED_SET) with its own storage reader.
Description
Describe what this change achieves.
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.