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

Pubsub ordering keys #5055

Closed
wants to merge 66 commits into from
Closed

Pubsub ordering keys #5055

wants to merge 66 commits into from

Conversation

sduskis
Copy link
Contributor

@sduskis sduskis commented May 2, 2019

Pubsub has a new upcoming feature which will allow users to send and receive messages in a guaranteed order.

@kamalaboulhosn and @kimkyung-goog, I believe that all of the features are ready to go. Can you please review this PR? Also, guidance would be appreciated on whether or not you feel like this can be merged to master.

kamalaboulhosn and others added 30 commits February 8, 2019 08:10
* Bump next snapshot (#4300)

* Cloud Bigtable: instanceAdmin sample (#4299)

* instanceAdmin sample and tests

* comments added

* instanceAdminExample changes

* renamed variables

* changes

* Regenerate securitycenter client (#4311)

* 3540: Used transformer for shaded plugin (#4305)

* Added Query#fromProto to convert protobuf ReadRowsRequest (#4291)

* Adding Query.fromProto

* Adding Query.fromProto

* adding changes as per feedback

* updated javadoc as per feedback

* reformatted Query & QueryTest.java

* Bigquery: corrected equality check on subclasses of StringEnumValue (#4283)

* Bigquery: corrected equality check on subclasses of StringEnumValue

* update format for FieldTest.java

* Fix #4269 update metata url to FQDN (#4278)

* 4152: Added checking PAGE_TOKEN from options (#4303)

* 3918: Added checking of attributes size for 0. Added unit test (#4304)

* Bigtable: Merge bigtable-admin into the bigtable artifact (#4307)

* Bigtable: merge bigtable-admin into the bigtable artifact

* split exclusion change for future PR

* fix admin pathes

* fix deprecation warning

* fix synth script

* fix generated file

* temporarily re-add kokoro scripts (and point them to the merged artifact) until the jobs have been removed

* Remove dep from examples

* fix admin integration tests

* revert stray fix (will be added to a separate PR)

* fix int tests

* don't double format the code

* fix up docs

* Regenerate PubSub: documentation updates (#4293)

* Regenerate monitoring client (#4316)

* Regenerate bigtable client (#4318)

* 3822: Fixed setDisableGZipContent call (#4314)

* 3822: Fixed setDisableGZipContent call

* 3822: Changes after review

* Regenerate speech client: enable multi-channel features (#4317)

* Release v0.77.0 (#4324)

* Created enum Region.java to retrieve Regions without doing request. (#4309)

* Bump next snapshot (#4325)

* Bigtable: fix handling of unset rpc timeouts (#4323)

When the rpc timeout is zero, then it should be treated as disabled not actual 0

* Bigtable: Expose single row read settings (#4321)

* exposing ReadRowSettings thru BigtableDataSettings

* fixed typo error

* Regenerate compute client (#4327)

* Regenerate speech client (#4328)

* Update README version to use bom version (#4322)

* BigQuery: Fix NPE for null table schema fields (#4338)

* Add failing test for empty table schema

* Fix NPE if table schema returns null for fields

* Bump gax, grpc & opencensus version (#4336)

* Cloud Bigtable: HelloWorld sample updates (#4339)

* comments added in HelloWorld and ITHelloWorld

* removed typsafe name

* separate properties for bigtable.project and bigtable.instance

* separate properties for bigtable.project and bigtable.instance (#4346)

* Pub/Sub: default values in batch settings comments (#4350)

* Pub/Sub: default values in batch settings comments

Ref: https://github.com/googleapis/gax-java/blob/master/gax/src/main/java/com/google/api/gax/batching/BatchingSettings.java

* Verbose comment

* Update maven-surefire-plugin to 3.0.0-M3 to fix Java 8 classloader (#4344)

* Update maven-surefire-plugin to 3.0.0-M3 to fix Java 8 classloader

* Update failsafe plugin to 3.0.0-M3 too

* Specify maven-surefire-plugin version in bigtable-emulator

* Bigtable: Fixing a typo for KeyOffSet#geyKey to getKey (#4342)

* Regenerate spanner client (#4332)

* Spanner: remove junit from compile dependencies (#4334)

* Firestore: change timestampsInSnapshots default to true. (#4353)

BREAKING CHANGE: The `areTimestampsInSnapshotsEnabled()` setting is now enabled
by default so timestamp fields read from a `DocumentSnapshot` will be returned
as `Timestamp` objects instead of `Date`. Any code expecting to receive a
`Date` object must be updated.

* Regenerate clients with updated copyright year (#4382)

* Regenerate asset client

* Regenerate automl client

* Regenerate bigquerydatatransfer client

* Regenerate bigquerystorage client

* Regenerate bigtable client

* Regenerate container client

* Regenerate containeranalysis client

* Regenerate dataproc client

* Regenerate dialogflow client

* Regenerate dlp client

* Regenerate errorreporting client

* Regenerate iamcredentials client

* Regenerate iot client

* Regenerate kms client

* Regenerate language client

* Regenerate logging client

* Regenerate monitoring client

* Regenerate os-login client

* Regenerate pubsub client

* Regenerate redis client

* Regenerate securitycenter client

* Regenerate speech client

* Regenerate tasks client

* Regenerate trace client

* Regenerate video-intelligence client

* Regenerate websecurityscanner client

* Release google-cloud-java v0.78.0 (#4386)

* Regenerate compute client (#4359)

* Cloud Bigtable: tableAdmin sample (#4313)

* tableAdmin sample and tests

* comments added

* files renamed and other edits

* some changes in TableAdminExample and tests

* fixed timestamp to base 16

* separate properties for bigtable.project and bigtable.instance

* Regenerate scheduler client (#4294)

* Regenerate spanner client (#4388)

* Bump next snapshot (#4391)

* Regenerate asset client (#4395)

* Regenerate scheduler client (#4396)

* Firestore: Include a trailing /documents on root resource paths (#4352)

This is required for v1 and accepted in v1beta1.

Port of googleapis/nodejs-firestore@52c7381

* Release v0.79.0 (#4402)

* Removing some unused dependencies (#4385)

* Removing some unused dependencies
Also, reducing scope of auto-value to provided.

* Restoring Firestore auto-value

* Removing more instances of easymock.

* Removing non-deprecated uses of joda time. (#4351)

* Removing non-deprecated uses of joda time.
This works towards #3482

* Update pom.xml

* Ran `mvn com.coveo:fmt-maven-plugin:format`

* Fixing a bad merge

* Bump next snapshot (#4405)

* fix shading (#4406)

* Fixing some deprecation warnings (#4390)

* fixing some deprecation warnings

* updated comment

* BigQuery : Fix Location configurable at BigQueryOptions (#4329)

* Fix Location configurable from BigQueryOptions

* modified code

* modified code and add test case

* removed unused location

* Generate Firestore API v1 (#4410)

* Bigtable: make row & cell ordering more consistent. (#4421)

* Bigtable: make row & cell ordering more consistent.

* RowCells should always be ordered in lexicographically by family, then qualifier and finally by reverse chronological order
* Although rows will always be ordered lexicographically by row key, they should not implement Comparable to avoid confusion when compareTo() == 0 and equals() is false. Instead that ordering was moved to a separate comparator.

* Add helpers to filter cells by family & qualifier

* tweaks

* code style

* code style

* Fix code formatting (#4437)

* Regenerate compute client (#4399)

* Regenerate compute client (#4444)

* Firestore: Migrate client to use v1 gapic client / protos. (#4419)

* Regenerate asset client (#4426)

* Regenerate bigtable client (#4427)

* Regenerate dataproc client (#4428)

* Regenerate speech client (#4422)

* Regenerate dialogflow client (#4429)

* Regenerate redis client (#4431)

* Regenerate securitycenter client (#4432)

* Regenerate tasks client (#4411)

* Fix usages of any(<Primitive>.class) matchers (#4453)

In Mockito 2, if a method expects a primitive type, but an any(<Primitive>.class) matcher is used in its place, it will throw an error. To prepare for this upcoming breakage, change
all existing any(<Primitive>.class) matchers to use the correct any<Primitive>() matcher.

* Regenerate video-intelligence client (#4434)

* Regenerate automl client (#4418)

* Regenerate automl client (#4455)

* Regenerate speech client (#4456)

* add comments (#4441)

* Update some default retry setting values (#4425)

Ref: https://github.com/googleapis/google-cloud-java/blob/ed7bc857a05b34eed6be182d4798a62bf09cd394/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java#L497

* Implement BucketPolicyOnly (#4404)

* implement BucketPolicyOnly

* [Storage] Bucket Policy Only samples (#4408)

* Humble beginnings for BPO samples with tests

* Update samples per client changes

* Fix format issue

* Lint fix

* Bigtable: make request context serializable (#4459)

* Bigtable: expose helper to convert proto rows into model rows (#4458)

This is needed for hbase adapter transition

* Regenerate texttospeech client (#4333)

* Regenerate compute client (#4462)

* Skip integration tests if no changes (#4392)

* Add environment variable for allowing skipping ITs

* Skip integration tests if there are no changes in that directory

* Also check google-cloud-core client and the grpc-api generated models

* update TESTING.md (#4409)

* Regenerate spanner client (#4433)

* Regenerate texttospeech client (#4463)

* 3534: Made HttpTransportOptions constructor public. (#4439)

* use gax 1.38.0 (#4460)

* Regenerate firestore client (#4348)

* Empty table results can have a schema (#4185)

* Update EmptyTableResult.java

* Update Job.java

* add test case

* 4273: Added a new create method to pass offset and length of sub array. (#4407)

* 4273: Added a new create method to pass offset and lenght of sub array.

* 4273: Fixed codeformat error.

* 4273: Rephrased a comment.

* 4273: Added a new integration test using the new createBlobWithSubArrayFromByteArray code snippet.

* Add firestore grpc and proto versions to versions.txt (#4464)

* Release v0.80.0 (#4465)

* Bump next snapshot (#4467)

* Adding Cloud Bigtable Mutation fromProto (#4461)

* Adding Cloud Bigtable Mutation fromProto

* Fixing formatting

* Addressing comments
`fromProto` becomes `fromProtoUnsafe`

* Fixing lint issues.

* adding a warning to `fromProtoUnsafe`

* Regenerate websecurityscanner client (#4435)
…/google-cloud-java into pubsub-ordering-keys
…s sequentially (#4315)

* Add SequentialExecutorService

* Add headers, make methods package private, and other review changes.

* Fix formatting of SequentialExecutorService classes.
* Add ordering key fields to proto. We are locally committing the proto with ordering keys for now. Once we are prepared to release this feature, we can use the default, released proto.

* Add support for ordered publishing

* Add comments about ordering key properties.

* Change retry codes and add checks for a null ordering key.
* Add ordering key fields to proto. We are locally committing the proto with ordering keys for now. Once we are prepared to release this feature, we can use the default, released proto.

* Add support for ordered publishing

* Add comments about ordering key properties.

* Change retry codes and add checks for a null ordering key.

* Add support for ordered delivery to subscribers
* Scale the system executor provider with the number of pull channels opened. (#4592)

Make the SubscriberStubSettings refer to the user provided executor provider instead of a fixed instantiation of it.  If the user provides an InstantiatingExecutorProvider instead of a FixedExecutorProvider, this will actually instantiate more than one as the user would expect.  It will still only instantiate one for all connections to share, and will do so until the next PR which will make them have different stub instantiations.

* Using the google-cloud-http-bom (#4594)

* Using the latest version of truth (#4597)

* Using a much newer version of truth

* Upgrading annotations in google-api-grpc

* Regenerate websecurityscanner client (#4614)

* Regenerate vision client (#4613)

* Regenerate video-intelligence client (#4612)

* Regenerate tasks client (#4611)

* Regenerate securitycenter client (#4610)

* BigQuery: Fix useAvroLogicalTypes option in LoadJobConfiguration And WriteChannelConfiguration. (#4615)

* Fix useAvroLogicalTypes in LoadJobConfiguration

* Fix comment and added useAvroLogicalTypes in WriteChannelConfiguration

* Fix comment

* Fix code format

* add propagateTimeout in SpannerExceptionFactory (#4598)

- Add a helper method propagateTimeout in SpannerExceptionFactory to easily transform a TimeoutException to a SpannerException.
- Propagate ApiExceptions a bit more nicely.

* Regenerate scheduler client (#4609)

* Regenerate pubsub client (#4608)

* Regenerate os-login client (#4607)

* Regenerate dlp client (#4603)

* Regenerate iamcredentials client (#4605)

* Regenerate bigquerystorage client (#4601)

* Regenerate dataproc client (#4602)

* Regenerate bigquerydatatransfer client (#4600)

* Regenerate language client (#4606)

* Regenerate firestore client (#4604)

* Set the isDirectory flag appropriately (#4616)

Set the isDirectory flag appropriately when using the currentDirectory() option

* Extract the single message processing functionality from processOutstandingBatches. (#4618)

* Upgrading grpc in google-api-grpc (#4593)

* Prepare for KMS GA release - upgrade versions to 1.0.0. (#4581)

* Adding vision v1p4beta1 (#4584)

* Adding vision v1p4beta1

* Updating more pom.xmls

* Fixing formatting issues

* Clean up MessageDispatcher by changing processOutstandingBatches to explicitly loop instead of while(true) with breaks.  There is now only 1 explicit return and 1 runtime error. (#4619)

* Release google-cloud-java v0.82.0 (#4621)

* Release v0.82.0

* Change KMS versions to 1.0.0.

* Remove global synchronization from MessageDispatcher. (#4620)

* Remove global synchronization from MessageDispatcher.

Now that this uses a LinkedBlockingDeque for batches, this is no longer necessary.

* Run code format.

* Bump next snapshot (#4623)

* Regenerate vision client (#4625)

* Regenerate dataproc client (#4634)

* Regenerate dialogflow client (#4635)

* Regenerate firestore client (#4638)

* Regenerate iot client (#4639)

* Regenerate monitoring client (#4642)

* Regenerate bigtable client (#4631)

* Regenerate errorreporting client (#4637)

* Regenerate pubsub client (#4643)

* Regenerate automl client (#4629)

* Regenerate redis client (#4644)

* Regenerate bigquerydatatransfer client (#4630)

* Regenerate scheduler client (#4645)

* Regenerate kms client (#4640)

* Regenerate vision client (#4650)

* Regenerate websecurityscanner client (#4651)

* Regenerate containeranalysis client (#4633)

* Regenerate dlp client (#4636)

* Regenerate trace client (#4649)

* Regenerate spanner client (#4647)

* Regenerate logging client (#4641)

* Regenerate tasks client (#4648)

* Regenerate securitycenter client (#4646)

* Bump gax to 1.42.0 (#4624)

Also regenerate the Compute client to match the newest version of gax.

* Batch dml mainline (#4653)

* Cloud Spanner Batch DML implementation and integration tests. (#45)

* Fix the file header of the newly added classes. (#46)

* Fix RPC interface mismatch after GAPIC migration.

* Address review comment.

* Fix code format with mvn com.coveo:fmt-maven-plugin:format.

* Update year in file headers.

* BigQuery: add long term storage bytes to standard table definition. (#4387)

* BigQuery: Add long term storage bytes for managed tables.

* formatting

* let maven format the things

* plumb this upwards into Table/TableInfo

* return

* assertion mismatch

* Update TableInfoTest.java

* Regenerate compute client (#4662)

* Add Cloud Security Center v1 API. (#4659)

* Add Cloud Security Center v1 API.

* Add securitycenter to google-cloud-bom pom.xml

* Fixing code format

* Adding FieldValue.increment() (#4018)

* DO NOT MERGE: Adding FieldValue.increment()

* Use "increment" Proto naming

* Spanner: Throw exception when SSLHandshakeException occurs instead of infinite retry loop (#4663)

* #3889 throw exception when an SSLHandshakeException occurs

SSLHandshakeExceptions are not retryable, as it is most probably an
indication that the client does not accept the server certificate.

* #3889 added test for retryability of SSLHandshakeException

* fixed formatting

* Add Cloud Scheduler v1 API. (#4658)

* Add Cloud Scheduler v1 API.

* Fixes to google-cloud-bom pom.xml

* Add proto to scheduler pom.xml

* Fix Timestamp.parseTimestamp. (#4656)

* Fix parseTimestamp docs

* Fix timestamp without timezone offset

* Fix test cases related to timestamp.parseTimestamp

* added test case

* Fix timestampParser and added ZoneOffset in timestampParser

* Release google-cloud-java v0.83.0 (#4665)

* Regenerate securitycenter client (#4667)

* Bump next snapshot (#4666)

* Change each StreamingSubscriberConnection to have its own executor by default. (#4622)

* Change each StreamingSubscriberConnection to have its own executor by default.

This increases throughput by reducing contention on the executor queue mutex and makes the Subscriber implementation more accurately reflect the users intent when an InstantiatingExecutorProvider is passed.

* Add a comment for executorProvider and alarmsExecutor.

* Bigtable: Remove reference to deprecated typesafe name (#4671)

* Add Cloud Video Intelligence v1p3beta1 API. (#4669)

* Add Cloud Video Intelligence v1p3beta1 API.

* Fix code formatting.

* Regenerate language client (#4676)

* Regenerate securitycenter client (#4677)

* Regenerate firestore client (#4686)

* #4685 Spanner now extends AutoCloseable (#4687)

* Update speech readme to point to v1 javadoc. (#4693)

* Fix pendingWrite race condition (#4696)

pendingWrites.add() was not guaranteed to be called before pendingWrites.remove()

* Optimize pendingWrites (#4697)

Reduce contention on pendingWrites by using a ConcurrentHashMap instead.

* Better explain how to use explicit credentials (#4694)

* Better explain how to use explicit credentials

This pull request updates the documentation and adds an example.

* Run auto-formatter

mvn com.coveo:fmt-maven-plugin:format

* Updating Copyright year on UseExplicitCredentials

* Add Cloud Talent Solution API. (#4699)

* Add Talent API

* Add Talent API

* Add Talent API

* Add talent API

* reformat

* Update pom.xml

* Update pom.xml

* Add MDC support in Logback appender (#4477)

* Firestore: Update CustomClassMapper (#4675)

* Firestore: Update CustomClassMapper

* Adding Unit tests

* Lint fix

* Regenerate securitycenter client (#4704)

* Regenerate talent client (#4705)

* BigQuery: Added missing partitioned fields to listTables. (#4701)

* Add missing partitioned fields to listTables

* Fix table delete in finally block

* Fix test failing

* OpenCensus Support for Cloud Pub/Sub (#4240)

* Adds OpenCensus context propagation to Publisher and Subscriber.

* Updates OpenCensus attribute keys so that they will be propagated by CPS.

* Addresses reviewer comments by fixing build files and using only defined annotations.

* Updates build dependencies and copyright date.

* Fixes typo.

* Removes encoding of OpenCensus tags. Will re-enable once text encoding spec has been finalized (census-instrumentation/opencensus-specs#65).

* Updates encoding of SpanContext to use W3C specified encoding; Also preserves sampling decision from the publisher in the subscriber.

* Adds unit test for OpenCensusUtil.

* Adds unit test for OpenCensusUtil.

* Updates OpenCensus integration to use a generic MessageTransform.

* Removes now-unused private constant.

* Update pom.xml

* Marking setTransform as BetaApi

* Fixes for formatting issues.

* Release v0.84.0 (#4713)

* Bump next snapshot (#4715)

* Fix comment in grpc-google-cloud-firestore-v1 POM (#4717)

Fixing a copy&paste typo

* Regenerate firestore client (#4719)

* Upgrade common protos dependency to 1.15.0. (#4722)

* V1 Admin API for Firestore (#4716)

* Manually regenerate Redis (#4723)

* Manually regenerate Redis

* Fixing a formatting issue

* 1.x is stable (#4724)

@sduskis

* Regenerate bigquerystorage client (#4730)

* Regenerate pubsub client (#4732)

* Added feature to accept Firestore Value. (#4709)

* Fix firestore value

* Added IT test

* try to fix flaky test (#4733)

(cherry picked from commit 8255a9b)

* Regenerate compute client (#4731)

* Replacing GoogleCloudPlatform with googleapis in docs. (#4707)

* Replacing GoogleCloudPlatform with googleapis in docs.

* Fixing formatting issues.

* Regenerate Redis client (#4738)

* redis changes with googleapis changes for STATIC_TYPES

* foo

* revert noop

* fix default value of maxSessions in document of setMaxSessions (#4728)

* Spanner: Added extra documentation to the DatabaseClient.singleUse methods (#4721)

* added extra documentation to the singleUse methods #4212

* changed formatting manually and re-run mvn formatter

* Regenerate Firestore clients (#4741)

* add diff

* linter

* Regenerate iamcredentials client (#4746)

* Regenerate monitoring client (#4747)

* Refresh Monitoring client (#4744)

* regen monitoring with STATIC_TYPES

* regen again but with java_package

* regen again with enable_string_formatting_functions

* regen again

* the OuterClass is generated because the proto file contains the amessage of the same name

* no changes in protos or gapics, just refresh

* refresh but with proto changes only

* Add Snippets for working with Assets in Cloud Security Command Center. (#4690)

* Add Snippets for working with Assets in Cloud Security Command Center.

- I missed instruction for how to add a new key, but I believe
a new account is needed, so prestaged assets can be queried.

* Address code review comments.

* remove securitycenter-it.cfg

* update comments

* fix string remove firewall reference

* Fix format

* fix format

* Address comments and fix bad docs/alignment with python example

* Fix print description

* Updates per rubrics

* fix warnings

* Add Apache Headers

* remove unused comment

* Manually regenerating the talent v4beta1 API (#4750)

* Manually regenerating the talent v4beta1 API
ResumeService was removed from the protos, requiring manual deletion of all related classes.

* Fixing formatting.

* Pass through header provider in BQ storage client settings. (#4740)

* Pass through header provider in BQ storage client settings.

This change modifies the enhanced stub for the BigQuery storage
client to pass through the user-specified header provider to the
storage settings base class at creationt ime. This addresses an
issue where user-specified headers were being ignored when creating
a client object.

* Apply formatting plugin

* Set up the in-proc server only once

* It's 2019 now

* changes for iamcreds with STATIC_TYPES (#4745)

* Regenerate asset client (#4758)

* Regenerate automl client (#4759)

* Regenerate dlp client (#4765)

* Regenerate bigtable client (#4760)

* Regenerate logging client (#4769)

* Regenerate monitoring client (#4770)

* Regenerate pubsub client (#4772)

* Regenerate container client (#4761)

* Regenerate os-login client (#4771)

* Regenerate errorreporting client (#4766)

* Regenerate containeranalysis client (#4762)

* Regenerate talent client (#4777)

* Regenerate securitycenter client (#4775)

* Regenerate redis client (#4773)

* Regenerate scheduler client (#4774)

* Regenerate iamcredentials client (#4768)

* Regenerate dialogflow client (#4764)

* Regenerate firestore client (#4767)

* Regenerate spanner client (#4776)

* Regenerate trace client (#4778)

* Regenerate dataproc client (#4763)

* Regenerate vision client (#4779)

* Regenerate websecurityscanner client (#4780)

* regen (#4755)

* Upgrade google.auth.version to 0.15.0. (#4743)

* Upgrade google.auth.version to 0.14.0.

* Upgrade google.auth.version to 0.14.0.

* Upgrade google.auth.version to 0.15.0.

* allow specifying a custom credentials file for integration tests (#4782)

* Regenerate containeranalysis client (#4792)

* Regenerate dataproc client (#4793)

* Regenerate datastore client (#4794)

* Regenerate asset client (#4786)

* Regenerate iamcredentials client (#4799)

* Regenerate bigquerydatatransfer client (#4788)

* Regenerate language client (#4802)

* Regenerate kms client (#4801)

* Regenerate bigtable client (#4790)

* Regenerate monitoring client (#4804)

* Regenerate bigquerystorage client (#4789)

* Regenerate speech client (#4811)

* Regenerate securitycenter client (#4809)

* Regenerate spanner client (#4810)

* Regenerate redis client (#4807)

* Regenerate container client (#4791)

* Regenerate scheduler client (#4808)

* Regenerate os-login client (#4805)

* Regenerate errorreporting client (#4797)

* Regenerate websecurityscanner client (#4818)

* Regenerate logging client (#4803)

* Regenerate texttospeech client (#4814)

* Regenerate tasks client (#4813)

* Regenerate dialogflow client (#4795)

* Regenerate trace client (#4815)

* Upgrade protobuf version to 3.7.0. (#4819)

* Upgrade protobuf version to 3.7.0.

* Upgrade protobuf version to 3.7.1.

* Upgrade protobuf version to 3.7.0.

* Release google-cloud-java v0.85.0 (#4820)

* Bump snapshot (#4821)

* Regenerate automl client (#4822)

* Regenerate dialogflow client (#4823)

* Regenerate dlp client (#4824)

* Regenerate firestore client (#4825)

* Regenerate iot client (#4826)

* Regenerate pubsub client (#4827)

* Regenerate talent client (#4828)

* Regenerate video-intelligence client (#4829)

* Regenerate vision client (#4830)

* Add Cloud Asset v1 API. (#4834)

* Upgrade gax to 1.43.0. (#4836)

* Upgrade gax to 1.43.0.

* code format

* Regenerate iamcredentials client (#4849)

* Regenerate iot client (#4850)

* Regenerate kms client (#4851)

* Regenerate texttospeech client (#4864)

* Regenerate tasks client (#4863)

* Regenerate talent client (#4862)

* Regenerate bigquerystorage client (#4840)

* Regenerate bigquerydatatransfer client (#4839)

* Regenerate automl client (#4838)

* Regenerate language client (#4852)

* Regenerate monitoring client (#4854)

* Regenerate pubsub client (#4856)

* Regenerate redis client (#4857)

* Regenerate scheduler client (#4858)

* Regenerate securitycenter client (#4859)

* Regenerate spanner client (#4860)

* Regenerate trace client (#4865)

* Regenerate video-intelligence client (#4866)

* Regenerate websecurityscanner client (#4868)

* Regenerate vision client (#4867)

* Regenerate speech client (#4861)

* Regenerate os-login client (#4855)

* Regenerate logging client (#4853)

* Regenerate firestore client (#4848)

* Regenerate containeranalysis client (#4843)

* Regenerate container client (#4842)

* Regenerate bigtable client (#4841)

* Regenerate dataproc client (#4844)

* Regenerate dlp client (#4846)

* Regenerate errorreporting client (#4847)

* google-cloud-logging-logback: Allow user to specify custom LoggingOptions (#4729)

google-cloud-logging-logback: #3215 allow user to specify custom LoggingOptions

* Regenerate asset client (#4837)

* Regenerate dialogflow client (#4845)

* Add translate v3beta1 API. (#4870)

* translate v3beta1

* readme

* Adding datalabeling. (#4872)

* Adding datalabeling.

* Fixing formatting.

* Adding datalabeling readme.

* Fixing Readme.

* Add tasks v2 client (#4879)

* auto close input stream (#4878)

* Add Cloud Web Risk client. (#4881)

* Add Cloud Web Risk client.

* code format fix

* Add note on whitelist / signing up for Beta.

* Delete stray preposition

* Regenerate datalabeling client (#4883)

* Regenerate automl client (#4882)

* Regenerate talent client (#4884)

* fix flaky TransactionManager tests (#4897)

Transactions can always be aborted by Cloud Spanner, and all transaction
code should therefore be surrounded by with abort safeguarding.

* Change .yaml file name for webrisk client. (#4898)

* Adding the translate beta samples (#4880)

* Adding the translate beta samples

* Fixing lint issues

* Fixing coding format/style

* Fixing coding format/style

* Release v0.86.0 (#4899)

* Bump next snapshot (#4900)

* Regenerate bigquerystorage client (#4902)

* Regenerate language client (#4903)

* Regenerate webrisk client (#4904)

* Storage: Add V4 signing support (#4692)

* Add support for V4 signing

* (storage) WIP: Add V4 signing support

* (storage) Add V4 signing support

* Add V4 samples (#4753)

* storage: fix v4 samples (#4754)

* Add V4 samples

* Match C++ samples

* Add missing import

* Add web risk to list of clients. (#4901)

* Release v0.87.0 (#4907)

* Bump next snapshot (#4908)

* Regenerate tasks client (#4912)

* Regenerate scheduler client (#4911)

* Regenerate redis client (#4910)

* Regenerate compute client (#4909)

* Spanner: Refactor SpannerImpl - Move AbstractResultSet to separate file (#4891)

Refactor SpannerImpl: Move AbstractResultSet to separate file

* Spanner: Refactor SpannerImpl - Move AbstractReadContext to separate file (#4890)

Spanner: Refactor SpannerImpl - Move AbstractReadContext to separate file

* Regenerate language client (#4921)

* Spanner: Refactor SpannerImpl - Move DatabaseAdminClientImpl to separate file (#4892)

* refactor SpannerImpl: move DatabaseAdminClientImpl to separate file

* removed unnecessary imports

* Bigquery : Fix close write channel (#4924)

* close write channel

* Update BigQuerySnippets.java

* Update BigQuerySnippets.java

* Update BigQuerySnippets.java

* Spanner: Refactor SpannerImpl - Move InstanceAdminClient to separate file (#4893)

refactor SpannerImpl: move InstanceAdminClient to separate file

* refactor SpannerImpl: move PartitionedDmlTransaction to separate file (#4894)

* BigQuery: Added listPartitions. (#4923)

* added listPartitions

* added unit test

* modified code

* modified unit test for listPartitions

* added integration test

* Fix table name

* Fix integration test

* Regenerate dialogflow client (#4928)

* Regenerate securitycenter client (#4929)

* Regenerate trace client (#4931)

* google-cloud-core: Optimize Date.parseDate(String) (#4920)

* optimized date parsing

Date parsing using a regular expression is slower than a specific
implementation for the only format that is supported.

* removed IntParser and added test cases

* check for invalid date/year/month/day

* Spanner: Refactor SpannerImpl - Move TransactionRunnerImpl to separate file (#4896)

refactor SpannerImpl: move TransactionRunnerImpl to separate file

* Regenerate securitycenter client (#4937)

* storage: Un-Ignore testRotateFromCustomerEncryptionToKmsKeyWithCustomerEncryption (#4936)

* Adding support to custom ports on LocalDatastoreHelper (#4933) (#4935)

* Storage : Fix manage resumeable signedURL uploads. (#4874)

* commit for manage resumeable signedURL uploads #2462

* for manage resumeable signedURL uploads #2462

* fix comment

* fix ITStorageTest case written for upload using signURL

* fix format

* fix BlobWriteChannel constructor changes.

* fix signURL validation.

* fix format

* signurl rename to signedURL , firstnonnull check removed,signedURL validation with googleacessid and expires field also.

* signedURL validation with googleacessid and expires field also.

* fix forsignedURL validation with V4 Signing support.

* fix forproviding example of writing content using signedURL through Writer.

* fix forStorageRpc open method argument change.

* fix forStorageRpc open method doc comment changes.

* cloud-storage-contrib-nio: Add support for newFileChannel (#4718)

add support for newFileChannel(...)

* Change MessageDispatcher to be synchronous instead of asynchronous. (#4916)

* Change MessageDispatcher to be synchronous instead of asynchronous.

This removes the failure mode described in #2452 that can occur when MaxOutstandingElementCount is low and there is more than one connection.  In this case, it is possible for an individual MessageDispatcher to have no outstanding in-flight messages, but also be blocked by flow control with a whole new batch outstanding. In this case, it will never make progress on that batch since it will never receive another batch and the queue was made to not be shared in  #4590, so the batch will never be pulled off by another MessageDispatcher.

By changing this to use a blocking flow controller, this will never happen, as each batch will synchronously wait until it is allowed by flow control before being processed.

* Run mvn com.coveo:fmt-maven-plugin:format

* Remove unused code
…/google-cloud-java into pubsub-ordering-keys
* Refactoring SequentialExecutorService

Step 1:
- create a `CallbackExecutor` and `AutoExecutor` as subclasses of SequentialExecutor.

* Adding CallbackExecutor.submit() for encapsulation

* Moving resume into `CallbackExecutor`

* create an abstract class for execute(key, deque)
This removest the last bit of code that directly used the TaskCompleteAction enum.
- Marking methods as private
- renaming variables from `finalTasks` to `tasks` for clarity
- reducing code duplication by calling `execute`
* Adding comments to CallbackExecutor.submit

* Fixing the merge
- Moving common async code into a new method: `callNextTaskAsync()`
- Adding a `postTaskExecution()` method which is useful for `AutoExecutor`
1. Removing the `Deque` parameter from `SequentialExecutorService.callNextTaskAsync()` and looking it up the `Deque` in the method
2. Simplify `AutoExecutor` and `CallbackExecutor` after the refactoring in 1).
Queues are FIFO, Deque don't guaratee which end the value is removed from.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 2, 2019
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label May 9, 2019
@sduskis sduskis added needs work This is a pull request that needs a little love. and removed 🚨 This issue needs some love. labels May 10, 2019
@codecov
Copy link

codecov bot commented May 13, 2019

Codecov Report

Merging #5055 into master will increase coverage by 0.02%.
The diff coverage is 89.24%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5055      +/-   ##
============================================
+ Coverage     50.82%   50.84%   +0.02%     
- Complexity    24173    24185      +12     
============================================
  Files          2271     2272       +1     
  Lines        229906   230039     +133     
  Branches      25005    25025      +20     
============================================
+ Hits         116841   116962     +121     
- Misses       104434   104437       +3     
- Partials       8631     8640       +9
Impacted Files Coverage Δ Complexity Δ
.../com/google/cloud/pubsub/v1/MessageDispatcher.java 85.71% <60%> (-0.78%) 22 <0> (ø)
...ain/java/com/google/cloud/pubsub/v1/Publisher.java 90.07% <89.39%> (+0.94%) 35 <12> (+12) ⬆️
...gle/cloud/pubsub/v1/SequentialExecutorService.java 90.8% <90.8%> (ø) 0 <0> (?)

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 68de41e...3ea3dc9. Read the comment docs.

@sduskis sduskis added the api: pubsub Issues related to the Pub/Sub API. label May 13, 2019
@kamalaboulhosn
Copy link

@kimkyung-goog can you just verify that setting ordering keys in messages results in the messages being rejected by the Pub/Sub server for now? If that is true, then it is is safe to merge to master.

This will allow us to merge this branch into master.
@kimkyung-goog
Copy link

@kimkyung-goog can you just verify that setting ordering keys in messages results in the messages being rejected by the Pub/Sub server for now? If that is true, then it is is safe to merge to master.

Answered by email (since it contains some internal links)

- Removing EnumSet from Status codes
- Adding `@BetaApi` to `resumePublish`, and making it package private.
// TODO: if this is not an ordering keys scenario, will this do anything?
publishAllWithoutInflight();

// TODO: if this is an ordering keys scenario, is this safe without messagesBatchLock?
for (final OutstandingBatch batch : batchesToSend) {
logger.log(Level.FINER, "Scheduling a batch for immediate sending.");
executor.execute(

Choose a reason for hiding this comment

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

It seems that this execute() call was removed in the original implementation of ordering keys, but was added back when master is merged to this branch. Please see 3bdbf77#diff-c482c19af8c46aea82546fa17236dfd2

publishOutstandingBatch() should not be called by the executor here because it can reorder sequence of invoking the function. Inside publishOutstandingBatch(), we run an executor, a regular one for non-ordered messages and the sequential executor for ordered messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woops. I'll change it back. What do you think about moving the publish* methods inside the lock?

final OutstandingPublish outstandingPublish =
new OutstandingPublish(messageTransform.apply(message));
List<OutstandingBatch> batchesToSend;
messagesBatchLock.lock();
try {
// Check if the next message makes the current batch exceed the max batch byte size.

Choose a reason for hiding this comment

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

I think this comment can be removed now.

// TODO: if this is not an ordering keys scenario, will this do anything?
publishAllWithoutInflight();

// TODO: if this is an ordering keys scenario, is this safe without messagesBatchLock?
Copy link

@kimkyung-goog kimkyung-goog May 29, 2019

Choose a reason for hiding this comment

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

is this safe without messagesBatchLock?

Since we are assuming publish() for the same ordering key is not called by multiple threads, I think it would be safe without the lock. If users use multiple threads for publishing an ordering key, we cannot guarantee the order anyway. However, it is always possible that I am missing something. WDYT? (But, the executor below should still be removed. Please see my another comment below)

Choose a reason for hiding this comment

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

I don't think we are assuming this. People could call publish for the same ordering key from multiple threads. It just means that the order among those two messages can not be known by the publisher. It will still be established (and will in fact be established in the order in which they are sent from the publisher client to Cloud Pub/Sub.

Choose a reason for hiding this comment

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

Right, users can definitely use threads for the same ordering key if they want, and we should support it. I think what I wanted to say was that if a user calls publish() for the same ordering key concurrently using threads without a proper synchronization, then there is no ordering in that behavior anyway.
I actually looked into the code again, and I think I was wrong. We should get messagesBatchLock. Here is the scenario:
(1) By messagesBatch.add(outstandingPublish) at line #231, outstandingPublish is added to messages, and an old batch is returned.
(2) Before the returned batch is published, publishAllWithoutInflight() is called by the timer.
(3) publishAllWithoutInflight() publishes the message added to the current batch at (1). Now, the new message is published before the old batch is published.

if (batch.isEmpty()) {
it.remove();
} else if (key.isEmpty() || !sequentialExecutor.hasTasksInflight(key)) {
// TODO(kimkyung-goog): Do not release `messagesBatchLock` when publishing a batch. If

Choose a reason for hiding this comment

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

Sorry, I think this comment is confusing. Can you remove it? I think you already addressed the potential performance issue in the TODO comment below.

// while this function is running. This locking mechanism needs to be improved if it
// causes any performance degradation.

// TODO: Will this cause a performance problem for non-ordering keys scenarios?
Copy link

@kimkyung-goog kimkyung-goog May 29, 2019

Choose a reason for hiding this comment

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

Ah, your comment is for the non-ordering scenarios. Can you also add the potential performance issue related to locking mechanism here? We grab a lock for the entire batch before the for loop, which means no messages can be added when this function is running. One of the typical solutions might be getting a reader lock for the message batches before the for loop and getting a writer lock for each batch before calling publishOutstandingBatch(batch.popOutstandingBatch()).
I am not sure if this will make it better or even worse. It will probably depends on how many ordering keys are involved. Any ideas?

@sduskis sduskis closed this Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing. needs work This is a pull request that needs a little love.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants