Created December 23, 2015 20:41
-
-
Save tbarbugli/a02a78ff7aa2886a7c13 to your computer and use it in GitHub Desktop.
Revisions
-
tbarbugli created this gist
Dec 23, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ from cassandra.policies import DCAwareRoundRobinPolicy from cassandra.policies import HostDistance from IPy import IP class LocalNetworkDCAwareRoundRobinPolicy(DCAwareRoundRobinPolicy): def distance(self, host): host_distance = super(LocalNetworkDCAwareRoundRobinPolicy, self).distance(host) if IP(host.address).iptype() == 'PUBLIC': return HostDistance.IGNORED return host_distance