Search in sources :

Example 1 with LocalityLbEndpoints

use of io.envoyproxy.envoy.config.endpoint.v3.LocalityLbEndpoints in project grpc-java by grpc.

the class FakeControlPlaneXdsIntegrationTest method eds.

private static ClusterLoadAssignment eds(String hostName, int port) {
    Address address = Address.newBuilder().setSocketAddress(SocketAddress.newBuilder().setAddress(hostName).setPortValue(port).build()).build();
    LocalityLbEndpoints endpoints = LocalityLbEndpoints.newBuilder().setLoadBalancingWeight(UInt32Value.of(10)).setPriority(0).addLbEndpoints(LbEndpoint.newBuilder().setEndpoint(Endpoint.newBuilder().setAddress(address).build()).setHealthStatus(HealthStatus.HEALTHY).build()).build();
    return ClusterLoadAssignment.newBuilder().setClusterName(edsName).addEndpoints(endpoints).build();
}
Also used : Address(io.envoyproxy.envoy.config.core.v3.Address) InetSocketAddress(java.net.InetSocketAddress) SocketAddress(io.envoyproxy.envoy.config.core.v3.SocketAddress) LocalityLbEndpoints(io.envoyproxy.envoy.config.endpoint.v3.LocalityLbEndpoints)

Aggregations

Address (io.envoyproxy.envoy.config.core.v3.Address)1 SocketAddress (io.envoyproxy.envoy.config.core.v3.SocketAddress)1 LocalityLbEndpoints (io.envoyproxy.envoy.config.endpoint.v3.LocalityLbEndpoints)1 InetSocketAddress (java.net.InetSocketAddress)1