Beispiel #1
0
    public static Task <ServerInfo?> GetServerInfoAsync(
        this IKuduConnectionFactory connectionFactory,
        TSInfoPB tsInfo)
    {
        string uuid      = tsInfo.PermanentUuid.ToStringUtf8();
        string location  = tsInfo.Location;
        var    addresses = tsInfo.RpcAddresses;

        if (addresses.Count == 0)
        {
            // Received a tablet server with no addresses.
            return(Task.FromResult <ServerInfo?>(null));
        }

        // TODO: if the TS advertises multiple host/ports, pick the right one
        // based on some kind of policy. For now just use the first always.
        var hostPort = addresses[0].ToHostAndPort();

        return(connectionFactory.GetTabletServerInfoAsync(hostPort, uuid, location) !);
    }
 public Task <ServerInfo> GetTabletServerInfoAsync(
     HostAndPort hostPort, string uuid, string location, CancellationToken cancellationToken = default)
 {
     return(_realConnectionFactory.GetTabletServerInfoAsync(hostPort, uuid, location, cancellationToken));
 }