[mini-cluster] allow using aliases instead of addresses in EMC

This patch adds a configuration to ExternalMiniClusters to allow masters
and tablet servers to use and broadcast an alias instead of a bound
address. This is useful to simulate the default deployment where the
configuration of --rpc_bind_addresses results in servers broadcasting
their FQDN instead of a bound address.

This entails a couple things:
- The EMC may now use the --dns_addr_resolution_override flag to map
  aliases to the reserved addresses.
- Previously we used Sockaddrs internally and converted them to
  HostPorts to pass around to various functions for remote callers to
  resolve (e.g. TServers pass these to Masters and Masters would
  resolve the HostPort to communicate with TServers). Since the
  HostPorts need to be resolvable remotely, wildcards would be
  substituted with the FQDN. In ExternalMiniClusters, we don't bind to
  the wildcard, but we still need to allow a server to broadcast its
  alias in lieu of an FQDN. A new --host_for_test is added for this
  purpose; all ExternalMasters and ExternalTabletServers set this when
  the configured to use aliases.
  - This also refactors our current Sockaddr-to-HostPort conversions to:
    1) fetch HostPorts directly at call-sites, rather than getting
       Sockaddrs and doing a conversion, and
    2) also account for --host_for_test.

NOTE: this mini-cluster aliasing is compatible with the existing
--rpc_listen_on_unix_domain_socket flag. Client processes need only set
--host_for_test, and whatever server has the same --host_for_test will
treat that client as local and communicate over a UNIX socket.

A test is added that exercises this new functionality.

Change-Id: I09a22636748a13f282406119b52021184d92a76f
Reviewed-on: http://gerrit.cloudera.org:8080/17850
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Tested-by: Kudu Jenkins
17 files changed