Skip to content

Update document index entries #3132

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

Merged
merged 14 commits into from
Nov 23, 2021
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

No description provided.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 11, 2021

Coverage Report

Affected SDKs

  • firebase-firestore

    SDK overall coverage changed from 45.08% (e3f12a5) to 45.18% (938d3e4c) by +0.10%.

    Filename Base (e3f12a5) Head (938d3e4c) Diff
    AutoValue_IndexEntry.java ? 34.21% ?
    DeleteMutation.java 95.00% 90.00% -5.00%
    IndexEntry.java 0.00% 100.00% +100.00%
    MemoryIndexManager.java 64.29% 66.67% +2.38%
    PatchMutation.java 98.39% 100.00% +1.61%
    SQLiteIndexManager.java 99.33% 99.36% +0.03%
    SetMutation.java 94.29% 97.14% +2.86%
    Util.java 62.28% 66.14% +3.86%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (938d3e4c) is created by Prow via merging commits: e3f12a5 001ef5e.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 11, 2021

Binary Size Report

Affected SDKs

  • firebase-firestore

    Type Base (e3f12a5) Head (938d3e4c) Diff
    aar 1.23 MB 1.23 MB +2.49 kB (+0.2%)
    apk (release) 3.32 MB 3.33 MB +1.67 kB (+0.1%)

Test Logs

Notes

Head commit (938d3e4c) is created by Prow via merging commits: e3f12a5 001ef5e.

}
/** Represents an index entry saved by the SDK in its local storage. */
@AutoValue
public abstract class IndexEntry implements Comparable<IndexEntry> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this an AutoValue so that we have hash/equals. I am also planning to keep this class so I removed the TODO that says it is a placeholder.

cc @thebrianchen

@@ -52,9 +52,6 @@
*/
List<ResourcePath> getCollectionParents(String collectionId);

/** Updates the index entries for the given document. */
void handleDocumentChange(@Nullable Document oldDocument, @Nullable Document newDocument);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All updates will be handled by updateIndexEntries.


public static int compareByteArrays(byte[] left, byte[] right) {
int size = Math.min(left.length, right.length);
for (int i = 0; i < size; i++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is identical with the implementation right below.

@schmidt-sebastian
Copy link
Contributor Author

cc @thebrianchen

@schmidt-sebastian
Copy link
Contributor Author

/test device-check-changed

@schmidt-sebastian
Copy link
Contributor Author

/test check-changed

document.getKey(),
uid,
directionalValue,
/* arrayValue= */ new byte[] {}));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using empty byte array instead of null makes queries easier.

Copy link
Contributor

@wu-hui wu-hui left a comment

Choose a reason for hiding this comment

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

the code looks great..I have one question on deleted doc.

@wu-hui wu-hui assigned schmidt-sebastian and unassigned wu-hui Nov 23, 2021
@wu-hui wu-hui removed their assignment Nov 23, 2021
@schmidt-sebastian
Copy link
Contributor Author

/test check-changed

@schmidt-sebastian schmidt-sebastian merged commit 486abaf into master Nov 23, 2021
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/updateindices branch November 23, 2021 20:29
@firebase firebase locked and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants