Skip to content

Commit

Permalink
Merge pull request vitessio#1221 from yaoshengzhe/use_InetSocketAddre…
Browse files Browse the repository at this point in the history
…ss_in_RpcClientFactory

Use InetSocketAddress as function param in RpcClientFactory
  • Loading branch information
yaoshengzhe committed Oct 16, 2015
2 parents 646889d + 1fb9c7a commit 26d66e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.youtube.vitess.client;

import java.net.SocketAddress;
import java.net.InetSocketAddress;

/**
* RpcClientFactory creates a concrete RpcClient.
*/
public interface RpcClientFactory {
RpcClient create(Context ctx, SocketAddress address);
RpcClient create(Context ctx, InetSocketAddress address);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import io.grpc.netty.NegotiationType;
import io.grpc.netty.NettyChannelBuilder;

import java.net.SocketAddress;
import java.net.InetSocketAddress;

/**
* GrpcClientFactory creates RpcClients with the gRPC implemenation.
*/
public class GrpcClientFactory implements RpcClientFactory {
@Override
public RpcClient create(Context ctx, SocketAddress address) {
public RpcClient create(Context ctx, InetSocketAddress address) {
return new GrpcClient(
NettyChannelBuilder.forAddress(address).negotiationType(NegotiationType.PLAINTEXT).build());
}
Expand Down

0 comments on commit 26d66e5

Please sign in to comment.