Skip to content
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 tomestone flag bit into OptOutEntry to avoid major changes #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scong-ttd
Copy link
Contributor

Use 6th bit (from low) in the metadata byte to indicate user opt-in. This keeps all the data pipeline intact as we are not adding new record types. Only change required from consumer is to check that bit from the opt out record found.

@scong-ttd scong-ttd marked this pull request as ready for review February 16, 2023 09:16
@@ -131,16 +154,19 @@ public int hashCode() {
return (int) (timestamp + Arrays.hashCode(identityHash) + Arrays.hashCode(advertisingId));
}

private static byte calcMetadata(byte[] advertisingId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to leave the old function in for backward compatibility?

public OptOutEntry(byte[] identityHash, byte[] advertisingId, long ts) {
assert identityHash.length == OptOutConst.Sha256Bytes;
assert advertisingId.length == OptOutConst.Sha256Bytes || advertisingId.length == OptOutConst.Sha256Bytes + 1;
// assert ts >= 0;
this.identityHash = identityHash;
this.advertisingId = advertisingId;
this.timestamp = ts;
this.isTombstone = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call the constructor below instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants