public class EC2MultiRegionAddressTranslator extends Object implements AddressTranslator
AddressTranslatorimplementation for a multi-region EC2 deployment where clients are also deployed in EC2.
Its distinctive feature is that it translates addresses according to the location of the Cassandra host:
Implementation note: this class performs a reverse DNS lookup of the origin address, to find the domain name of the target instance. Then it performs a forward DNS lookup of the domain name; the EC2 DNS does the private/public switch automatically based on location.
|Constructor and Description|
|Modifier and Type||Method and Description|
Initializes this address translator.
Translates a Cassandra
public void init(Cluster cluster)
public InetSocketAddress translate(InetSocketAddress socketAddress)
rpc_addressto another address if necessary.
socketAddress- the address of a node as returned by Cassandra. Note that if the
rpc_addressof a node has been configured to
0.0.0.0server side, then the provided address will be the node
0.0.0.0. Also note that the port for
InetSocketAddresswill always be the one set at Cluster construction time (9042 by default).
address. If the return is
addresswill be used by the driver (it is thus equivalent to returning
Copyright © 2012–2018. All rights reserved.