Skip to content

Conversation

@thebrianchen
Copy link

@thebrianchen thebrianchen commented Jun 11, 2020

Porting from node.

Will add integration tests in separate PR.

@thebrianchen thebrianchen self-assigned this Jun 11, 2020
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 11, 2020
@thebrianchen thebrianchen added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 11, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 11, 2020
Comment on lines 700 to 713
Timestamp updateTime = null;

// Since delete operations currently do not have write times, use a
// sentinel Timestamp value.
// TODO(b/158502664): Use actual delete timestamp.
boolean isSuccessfulDelete =
!writeResult.hasUpdateTime()
&& Status.fromCodeValue(status.getCode()) == Status.OK;
Timestamp DELETE_TIMESTAMP_SENTINEL = Timestamp.ofTimeSecondsAndNanos(0, 0);
if (isSuccessfulDelete) {
updateTime = DELETE_TIMESTAMP_SENTINEL;
} else if (writeResult.hasUpdateTime()) {
updateTime = Timestamp.fromProto(writeResult.getUpdateTime());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This entire block is just:

Timestamp updateTime = status.isOk() ? Timestamp.fromProto(writeResult.getUpdateTime()) : null;

getUpdateTime() defaults to an empty Timestamp in the Java API.

Copy link
Author

Choose a reason for hiding this comment

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

done. It's pretty much just comment changes at this point

@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #251 into bc/bulk-master will decrease coverage by 0.00%.
The diff coverage is 74.67%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##             bc/bulk-master     #251      +/-   ##
====================================================
- Coverage             73.72%   73.72%   -0.01%     
  Complexity             1087     1087              
====================================================
  Files                    67       67              
  Lines                  5866     5865       -1     
  Branches                642      642              
====================================================
- Hits                   4325     4324       -1     
  Misses                 1341     1341              
  Partials                200      200              
Impacted Files Coverage Δ Complexity Δ
.../com/google/cloud/firestore/BulkWriterOptions.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...java/com/google/cloud/firestore/FirestoreImpl.java 78.19% <50.00%> (ø) 25.00 <1.00> (ø)
...in/java/com/google/cloud/firestore/BulkWriter.java 70.12% <70.12%> (ø) 26.00 <26.00> (ø)
...java/com/google/cloud/firestore/UpdateBuilder.java 94.98% <93.10%> (-0.02%) 75.00 <17.00> (ø)
...n/java/com/google/cloud/firestore/RateLimiter.java 100.00% <100.00%> (ø) 13.00 <1.00> (ø)
...n/java/com/google/cloud/firestore/Transaction.java 97.56% <100.00%> (ø) 11.00 <1.00> (ø)
...in/java/com/google/cloud/firestore/WriteBatch.java 100.00% <100.00%> (ø) 3.00 <1.00> (ø)
...n/java/com/google/cloud/firestore/WriteResult.java 50.00% <100.00%> (ø) 4.00 <1.00> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64007a2...3addc45. Read the comment docs.

Status.fromCodeValue(status.getCode()) == Status.OK
? Timestamp.fromProto(writeResult.getUpdateTime())
: null;
result.add(new BatchWriteResult(updateTime, Status.fromCodeValue(status.getCode())));
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Duplicate Status.fromCodeValue... from line 701

Copy link
Author

Choose a reason for hiding this comment

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

thanks, done.

@thebrianchen thebrianchen merged commit 3b76565 into bc/bulk-master Jun 11, 2020
@thebrianchen thebrianchen deleted the bc/bulk-delete branch June 11, 2020 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants