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

Minor fix on the comments in Publisher.java #3501

Merged
merged 1 commit into from
Jul 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public ApiFuture<String> publish(PubsubMessage message) {
final OutstandingPublish outstandingPublish = new OutstandingPublish(publishResult, message);
messagesBatchLock.lock();
try {
// Check if the next message makes the batch exceed the current batch byte size.
// Check if the next message makes the current batch exceed the max batch byte size.
if (!messagesBatch.isEmpty()
&& hasBatchingBytes()
&& batchedBytes + messageSize >= getMaxBatchBytes()) {
Expand All @@ -212,8 +212,8 @@ && hasBatchingBytes()
batchedBytes = 0;
}

// Border case if the message to send is greater equals to the max batch size then can't be
// included in the current batch and instead sent immediately.
// Border case if the message to send is greater or equals to the max batch size then can't
// be included in the current batch and instead sent immediately.
if (!hasBatchingBytes() || messageSize < getMaxBatchBytes()) {
batchedBytes += messageSize;
messagesBatch.add(outstandingPublish);
Expand Down