-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Add checksumming and versions to the Translog's Checkpoint files #19797
Conversation
@s1monw @mikemccand can you guys take a look? PS. I would love to get rid of the |
return new Checkpoint(new InputStreamDataInput(in)); | ||
try (Directory dir = new SimpleFSDirectory(path.getParent())) { | ||
try (final IndexInput indexInput = dir.openInput(path.getFileName().toString(), IOContext.DEFAULT)) { | ||
if (indexInput.length() == 20) { |
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.
Can we pull 20
out to a static constant like OLD_CHECKSUM_FILE_LENGTH
?
Thanks @bleskes, I left some comments. |
@mikemccand @s1monw I pushed another commit addressing feedback. I switched back to vanilla |
final ByteArrayDataOutput out = new ByteArrayDataOutput(buffer); | ||
write(out); | ||
Channels.writeToChannel(buffer, channel); | ||
static Checkpoint readChecksummed(DataInput in) throws IOException { |
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.
Maybe rename to readChecksummedV1
?
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.
will do.
LGTM, I just left a minor renaming suggestion. |
LGTM 2 |
This prepares the infrastructure to be able to extend the checkpoint file to store more information.