/** * Create a new policy that wraps the provided child policy but only "forbids" hosts whose DC * belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCBlackList( LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, Predicates.not(hostDCPredicate(dcs, false))); }
/** * Create a new policy that wraps the provided child policy but only "allows" hosts whose DC * belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCWhiteList( LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, hostDCPredicate(dcs, true)); }
/** * Create a new policy that wraps the provided child policy but only "forbids" hosts * whose DC belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCBlackList(LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, Predicates.not(hostDCPredicate(dcs, false))); }
/** * Create a new policy that wraps the provided child policy but only "allows" hosts * whose DC belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCWhiteList(LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, hostDCPredicate(dcs, true)); }
/** * Create a new policy that wraps the provided child policy but only "allows" hosts * whose DC belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCWhiteList(LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, hostDCPredicate(dcs, true)); }
/** * Create a new policy that wraps the provided child policy but only "allows" hosts * whose DC belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCWhiteList(LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, hostDCPredicate(dcs, true)); }
/** * Create a new policy that wraps the provided child policy but only "forbids" hosts * whose DC belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCBlackList(LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, Predicates.not(hostDCPredicate(dcs, false))); }
/** * Create a new policy that wraps the provided child policy but only "forbids" hosts * whose DC belongs to the provided list. * * @param childPolicy the wrapped policy. * @param dcs the DCs. * @return the policy. */ public static HostFilterPolicy fromDCBlackList(LoadBalancingPolicy childPolicy, Iterable<String> dcs) { return new HostFilterPolicy(childPolicy, Predicates.not(hostDCPredicate(dcs, false))); }