From 7487e880732ba7b1f4311033acb063299b2c6480 Mon Sep 17 00:00:00 2001 From: Solomon Duskis Date: Thu, 18 Apr 2019 10:36:34 -0400 Subject: [PATCH] Fixng a bad merge. --- .../com/google/cloud/pubsub/v1/Publisher.java | 1 - .../pubsub/v1/SequentialExecutorService.java | 36 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java index d6a5ef56d744..c1f457a81fe0 100644 --- a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java +++ b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java @@ -344,7 +344,6 @@ private ApiFuture publishCall(OutstandingBatch outstandingBatch return publisherStub.publishCallable().futureCall(publishRequest.build()); } - private void publishOutstandingBatch(final OutstandingBatch outstandingBatch) { final ApiFutureCallback futureCallback = new ApiFutureCallback() { diff --git a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java index 61aabdbb1b1f..353b0ec2e293 100644 --- a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java +++ b/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java @@ -232,25 +232,25 @@ public void run() { } }); } - } - /** Cancels every task in the queue assoicated with {@code key}. */ - void cancelQueuedTasks(final String key, Throwable e) { - // TODO(kimkyung-goog): Ensure execute() fails once cancelQueueTasks() has been ever invoked, - // so that no more tasks are scheduled. - synchronized (tasksByKey) { - final Deque tasks = tasksByKey.get(key); - if (tasks == null) { - return; - } - while (!tasks.isEmpty()) { - Runnable task = tasks.poll(); - if (task instanceof CancellableRunnable) { - ((CancellableRunnable) task).cancel(e); - } else { - logger.log( - Level.WARNING, - "Attempted to cancel Runnable that was not CancellableRunnable; ignored."); + /** Cancels every task in the queue assoicated with {@code key}. */ + void cancelQueuedTasks(final String key, Throwable e) { + // TODO(kimkyung-goog): Ensure execute() fails once cancelQueueTasks() has been ever invoked, + // so that no more tasks are scheduled. + synchronized (tasksByKey) { + final Deque tasks = tasksByKey.get(key); + if (tasks == null) { + return; + } + while (!tasks.isEmpty()) { + Runnable task = tasks.poll(); + if (task instanceof CancellableRunnable) { + ((CancellableRunnable) task).cancel(e); + } else { + logger.log( + Level.WARNING, + "Attempted to cancel Runnable that was not CancellableRunnable; ignored."); + } } } }