-
Notifications
You must be signed in to change notification settings - Fork 25
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
Making index record size configurable #459
Making index record size configurable #459
Conversation
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #459 +/- ##
==========================================
- Coverage 72.78% 72.59% -0.20%
==========================================
Files 49 49
Lines 12390 12386 -4
Branches 12390 12386 -4
==========================================
- Hits 9018 8991 -27
- Misses 3372 3395 +23
|
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
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.
Where does 111 come from? is there a Java PR that defines it?
We have hardcoded the attribute Id here to 111 since randomly generating it was causing issue while reading. |
These should be defined in the |
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
src/index/reader.rs
Outdated
} | ||
} | ||
_ => { | ||
info!("get segment attribute for record_size failed due to {:?}", reply); |
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.
Humm, this actually brings up an interesting edge case:
Suppose the user creates the reader before the writer. Then we would get a segment does not exist error. In this case we have a couple of options: We could fail and simply not allow creating the reader first.
To make sure the fallback value is correct, we should add a check on reader:350 to make sure the value read was actually the correct size.
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
…rd-size-configurable
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Signed-off-by: Ankur_Anand <Ankur.Anand@dell.com>
Change log description
Make index record size configurable. Current index record is of fixed length of 4k bytes. It would waste quite some space if real index is small. It is better to be adapted to the real size when reading/writing.
Purpose of the change
Closes #461
What the code does
Created a new method get_record_size in the fields trait of mod.rs with default implementation of 4k bytes. If a different record size value is required, the traits method can be overridden while writing the index event.
How to verify it
All test cases should pass.