Skip to content

Commit

Permalink
Merge pull request #116 from dsyzhu/app
Browse files Browse the repository at this point in the history
Upgrade guava to 24.1.1
  • Loading branch information
dsyzhu authored Jul 1, 2020
2 parents 737fcd4 + d1290b3 commit 935ae9d
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>24.1.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
Expand Down
2 changes: 1 addition & 1 deletion yqlplus_engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>24.1.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
Expand All @@ -25,8 +26,11 @@
import com.yahoo.yqlplus.engine.internal.scope.ScopedTracingExecutor;

import javax.inject.Named;

import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledExecutorService;
Expand Down Expand Up @@ -214,8 +218,10 @@ public ListenableFuture<Object> fork(Callable<Object> target) {

@Override
public ListenableFuture<Object> forkAsync(Callable<ListenableFuture<Object>> target) {
return Futures.dereference(tasks.submit(target));
return Futures.transformAsync(tasks.submit(target), (AsyncFunction) DEREFERENCER);
}
};
}
private static final AsyncFunction<ListenableFuture<Object>, Object> DEREFERENCER =
input -> input;
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void run() {
source.cancel(true);
}
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.newDirectExecutorService());
Futures.addCallback(source, new FutureCallback<T>() {
@Override
public void onSuccess(T out) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static <ROW, SEQUENCE extends Iterable<ROW>, KEY> ListenableFuture<List<R
public void run() {
childTracer.end();
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.newDirectExecutorService());
}
}
ListenableFuture<List<SEQUENCE>> gather = Futures.allAsList(results);
Expand Down Expand Up @@ -242,7 +242,7 @@ public static <ROW, SEQUENCE extends Iterable<ROW>, SET> ListenableFuture<List<R
public void run() {
childTracer.end();
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.newDirectExecutorService());
ListenableFuture<List<SEQUENCE>> gather = Futures.allAsList(results);
return handler.withTimeout(gatherResults(executor, gather, 1), timeout.verify(), timeout.getTickUnits());
}
Expand Down Expand Up @@ -274,7 +274,7 @@ public static <ROW, SEQUENCE extends Iterable<ROW>, SET> ListenableFuture<List<R
public void run() {
childTracer.end();
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.newDirectExecutorService());
methodArgs = Lists.newArrayList();
}
}
Expand Down Expand Up @@ -319,7 +319,7 @@ public static <ROW, SEQUENCE extends Iterable<ROW>, SET> ListenableFuture<List<R
public void run() {
childTracer.end();
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.newDirectExecutorService());
}
}
final ListenableFuture<List<SEQUENCE>> gather = Futures.allAsList(results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void run() {
source.cancel(true);
}
}
}, MoreExecutors.sameThreadExecutor());
}, MoreExecutors.newDirectExecutorService());
Futures.addCallback(source, new FutureCallback<T>() {
@Override
public void onSuccess(T out) {
Expand Down
2 changes: 1 addition & 1 deletion yqlplus_language/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>24.1.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
2 changes: 1 addition & 1 deletion yqlplus_source_api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>24.1.1-jre</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.google.common.collect.Sets;
import com.google.common.hash.Hasher;

import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -59,7 +60,7 @@ protected final Object getAnnotation(String name) {

@Override
public Iterator<Map.Entry<String, Object>> iterator() {
return Iterators.emptyIterator();
return Collections.emptyIterator();
}
};

Expand Down

0 comments on commit 935ae9d

Please sign in to comment.