Skip to content

Commit

Permalink
[BEAM-2863] Migrate away from deprecated methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecwik committed Jan 18, 2018
1 parent a8368a0 commit c708481
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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());
}
}
}

0 comments on commit c708481

Please sign in to comment.