Skip to content

Commit 35bd4e6

Browse files
author
Tony Cui
committed
Fix lint
1 parent 2519a90 commit 35bd4e6

6 files changed

Lines changed: 9 additions & 15 deletions

File tree

java-pubsub/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/CancellationSharer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@
2020
import com.google.api.core.ApiFuture;
2121
import com.google.api.core.ApiFutureCallback;
2222
import com.google.api.core.ApiFutures;
23-
import com.google.api.gax.rpc.ApiException;
2423
import com.google.common.util.concurrent.MoreExecutors;
2524
import com.google.pubsub.v1.PublishResponse;
2625
import java.util.HashMap;
2726
import java.util.Map;
28-
import java.util.concurrent.atomic.AtomicBoolean;
2927
import java.util.concurrent.locks.Lock;
3028
import java.util.concurrent.locks.ReentrantLock;
3129

@@ -53,7 +51,9 @@ private void cleanupLocked() {
5351
}
5452

5553
CancellationSharer(
56-
final Publisher.OutstandingBatch batch, final Publisher publisher, final long absoluteDeadlineMs) {
54+
final Publisher.OutstandingBatch batch,
55+
final Publisher publisher,
56+
final long absoluteDeadlineMs) {
5757
this.batch = batch;
5858
this.publisher = publisher;
5959
this.absoluteDeadlineMs = absoluteDeadlineMs;

java-pubsub/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/OpenTelemetryPubsubTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void endPublishBatchingSpan(PubsubMessageWrapper message) {
189189
* Creates, starts, and returns a publish RPC span for the given message batch. Bi-directional
190190
* links with the publisher parent span are created for sampled messages in the batch.
191191
*
192-
* Note: Hedged publish attempts do not create distinct publish RPC spans. Instead, we rely on
192+
* <p>Note: Hedged publish attempts do not create distinct publish RPC spans. Instead, we rely on
193193
* the hedged publish start and end events on each message.
194194
*/
195195
Span startPublishRpcSpan(TopicName topicName, List<PubsubMessageWrapper> messages) {

java-pubsub/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import com.google.cloud.pubsub.v1.stub.PublisherStubSettings;
5050
import com.google.common.annotations.VisibleForTesting;
5151
import com.google.common.base.Preconditions;
52-
import com.google.common.collect.ImmutableMap;
5352
import com.google.common.collect.ImmutableSet;
5453
import com.google.protobuf.CodedOutputStream;
5554
import com.google.pubsub.v1.PublishRequest;
@@ -569,15 +568,13 @@ private ApiFuture<PublishResponse> publishCall(
569568
for (PubsubMessageWrapper messageWrapper : messageWrappers) {
570569
if (attemptNumber == 0) {
571570
tracer.endPublishBatchingSpan(messageWrapper);
572-
}
573-
else{
571+
} else {
574572
tracer.addHedgedPublishStartEvent(messageWrapper);
575573
}
576574
pubsubMessagesList.add(messageWrapper.getPubsubMessage());
577575
}
578576

579-
outstandingBatch.publishRpcSpan =
580-
tracer.startPublishRpcSpan(topicNameObject, messageWrappers);
577+
outstandingBatch.publishRpcSpan = tracer.startPublishRpcSpan(topicNameObject, messageWrappers);
581578

582579
return publisherStub
583580
.publishCallable()

java-pubsub/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/PubsubMessageWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ void setSubscribeProcessSpan(Span span) {
186186
/** Creates a publish start event that is tied to the publish RPC span time. */
187187
void addPublishStartEvent() {
188188
if (publisherSpan != null) {
189-
publisherSpan.addEvent(PUBLISH_START_EVENT);
189+
publisherSpan.addEvent(PUBLISH_START_EVENT);
190190
}
191191
}
192192

193193
/** Creates a hedged publish start event on the publisher span. */
194194
void addHedgedPublishStartEvent() {
195195
if (publisherSpan != null) {
196-
publisherSpan.addEvent(HEDGED_PUBLISH_START_EVENT);
196+
publisherSpan.addEvent(HEDGED_PUBLISH_START_EVENT);
197197
}
198198
}
199199

java-pubsub/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/OpenTelemetryTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ public void testHedgedPublishSpanEvents() {
670670
OpenTelemetryPubsubTracer tracer = new OpenTelemetryPubsubTracer(openTelemetryTracer, true);
671671

672672
// Start Publisher span
673-
tracer.startPublisherSpan(messageWrapper);
673+
tracer.startPublisherSpan(messageWrapper);
674674

675675
// Original Attempt 0 (creates RPC span and emits initial publish start event)
676676
Span publishRpcSpan1 = tracer.startPublishRpcSpan(FULL_TOPIC_NAME, messageWrappers);
@@ -682,7 +682,6 @@ public void testHedgedPublishSpanEvents() {
682682
// End Publisher span
683683
tracer.endPublisherSpan(messageWrapper, true);
684684

685-
686685
List<SpanData> allSpans = openTelemetryTesting.getSpans();
687686
// 2 Spans: publishRpcSpan1, publisherSpan
688687
assertEquals(2, allSpans.size());

java-pubsub/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import com.google.api.gax.rpc.DataLossException;
3737
import com.google.api.gax.rpc.FixedTransportChannelProvider;
3838
import com.google.api.gax.rpc.InvalidArgumentException;
39-
import com.google.api.gax.rpc.PermissionDeniedException;
4039
import com.google.api.gax.rpc.TransportChannelProvider;
4140
import com.google.cloud.pubsub.v1.Publisher.Builder;
4241
import com.google.protobuf.ByteString;
@@ -1707,7 +1706,6 @@ public void testPermanentErrorOnHedgedAttemptDiscarded() throws Exception {
17071706
shutdownTestPublisher(publisher);
17081707
}
17091708

1710-
17111709
private Builder getTestPublisherBuilder() {
17121710
return Publisher.newBuilder(TEST_TOPIC)
17131711
.setExecutorProvider(FixedExecutorProvider.create(fakeExecutor))

0 commit comments

Comments
 (0)