-
Notifications
You must be signed in to change notification settings - Fork 902
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
ISSUE #1075: Add a noop digest implentation #1087
Conversation
|
||
@Override | ||
int getMacCodeLength() { | ||
return 8; |
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.
any reason why a dummy digest manager needs a 8 bytes here? can't we just make it 0? the digest here is anyway useless, no?
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.
Not sure. Perhaps there is value in emulating the size overhead? @jvrao Thoughts?
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.
I really don't really recall why we made up the digest and kept it at 8. Maybe tried to keep the payload size in sync with CRC32.
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.
@jvrao any idea to waste extra 4 bytes, if it is not even used.
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.
@jvrao I'll switch it to an empty payload.
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.
I am fine with it.
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 it is better to add a test on new API as well. Just to cover the new constant usage in tests
850bc3e
to
3c23fb5
Compare
@eolivelli Repushed with new api test. |
3c23fb5
to
960f0bb
Compare
@eolivelli please review this since you were involved in this PR |
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.
Good the new test case and the 0 length payload.
I left one last comment please check it
@Test | ||
public void testLedgerDigests() throws Exception { | ||
DigestType[] types = new DigestType[] { | ||
DigestType.CRC32, |
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.
Sine this is an enum we should use DigestType.values() so that we are sure to cover new types in the future
This digest will add a predefined digest key without actually computing it. This can be used for testing or in situations/use-cases where digest is considered overhead. (@bug W-3245776@) Signed-off-by: Venkateswararao Jujjuri (JV) <vjujjuri@salesforce.com> [Adapted to current patch, added tests] Signed-off-by: Samuel Just <sjust@salesforce.com>
960f0bb
to
9fdd7fc
Compare
@eolivelli Done. |
ping @eolivelli |
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.
+1 looks good thank you
retest this please |
1 similar comment
retest this please |
Can one of the admins verify this patch? |
retrigger travis ci build |
retest this please |
This digest will add a predefined digest key without actually computing
it. This can be used for testing or in situations/use-cases where digest
is considered overhead.
(@bug W-3245776@)
Signed-off-by: Venkateswararao Jujjuri (JV) vjujjuri@salesforce.com
[Adapted to current patch]
Signed-off-by: Samuel Just sjust@salesforce.com