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

switch to commit to avoid write limitations #135

Merged
merged 5 commits into from
Nov 19, 2020
Merged

Conversation

dmitry-s
Copy link
Contributor

fixes #126

# Conflicts:
#	spring-cloud-gcp-data-firestore/src/main/java/com/google/cloud/spring/data/firestore/FirestoreTemplate.java
Copy link
Contributor

@elefeint elefeint left a comment

Choose a reason for hiding this comment

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

Small naming things, otherwise lgtm.

return ObservableReactiveUtil.streamingBidirectionalCall(
this::openWriteStream, inputs, this::buildWriteRequest);
return Flux.from(instances).bufferTimeout(this.writeBufferSize, this.writeBufferTimeout)
.flatMap(ts -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I keep reading it as "timestamp". Rename to something more meaningful?

documentNames.bufferTimeout(this.writeBufferSize, this.writeBufferTimeout),
this::buildDeleteRequest);
return Flux.from(documentNames).bufferTimeout(this.writeBufferSize, this.writeBufferTimeout)
.flatMap(ts -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same, rename ts to something -- it also turns into e for Entity later in this block, so maybe something more consistent like "entity".

@@ -221,8 +222,8 @@ public void saveAllTest() {
@Test
public void saveAllBulkTest() {
Flux<User> users = Flux.create(sink -> {
for (int i = 0; i < 1000; i++) {
sink.next(new User("testUser " + i, i));
for (int i = 0; i < 10000; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably keep it at 1,000. 10K was useful for weeding out flakes, but likely not necessary for a regularly run test.

@dmitry-s dmitry-s merged commit 50545d7 into master Nov 19, 2020
@dmitry-s dmitry-s deleted the firestore-write-commit branch November 19, 2020 23:26
kateryna216 added a commit to kateryna216/spring-cloud-gcp that referenced this pull request Oct 20, 2022
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.

Use Firestore.commit call instead of Firestore.write
4 participants