You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2018/01/18 20:06:15 UTC
[beam] branch master updated: [BEAM-2863] Migrate away from
deprecated methods.
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new c708481 [BEAM-2863] Migrate away from deprecated methods.
c708481 is described below
commit c708481bb15e7bc7113d843012a0960d9c829158
Author: Luke Cwik <lc...@google.com>
AuthorDate: Thu Jan 18 10:18:42 2018 -0800
[BEAM-2863] Migrate away from deprecated methods.
---
.../runners/fnexecution/control/SdkHarnessClient.java | 18 +++++-------------
.../beam/sdk/fn/channel/SocketAddressFactory.java | 2 +-
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/SdkHarnessClient.java b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/SdkHarnessClient.java
index efbfe19..fa51308 100644
--- a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/SdkHarnessClient.java
+++ b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/SdkHarnessClient.java
@@ -18,9 +18,9 @@
package org.apache.beam.runners.fnexecution.control;
import com.google.auto.value.AutoValue;
-import com.google.common.base.Function;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.beam.model.fnexecution.v1.BeamFnApi;
@@ -115,12 +115,8 @@ public class SdkHarnessClient {
return Futures.transform(
genericResponse,
- new Function<BeamFnApi.InstructionResponse, BeamFnApi.RegisterResponse>() {
- @Override
- public BeamFnApi.RegisterResponse apply(BeamFnApi.InstructionResponse input) {
- return input.getRegister();
- }
- });
+ input -> input.getRegister(),
+ MoreExecutors.directExecutor());
}
/**
@@ -164,12 +160,8 @@ public class SdkHarnessClient {
ListenableFuture<BeamFnApi.ProcessBundleResponse> specificResponse =
Futures.transform(
genericResponse,
- new Function<BeamFnApi.InstructionResponse, BeamFnApi.ProcessBundleResponse>() {
- @Override
- public BeamFnApi.ProcessBundleResponse apply(BeamFnApi.InstructionResponse input) {
- return input.getProcessBundle();
- }
- });
+ input -> input.getProcessBundle(),
+ MoreExecutors.directExecutor());
return ActiveBundle.create(bundleId, specificResponse, dataReceiver);
}
diff --git a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/SocketAddressFactory.java b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/SocketAddressFactory.java
index 090cc75..640931d 100644
--- a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/SocketAddressFactory.java
+++ b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/SocketAddressFactory.java
@@ -58,7 +58,7 @@ public class SocketAddressFactory {
HostAndPort hostAndPort = HostAndPort.fromString(value);
checkArgument(hostAndPort.hasPort(),
"Address must be a unix:// path or be in the form host:port. Got: %s", value);
- return new InetSocketAddress(hostAndPort.getHostText(), hostAndPort.getPort());
+ return new InetSocketAddress(hostAndPort.getHost(), hostAndPort.getPort());
}
}
}
--
To stop receiving notification emails like this one, please contact
['"commits@beam.apache.org" <co...@beam.apache.org>'].