Skip to content
Closed
Show file tree
Hide file tree
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 numberDiff line numberDiff line change
Expand Up@@ -602,7 +602,7 @@ static synchronized <T extends PipelineOptions> Registration<T> validateWellForm
COMBINED_CACHE.put(combinedPipelineOptionsInterfaces,
new Registration<T>(allProxyClass, propertyDescriptors));
} catch (IntrospectionException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}

Expand All@@ -617,7 +617,7 @@ static synchronized <T extends PipelineOptions> Registration<T> validateWellForm
INTERFACE_CACHE.put(iface,
new Registration<T>(proxyClass, propertyDescriptors));
} catch (IntrospectionException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,6 @@
import com.google.cloud.dataflow.sdk.values.PInput;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterators;
import com.google.common.collect.PeekingIterator;
Expand DownExpand Up@@ -75,7 +74,7 @@ public PCollection<T> apply(PInput input) {
try {
source = new InMemorySource<>(original.getElements(), elementCoder);
} catch (IOException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
PCollection<T> result = input.getPipeline().apply(Read.from(source));
result.setCoder(elementCoder);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

import com.google.cloud.dataflow.sdk.coders.Coder;
import com.google.cloud.dataflow.sdk.coders.CoderException;
import com.google.common.base.Throwables;

import java.util.Arrays;
import java.util.Objects;
Expand DownExpand Up@@ -113,7 +112,7 @@ public void verifyUnmodified() {
try {
verifyUnmodifiedThrowingCheckedExceptions();
} catch (CoderException exn) {
Throwables.propagate(exn);
throw new RuntimeException(exn);
}
}

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,8 +16,6 @@

package com.google.cloud.dataflow.sdk.testing;

import com.google.common.base.Throwables;

import org.junit.rules.ExternalResource;
import org.junit.rules.TestRule;

Expand DownExpand Up@@ -45,7 +43,7 @@ protected void after() {
System.getProperties().clear();
System.getProperties().load(bais);
} catch (IOException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
}
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,7 +52,6 @@
import com.google.cloud.dataflow.sdk.util.gcsfs.GcsPath;
import com.google.cloud.hadoop.gcsio.GoogleCloudStorageReadChannel;
import com.google.cloud.hadoop.util.ClientRequestHelper;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;

import org.junit.Rule;
Expand DownExpand Up@@ -141,20 +140,22 @@ public void testMultipleThreadsCanCompleteOutOfOrderWithDefaultThreadPool() thro
for (int i = 0; i < numThreads; i++) {
final int currentLatch = i;
countDownLatches[i] = new CountDownLatch(1);
executorService.execute(new Runnable() {
@Override
public void run() {
// Wait for latch N and then release latch N - 1
try {
countDownLatches[currentLatch].await();
if (currentLatch > 0) {
countDownLatches[currentLatch - 1].countDown();
executorService.execute(
new Runnable() {
@Override
public void run() {
// Wait for latch N and then release latch N - 1
try {
countDownLatches[currentLatch].await();
if (currentLatch > 0) {
countDownLatches[currentLatch - 1].countDown();
}
} catch (InterruptedException e) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add Thread.currentThread().interrupt() before the throws

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Done. (just below the diff)

Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
} catch (InterruptedException e) {
throw Throwables.propagate(e);
}
}
});
});
}

// Release the last latch starting the chain reaction.
Expand Down