Skip to content

Commit fe15cdf

Browse files
author
Gabor Bota
committed
HADOOP-16210. Update guava to 27.0-jre in hadoop-project trunk
1 parent 53a86e2 commit fe15cdf

File tree

10 files changed

+28
-20
lines changed

10 files changed

+28
-20
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public void onFailure(Throwable t) {
375375
backgroundRefreshException.incrementAndGet();
376376
backgroundRefreshRunning.decrementAndGet();
377377
}
378-
});
378+
}, MoreExecutors.directExecutor());
379379
return listenableFuture;
380380
}
381381

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/order/LocalResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private Map<String, String> getNamenodesSubcluster(
196196
try {
197197
String nsId = nn.getNameserviceId();
198198
String rpcAddress = nn.getRpcAddress();
199-
String hostname = HostAndPort.fromString(rpcAddress).getHostText();
199+
String hostname = HostAndPort.fromString(rpcAddress).getHost();
200200
ret.put(hostname, nsId);
201201
if (hostname.equals(localHostname)) {
202202
ret.put(localIp, nsId);

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public void onFailure(Throwable t) {
447447
public void onSuccess(Void t) {
448448
unreserveQueueSpace(data.length);
449449
}
450-
});
450+
}, MoreExecutors.directExecutor());
451451
}
452452
}
453453
return ret;

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumCall.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.concurrent.TimeoutException;
2323
import java.util.concurrent.TimeUnit;
2424

25+
import com.google.common.util.concurrent.MoreExecutors;
2526
import org.apache.hadoop.ipc.RemoteException;
2627
import org.apache.hadoop.util.StopWatch;
2728
import org.apache.hadoop.util.Timer;
@@ -80,7 +81,7 @@ public void onFailure(Throwable t) {
8081
public void onSuccess(RESULT res) {
8182
qr.addResult(e.getKey(), res);
8283
}
83-
});
84+
}, MoreExecutors.directExecutor());
8485
}
8586
return qr;
8687
}

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/DatasetVolumeChecker.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.common.util.concurrent.FutureCallback;
2525
import com.google.common.util.concurrent.Futures;
2626
import com.google.common.util.concurrent.ListenableFuture;
27+
import com.google.common.util.concurrent.MoreExecutors;
2728
import com.google.common.util.concurrent.ThreadFactoryBuilder;
2829
import org.apache.hadoop.conf.Configuration;
2930
import org.apache.hadoop.hdfs.DFSConfigKeys;
@@ -224,12 +225,12 @@ public Set<FsVolumeSpi> checkAllVolumes(
224225
Futures.addCallback(olf.get(),
225226
new ResultHandler(reference, healthyVolumes, failedVolumes,
226227
numVolumes, new Callback() {
227-
@Override
228-
public void call(Set<FsVolumeSpi> ignored1,
229-
Set<FsVolumeSpi> ignored2) {
230-
latch.countDown();
231-
}
232-
}));
228+
@Override
229+
public void call(Set<FsVolumeSpi> ignored1,
230+
Set<FsVolumeSpi> ignored2) {
231+
latch.countDown();
232+
}
233+
}), MoreExecutors.directExecutor());
233234
} else {
234235
IOUtils.cleanup(null, reference);
235236
if (numVolumes.decrementAndGet() == 0) {

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/ThrottledAsyncChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void onFailure(@Nonnull Throwable t) {
182182
t, timer.monotonicNow()));
183183
}
184184
}
185-
});
185+
}, MoreExecutors.directExecutor());
186186
}
187187

188188
/**

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/checker/TestThrottledAsyncCheckerTimeout.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.common.util.concurrent.FutureCallback;
2121
import com.google.common.util.concurrent.Futures;
2222
import com.google.common.util.concurrent.ListenableFuture;
23+
import com.google.common.util.concurrent.MoreExecutors;
2324
import org.apache.hadoop.util.FakeTimer;
2425
import org.junit.Before;
2526
import org.junit.Rule;
@@ -101,7 +102,7 @@ public void onFailure(Throwable t) {
101102
numCallbackInvocationsFailure.incrementAndGet();
102103
callbackResult.set(true);
103104
}
104-
});
105+
}, MoreExecutors.directExecutor());
105106

106107
while (!callbackResult.get()) {
107108
// Wait for the callback
@@ -133,7 +134,8 @@ public void testDiskCheckTimeoutInvokesOneCallbackOnly() throws Exception {
133134
.schedule(target, true);
134135

135136
assertTrue(olf1.isPresent());
136-
Futures.addCallback(olf1.get(), futureCallback);
137+
Futures.addCallback(olf1.get(), futureCallback,
138+
MoreExecutors.directExecutor());
137139

138140
// Verify that timeout results in only 1 onFailure call and 0 onSuccess
139141
// calls.
@@ -149,7 +151,8 @@ public void testDiskCheckTimeoutInvokesOneCallbackOnly() throws Exception {
149151
.schedule(target, true);
150152

151153
assertTrue(olf2.isPresent());
152-
Futures.addCallback(olf2.get(), futureCallback);
154+
Futures.addCallback(olf2.get(), futureCallback,
155+
MoreExecutors.directExecutor());
153156

154157
// Verify that normal check (dummy) results in only 1 onSuccess call.
155158
// Number of times onFailure is invoked should remain the same i.e. 1.
@@ -187,7 +190,7 @@ public void onFailure(Throwable t) {
187190
throwable[0] = t;
188191
callbackResult.set(true);
189192
}
190-
});
193+
}, MoreExecutors.directExecutor());
191194

192195
while (!callbackResult.get()) {
193196
// Wait for the callback

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/LocatedFileStatusFetcher.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public Iterable<FileStatus> getFileStatuses() throws InterruptedException,
120120
runningTasks.incrementAndGet();
121121
ListenableFuture<ProcessInitialInputPathCallable.Result> future = exec
122122
.submit(new ProcessInitialInputPathCallable(p, conf, inputFilter));
123-
Futures.addCallback(future, processInitialInputPathCallback);
123+
Futures.addCallback(future, processInitialInputPathCallback,
124+
MoreExecutors.directExecutor());
124125
}
125126

126127
runningTasks.decrementAndGet();
@@ -267,7 +268,8 @@ public void onSuccess(ProcessInputDirCallable.Result result) {
267268
ListenableFuture<ProcessInputDirCallable.Result> future = exec
268269
.submit(new ProcessInputDirCallable(result.fs, fileStatus,
269270
recursive, inputFilter));
270-
Futures.addCallback(future, processInputDirCallback);
271+
Futures.addCallback(future, processInputDirCallback,
272+
MoreExecutors.directExecutor());
271273
}
272274
}
273275
decrementRunningAndCheckCompletion();
@@ -353,7 +355,8 @@ public void onSuccess(ProcessInitialInputPathCallable.Result result) {
353355
ListenableFuture<ProcessInputDirCallable.Result> future = exec
354356
.submit(new ProcessInputDirCallable(result.fs, matched,
355357
recursive, inputFilter));
356-
Futures.addCallback(future, processInputDirCallback);
358+
Futures.addCallback(future, processInputDirCallback,
359+
MoreExecutors.directExecutor());
357360
}
358361
}
359362
decrementRunningAndCheckCompletion();

hadoop-project/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<spotbugs.version>3.1.0-RC1</spotbugs.version>
9393
<dnsjava.version>2.1.7</dnsjava.version>
9494

95-
<guava.version>11.0.2</guava.version>
95+
<guava.version>27.0-jre</guava.version>
9696
<guice.version>4.0</guice.version>
9797
<joda-time.version>2.9.9</joda-time.version>
9898

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ZookeeperUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static List<HostAndPort> splitToHostsAndPorts(String hostPortQuorumList)
8787
public static String buildHostsOnlyList(List<HostAndPort> hostAndPorts) {
8888
StringBuilder sb = new StringBuilder();
8989
for (HostAndPort hostAndPort : hostAndPorts) {
90-
sb.append(hostAndPort.getHostText()).append(",");
90+
sb.append(hostAndPort.getHost()).append(",");
9191
}
9292
if (sb.length() > 0) {
9393
sb.delete(sb.length() - 1, sb.length());

0 commit comments

Comments
 (0)