Skip to content

Commit 1b01112

Browse files
authored
---
yaml --- r: 30717 b: refs/heads/autosynth-bigquerydatatransfer c: 3ec7a6f h: refs/heads/master i: 30715: d761553
1 parent 7683b98 commit 1b01112

10 files changed

Lines changed: 15 additions & 143 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ refs/tags/v0.68.0: 9cc799fcf68c82ab431d425fefa58ef615ce8e5b
122122
refs/tags/v0.69.0: 78f67a29e8b9c46ba01de566a2eae0fd1c03edea
123123
refs/heads/autosynth-asset: bdb45634a0fe8f7a510692b56b31f5312e25f453
124124
refs/heads/autosynth-automl: 22f9dd5b6f5df8dbfa7da0126864d565229519b2
125-
refs/heads/autosynth-bigquerydatatransfer: 902874ff124128a9bc4a27e2f43a5951c743215d
125+
refs/heads/autosynth-bigquerydatatransfer: 3ec7a6f3bae9be9b51e69e605982adbbec66b119
126126
refs/heads/autosynth-bigquerystorage: d2c53da3b012e38c662e4df0738042435f19365f
127127
refs/heads/autosynth-bigtable: 9e5429f45cf9face9fed585d0233534993e36b58
128128
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,7 @@ private static final class OutstandingBatch {
372372
this.batchSizeBytes = batchSizeBytes;
373373
}
374374

375-
public int getAttempt() {
376-
return attempt;
377-
}
378-
379-
public int size() {
375+
int size() {
380376
return outstandingPublishes.size();
381377
}
382378
}

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private Subscriber(Builder builder) {
149149
closeables.add(
150150
new AutoCloseable() {
151151
@Override
152-
public void close() throws IOException {
152+
public void close() {
153153
alarmsExecutor.shutdown();
154154
}
155155
});

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static void setupClass() throws Exception {
8080
}
8181

8282
@AfterClass
83-
public static void tearDownClass() throws Exception {
83+
public static void tearDownClass() {
8484
topicAdminClient.close();
8585
subscriptionAdminClient.close();
8686
}
@@ -114,7 +114,7 @@ public void testTopicPolicy() {
114114
}
115115

116116
@Test
117-
public void testVPCPushSubscriber() throws Exception {
117+
public void testVPCPushSubscriber() {
118118
assumeTrue(IS_VPC_TEST);
119119
ProjectTopicName topicName =
120120
ProjectTopicName.of(projectId, formatForTest("testing-vpc-push-subscriber-topic"));

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeScheduledExecutorService.java

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -86,35 +86,6 @@ public ScheduledFuture<?> scheduleWithFixedDelay(
8686
PendingCallableType.FIXED_DELAY));
8787
}
8888

89-
/**
90-
* This allows for adding expectations on future work to be scheduled ( {@link
91-
* FakeScheduledExecutorService#schedule} or {@link
92-
* FakeScheduledExecutorService#scheduleAtFixedRate} or {@link
93-
* FakeScheduledExecutorService#scheduleWithFixedDelay}) based on its delay.
94-
*/
95-
public void setupScheduleExpectation(Duration delay) {
96-
synchronized (expectedWorkQueue) {
97-
expectedWorkQueue.add(delay);
98-
}
99-
}
100-
101-
/**
102-
* Blocks the current thread until all the work {@link
103-
* FakeScheduledExecutorService#setupScheduleExpectation(Duration) expected} has been scheduled in
104-
* the executor.
105-
*/
106-
public void waitForExpectedWork() {
107-
synchronized (expectedWorkQueue) {
108-
while (!expectedWorkQueue.isEmpty()) {
109-
try {
110-
expectedWorkQueue.wait();
111-
} catch (InterruptedException e) {
112-
// Wait uninterruptibly
113-
}
114-
}
115-
}
116-
}
117-
11889
/**
11990
* This will advance the reference time of the executor and execute (in the same thread) any
12091
* outstanding callable which execution time has passed.
@@ -232,7 +203,7 @@ <V> ScheduledFuture<V> schedulePendingCallable(PendingCallable<V> callable) {
232203
return callable.getScheduledFuture();
233204
}
234205

235-
static enum PendingCallableType {
206+
enum PendingCallableType {
236207
NORMAL,
237208
FIXED_RATE,
238209
FIXED_DELAY
@@ -252,7 +223,7 @@ class PendingCallable<T> implements Comparable<PendingCallable<T>> {
252223
pendingCallable =
253224
new Callable<T>() {
254225
@Override
255-
public T call() throws Exception {
226+
public T call() {
256227
runnable.run();
257228
return null;
258229
}

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeSubscriberServiceImpl.java

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
package com.google.cloud.pubsub.v1;
1818

1919
import com.google.api.client.util.Preconditions;
20-
import com.google.api.core.InternalApi;
21-
import com.google.common.collect.ImmutableList;
2220
import com.google.protobuf.Empty;
2321
import com.google.pubsub.v1.AcknowledgeRequest;
2422
import com.google.pubsub.v1.GetSubscriptionRequest;
@@ -61,7 +59,7 @@ class FakeSubscriberServiceImpl extends SubscriberImplBase {
6159
private final BlockingQueue<PullResponse> pullResponses = new LinkedBlockingDeque<>();
6260
private int currentStream;
6361

64-
public static enum CloseSide {
62+
public enum CloseSide {
6563
SERVER,
6664
CLIENT
6765
}
@@ -76,10 +74,6 @@ public ModifyAckDeadline(String ackId, long seconds) {
7674
this.seconds = seconds;
7775
}
7876

79-
public String getAckId() {
80-
return ackId;
81-
}
82-
8377
public long getSeconds() {
8478
return seconds;
8579
}
@@ -207,23 +201,6 @@ public StreamObserver<StreamingPullRequest> streamingPull(
207201
return stream.requestObserver;
208202
}
209203

210-
public void sendStreamingResponse(StreamingPullResponse pullResponse)
211-
throws InterruptedException {
212-
waitForRegistedSubscription();
213-
synchronized (openedStreams) {
214-
waitForOpenedStreams(1);
215-
openedStreams.get(getAndAdvanceCurrentStream()).responseObserver.onNext(pullResponse);
216-
}
217-
}
218-
219-
public void setMessageAckDeadlineSeconds(int ackDeadline) {
220-
messageAckDeadline.set(ackDeadline);
221-
}
222-
223-
public void enqueuePullResponse(PullResponse response) {
224-
pullResponses.add(response);
225-
}
226-
227204
@Override
228205
public void getSubscription(
229206
GetSubscriptionRequest request, StreamObserver<Subscription> responseObserver) {
@@ -237,12 +214,6 @@ public void getSubscription(
237214
responseObserver.onCompleted();
238215
}
239216

240-
/** Returns the number of times getSubscription is called. */
241-
@InternalApi
242-
int getSubscriptionCalledCount() {
243-
return getSubscriptionCalled.get();
244-
}
245-
246217
@Override
247218
public void pull(PullRequest request, StreamObserver<PullResponse> responseObserver) {
248219
synchronized (receivedPullRequest) {
@@ -293,26 +264,6 @@ public String waitForRegistedSubscription() throws InterruptedException {
293264
return subscription;
294265
}
295266

296-
public List<String> waitAndConsumeReceivedAcks(int expectedCount) throws InterruptedException {
297-
synchronized (acks) {
298-
waitAtLeast(acks, expectedCount);
299-
List<String> receivedAcksCopy = ImmutableList.copyOf(acks.subList(0, expectedCount));
300-
acks.subList(0, expectedCount).clear();
301-
return receivedAcksCopy;
302-
}
303-
}
304-
305-
public List<ModifyAckDeadline> waitAndConsumeModifyAckDeadlines(int expectedCount)
306-
throws InterruptedException {
307-
synchronized (modAckDeadlines) {
308-
waitAtLeast(modAckDeadlines, expectedCount);
309-
List<ModifyAckDeadline> modAckDeadlinesCopy =
310-
ImmutableList.copyOf(modAckDeadlines.subList(0, expectedCount));
311-
modAckDeadlines.subList(0, expectedCount).clear();
312-
return modAckDeadlinesCopy;
313-
}
314-
}
315-
316267
public int waitForClosedStreams(int expectedCount) throws InterruptedException {
317268
synchronized (closedStreams) {
318269
waitAtLeast(closedStreams, expectedCount);
@@ -341,50 +292,6 @@ private static void waitAtLeast(Collection<?> collection, int target)
341292
}
342293
}
343294

344-
public void waitForStreamAckDeadline(int expectedValue) throws InterruptedException {
345-
synchronized (messageAckDeadline) {
346-
while (messageAckDeadline.get() != expectedValue) {
347-
messageAckDeadline.wait();
348-
}
349-
}
350-
}
351-
352-
public int getOpenedStreamsCount() {
353-
return openedStreams.size();
354-
}
355-
356-
public int getClosedStreamsCount() {
357-
return closedStreams.size();
358-
}
359-
360-
public List<String> getAcks() {
361-
return acks;
362-
}
363-
364-
public List<ModifyAckDeadline> getModifyAckDeadlines() {
365-
return modAckDeadlines;
366-
}
367-
368-
public void reset() {
369-
synchronized (subscriptionInitialized) {
370-
synchronized (openedStreams) {
371-
synchronized (acks) {
372-
synchronized (modAckDeadlines) {
373-
openedStreams.clear();
374-
closedStreams.clear();
375-
acks.clear();
376-
modAckDeadlines.clear();
377-
subscriptionInitialized.set(false);
378-
subscription = "";
379-
pullResponses.clear();
380-
receivedPullRequest.clear();
381-
currentStream = 0;
382-
}
383-
}
384-
}
385-
}
386-
}
387-
388295
private void addOpenedStream(Stream stream) {
389296
synchronized (openedStreams) {
390297
openedStreams.add(stream);

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MessageDispatcherTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void sendAckOperations(
123123
}
124124

125125
@Test
126-
public void testReceipt() throws Exception {
126+
public void testReceipt() {
127127
dispatcher.processReceivedMessages(Collections.singletonList(TEST_MESSAGE));
128128
dispatcher.processOutstandingAckOperations();
129129
assertThat(sentModAcks)
@@ -160,7 +160,7 @@ public void testExtension() throws Exception {
160160
}
161161

162162
@Test
163-
public void testExtension_Close() throws Exception {
163+
public void testExtension_Close() {
164164
dispatcher.processReceivedMessages(Collections.singletonList(TEST_MESSAGE));
165165
dispatcher.extendDeadlines();
166166
assertThat(sentModAcks)

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/OpenCensusUtilTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class OpenCensusUtilTest {
5656
// Verifies that trace contexts propagated as an attribute are set as the parent link in the
5757
// message receiver and that the tag context is not change (for now).
5858
@Test
59-
public void testOpenCensusMessageReceiver() throws Exception {
59+
public void testOpenCensusMessageReceiver() {
6060
PubsubMessage message;
6161
SpanContext publisherContext;
6262
try (Scope traceScope = OpenCensusUtil.createScopedSpan(TEST_PARENT_LINK_NAME);
@@ -143,7 +143,7 @@ private void assertSpanCount(int expected) {
143143
Stopwatch watch = Stopwatch.createStarted();
144144
while (true) {
145145
Collection<SpanData> spanDatas = runningSpanStore.getRunningSpans(RECEIVER_FILTER);
146-
if (spanDatas.size() == 1) {
146+
if (spanDatas.size() == expected) {
147147
break;
148148
}
149149
Thread.yield();

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public class PublisherImplTest {
6868

6969
private Server testServer;
7070

71-
class FakeException extends Exception {}
72-
7371
@Before
7472
public void setUp() throws Exception {
7573
testPublisherServiceImpl = new FakePublisherServiceImpl();
@@ -454,7 +452,7 @@ public void testBuilderInvalidArguments() {
454452
builder.setBatchingSettings(
455453
Publisher.Builder.DEFAULT_BATCHING_SETTINGS
456454
.toBuilder()
457-
.setRequestByteThreshold((Long) null)
455+
.setRequestByteThreshold(null)
458456
.build());
459457
fail("Should have thrown an NullPointerException");
460458
} catch (NullPointerException expected) {
@@ -513,7 +511,7 @@ public void testBuilderInvalidArguments() {
513511
builder.setBatchingSettings(
514512
Publisher.Builder.DEFAULT_BATCHING_SETTINGS
515513
.toBuilder()
516-
.setElementCountThreshold((Long) null)
514+
.setElementCountThreshold(null)
517515
.build());
518516
fail("Should have thrown an NullPointerException");
519517
} catch (NullPointerException expected) {

branches/autosynth-bigquerydatatransfer/google-cloud-clients/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriberTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void testFailedChannel_fatalError_subscriberFails() throws Exception {
140140
}
141141
}
142142

143-
private Subscriber startSubscriber(Builder testSubscriberBuilder) throws Exception {
143+
private Subscriber startSubscriber(Builder testSubscriberBuilder) {
144144
Subscriber subscriber = testSubscriberBuilder.build();
145145
subscriber.startAsync().awaitRunning();
146146
return subscriber;

0 commit comments

Comments
 (0)