HADOOP-16581. Addendum: Remove use of Java 8 functionality. Contributed by Masatake Iwasaki.

This commit is contained in:
Erik Krogen 2019-09-23 08:06:15 -07:00
parent 44193ede8d
commit 0050f4363e
1 changed files with 12 additions and 7 deletions

View File

@ -32,6 +32,7 @@ import org.apache.hadoop.test.GenericTestUtils;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import com.google.common.base.Supplier;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
public class TestValueQueue { public class TestValueQueue {
@ -62,15 +63,19 @@ public class TestValueQueue {
} }
} }
private void waitForRefill(ValueQueue<?> valueQueue, String queueName, int queueSize) private void waitForRefill(final ValueQueue<?> valueQueue,
final String queueName, final int queueSize)
throws TimeoutException, InterruptedException { throws TimeoutException, InterruptedException {
GenericTestUtils.waitFor(() -> { GenericTestUtils.waitFor(new Supplier<Boolean>() {
int size = valueQueue.getSize(queueName); @Override
if (size != queueSize) { public Boolean get() {
LOG.info("Current ValueQueue size is " + size); int size = valueQueue.getSize(queueName);
return false; if (size != queueSize) {
LOG.info("Current ValueQueue size is " + size);
return false;
}
return true;
} }
return true;
}, 100, 3000); }, 100, 3000);
} }