-
Notifications
You must be signed in to change notification settings - Fork 275
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 UndeleteMessageFormatInputStream #1363
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1363 +/- ##
===========================================
+ Coverage 71.97% 72% +0.03%
- Complexity 6675 6676 +1
===========================================
Files 485 486 +1
Lines 38032 38060 +28
Branches 4820 4822 +2
===========================================
+ Hits 27374 27407 +33
+ Misses 9357 9349 -8
- Partials 1301 1304 +3
Continue to review full report at Codecov.
|
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.
LGTM
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.
A few minor comments, mostly looks good to me.
@@ -0,0 +1,50 @@ | |||
/** | |||
* Copyright 2016 LinkedIn Corp. All rights reserved. |
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.
minor: 2020
|
||
/** | ||
* Represents a message that consists of the undelete record. | ||
* This format is used to delete a blob |
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.
nit: to undelete a blob
int headerSize = MessageFormatRecord.getHeaderSizeForVersion(MessageFormatRecord.headerVersionToUse); | ||
int recordSize = MessageFormatRecord.Update_Format_V3.getRecordSize(SubRecord.Type.UNDELETE); | ||
buffer = ByteBuffer.allocate(headerSize + key.sizeInBytes() + recordSize); | ||
MessageFormatRecord.MessageHeader_Format_V2.serializeHeader(buffer, recordSize, |
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.
Looks like you decide to go with MessageHeader_Format_V2
, which means lifeVersion
is not tracked in message header. Is this intended?
* @param accountId accountId of the blob | ||
* @param containerId containerId of the blob | ||
* @param operationTimeMs operation time in ms | ||
* @param lifeVersion update version of update |
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.
nit: add more comment for update operation (i.e DELETE/TTLUpdate/UNDELETE)
short lifeVersion = 0; | ||
if (headerFormat.hasLifeVersion()) { | ||
lifeVersion = headerFormat.getLifeVersion(); | ||
} |
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.
If we don't adopt MessageHeader_Format_V3, do we still need to check this? I am considering if lifeVersion is not put in header, we probably need to remove hasLifeVersion
method from V1/V2 as well.
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.
Sorry, ignore this, I feel like we do need the lifeVersion in message header
*/ | ||
private static void checkUndeleteMessage(InputStream stream, Long expectedRecordSize, StoreKey key, short accountId, | ||
short containerId, long updateTimeMs) throws Exception { | ||
checkHeaderAndStoreKeyForUpdate(stream, expectedRecordSize, key); |
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.
if we decide to use V3 header in the future, please add lifeVersion check in checkHeaderAndStoreKeyForUpdate
method.
db954ab
to
10d9507
Compare
Adding UndeleteMessageFormatInputStream