HADOOP-14847. Remove Guava Supplier and change to java Supplier in AMRMClient and AMRMClientAysnc. (Bharat Viswanadham via Haibo Chen)

This commit is contained in:
Haibo Chen 2017-09-08 14:27:05 -07:00
parent a323f73bae
commit 8edc60531f
4 changed files with 10 additions and 10 deletions

View File

@ -20,6 +20,7 @@
import java.io.IOException;
import java.util.Collection;
import java.util.function.Supplier;
import java.util.List;
import org.apache.commons.logging.Log;
@ -45,7 +46,6 @@
import org.apache.hadoop.yarn.util.resource.Resources;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
@InterfaceAudience.Public
@ -702,8 +702,8 @@ public TimelineV2Client getRegisteredTimelineV2Client() {
/**
* Wait for <code>check</code> to return true for each 1000 ms.
* See also {@link #waitFor(com.google.common.base.Supplier, int)}
* and {@link #waitFor(com.google.common.base.Supplier, int, int)}
* See also {@link #waitFor(java.util.function.Supplier, int)}
* and {@link #waitFor(java.util.function.Supplier, int, int)}
* @param check the condition for which it should wait
*/
public void waitFor(Supplier<Boolean> check) throws InterruptedException {
@ -713,7 +713,7 @@ public void waitFor(Supplier<Boolean> check) throws InterruptedException {
/**
* Wait for <code>check</code> to return true for each
* <code>checkEveryMillis</code> ms.
* See also {@link #waitFor(com.google.common.base.Supplier, int, int)}
* See also {@link #waitFor(java.util.function.Supplier, int, int)}
* @param check user defined checker
* @param checkEveryMillis interval to call <code>check</code>
*/

View File

@ -22,6 +22,7 @@
import java.util.Collection;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -52,7 +53,6 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
/**
* <code>AMRMClientAsync</code> handles communication with the ResourceManager
@ -375,8 +375,8 @@ public abstract void updateBlacklist(List<String> blacklistAdditions,
/**
* Wait for <code>check</code> to return true for each 1000 ms.
* See also {@link #waitFor(com.google.common.base.Supplier, int)}
* and {@link #waitFor(com.google.common.base.Supplier, int, int)}
* See also {@link #waitFor(java.util.function.Supplier, int)}
* and {@link #waitFor(java.util.function.Supplier, int, int)}
* @param check the condition for which it should wait
*/
public void waitFor(Supplier<Boolean> check) throws InterruptedException {
@ -386,7 +386,7 @@ public void waitFor(Supplier<Boolean> check) throws InterruptedException {
/**
* Wait for <code>check</code> to return true for each
* <code>checkEveryMillis</code> ms.
* See also {@link #waitFor(com.google.common.base.Supplier, int, int)}
* See also {@link #waitFor(java.util.function.Supplier, int, int)}
* @param check user defined checker
* @param checkEveryMillis interval to call <code>check</code>
*/

View File

@ -34,6 +34,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -62,7 +63,6 @@
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import com.google.common.base.Supplier;
public class TestAMRMClientAsync {

View File

@ -33,6 +33,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.function.Supplier;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@ -88,7 +89,6 @@
import org.mockito.stubbing.Answer;
import org.eclipse.jetty.util.log.Log;
import com.google.common.base.Supplier;
/**
* Test application master client class to resource manager.