|
@@ -31,6 +31,7 @@ import java.util.Collection;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
import javax.crypto.SecretKey;
|
|
|
import javax.net.ssl.HttpsURLConnection;
|
|
@@ -88,7 +89,7 @@ class Fetcher<K,V> extends Thread {
|
|
|
protected final ShuffleClientMetrics metrics;
|
|
|
protected final ExceptionReporter exceptionReporter;
|
|
|
protected final int id;
|
|
|
- private static int nextId = 0;
|
|
|
+ private static final AtomicInteger NEXT_ID = new AtomicInteger(0);
|
|
|
protected final int reduce;
|
|
|
|
|
|
private final int connectionTimeout;
|
|
@@ -115,7 +116,7 @@ class Fetcher<K,V> extends Thread {
|
|
|
Reporter reporter, ShuffleClientMetrics metrics,
|
|
|
ExceptionReporter exceptionReporter, SecretKey shuffleKey) {
|
|
|
this(job, reduceId, scheduler, merger, reporter, metrics,
|
|
|
- exceptionReporter, shuffleKey, ++nextId);
|
|
|
+ exceptionReporter, shuffleKey, NEXT_ID.incrementAndGet());
|
|
|
}
|
|
|
|
|
|
@VisibleForTesting
|