Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-2863] Migrate away from deprecated methods in Guava #4440

Merged
merged 1 commit into from Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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;
Expand Down Expand Up @@ -115,12 +115,8 @@ public Future<BeamFnApi.RegisterResponse> register(

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());
}

/**
Expand Down Expand Up @@ -164,12 +160,8 @@ public void accept(Object input) throws Exception {
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);
}
Expand Down
Expand Up @@ -58,7 +58,7 @@ public static SocketAddress createFrom(String value) {
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());
}
}
}