-
Notifications
You must be signed in to change notification settings - Fork 624
Make FieldIndex an AutoValue #3147
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
Conversation
Coverage ReportAffected SDKs
Test Logs
NotesHTML coverage reports can be produced locally with Head commit (57e62061) is created by Prow via merging commits: 0e5ccca a75fb63. |
Binary Size ReportAffected SDKs
Test Logs
NotesHead commit (57e62061) is created by Prow via merging commits: 0e5ccca a75fb63. |
} | ||
parsedIndices.add(fieldIndex); |
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 think this is an actual bug. I changed the test to catch this.
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 don't fully follow. What was the original bug?
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.
It adds an the same index multiple times if it has more than one field.
@@ -29,132 +28,64 @@ | |||
@Config(manifest = Config.NONE) | |||
public class FieldIndexTest { | |||
|
|||
@Test |
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.
These tests are not needed anymore since equals() is generated.
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.
super clean, love this!
} | ||
parsedIndices.add(fieldIndex); |
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 don't fully follow. What was the original bug?
List<FieldIndex.Segment> segments = | ||
serializer.decodeFieldIndexSegments(Index.parseFrom(row.getBlob(2))); | ||
SnapshotVersion updateTime = | ||
new SnapshotVersion(new Timestamp(row.getLong(3), row.getInt(4))); |
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.
Seconds are stored in SQLite as INTEGER
, does it auto-convert to long?
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.
INTEGER means non-floating number of any storage size for SQLite: https://www.sqlite.org/datatype3.html
This changes FIeldIndex to be an AutoValue with the goal to make it easier to extend and add new properties.