Skip to content
Permalink
Browse files

[SMALLFIX] Replace Anonymous Type with Lambda

replace anonymous type with lambda in
alluxio/core/server/proxy/src/main/java/alluxio/proxy/StreamsRestServiceHandler.java

pr-link: #8983
change-id: cid-23c896c96c9b71a06ffae24cfd361f7391808b09
  • Loading branch information...
Weifanzhao authored and alluxio-bot committed May 11, 2019
1 parent 151d12f commit ba1164fa24eaf333f2d8c223864082bf3c56b04e
Showing with 5 additions and 8 deletions.
  1. +5 −8 core/server/proxy/src/main/java/alluxio/proxy/StreamsRestServiceHandler.java
@@ -115,15 +115,12 @@ public InputStream call() throws Exception {
@ReturnType("java.lang.Long")
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response write(@PathParam("id") final Integer id, final InputStream is) {
return RestUtils.call(new RestUtils.RestCallable<Long>() {
@Override
public Long call() throws Exception {
FileOutStream os = mStreamCache.getOutStream(id);
if (os != null) {
return ByteStreams.copy(is, os);
}
throw new IllegalArgumentException("stream does not exist");
return RestUtils.call(() -> {
FileOutStream os = mStreamCache.getOutStream(id);
if (os != null) {
return ByteStreams.copy(is, os);
}
throw new IllegalArgumentException("stream does not exist");
}, ServerConfiguration.global());
}
}

0 comments on commit ba1164f

Please sign in to comment.
You can’t perform that action at this time.