-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LUCENE-10319: make ForUtil#BLOCK_SIZE changeable #545
Conversation
I'm a bit torn as this also makes the code harder to read with all these constants with complex names. |
Thanks @jpountz ! This is indeed making codes harder to read. I tried to make all these complex constants generated from script, keeping |
@@ -1051,4 +1052,76 @@ private static void decode24(DataInput in, long[] tmp, long[] longs) throws IOEx | |||
longs[longsIdx + 0] = l0; | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let these codes be generated from the script, so that it can change with the change of BLOCK_SIZE.
… with out changing {{ and }}
In LUCENE-10315, I tried to generate a ForUtil whose BLOCK_SIZE=512, I thought it could be simple since it looks like i only need to change the BLOCK_SIZE, but it turns out that there are a lot of hard code values...
So this is trying to make all hard code value generated from the BLOCK_SIZE in case we need a ForUtil somewhere else or want to change BLOCK_SIZE in postings in feature.
I tried to make the BLOCK_SIZE = 64 / 256 and all tests passed.