use of com.linkedin.d2.balancer.util.hashing.RandomHash in project rest.li by linkedin.
the class DegraderLoadBalancerStrategyV3 method setConfig.
public void setConfig(DegraderLoadBalancerStrategyConfig config) {
_config = config;
String hashMethod = _config.getHashMethod();
Map<String, Object> hashConfig = _config.getHashConfig();
if (hashMethod == null || hashMethod.equals(HASH_METHOD_NONE)) {
_hashFunction = new RandomHash();
} else if (HASH_METHOD_URI_REGEX.equals(hashMethod)) {
_hashFunction = new URIRegexHash(hashConfig);
} else {
_log.warn("Unknown hash method {}, falling back to random", hashMethod);
_hashFunction = new RandomHash();
}
}
use of com.linkedin.d2.balancer.util.hashing.RandomHash in project rest.li by linkedin.
the class DegraderLoadBalancerStrategyV2_1 method setConfig.
public void setConfig(DegraderLoadBalancerStrategyConfig config) {
_config = config;
String hashMethod = _config.getHashMethod();
Map<String, Object> hashConfig = _config.getHashConfig();
if (hashMethod == null || hashMethod.equals(HASH_METHOD_NONE)) {
_hashFunction = new RandomHash();
} else if (HASH_METHOD_URI_REGEX.equals(hashMethod)) {
_hashFunction = new URIRegexHash(hashConfig);
} else {
_log.warn("Unknown hash method {}, falling back to random", hashMethod);
_hashFunction = new RandomHash();
}
}
use of com.linkedin.d2.balancer.util.hashing.RandomHash in project rest.li by linkedin.
the class DegraderLoadBalancerStrategyV2 method setConfig.
public void setConfig(DegraderLoadBalancerStrategyConfig config) {
_config = config;
String hashMethod = _config.getHashMethod();
Map<String, Object> hashConfig = _config.getHashConfig();
if (hashMethod == null || hashMethod.equals(HASH_METHOD_NONE)) {
_hashFunction = new RandomHash();
} else if (HASH_METHOD_URI_REGEX.equals(hashMethod)) {
_hashFunction = new URIRegexHash(hashConfig);
} else {
_log.warn("Unknown hash method {}, falling back to random", hashMethod);
_hashFunction = new RandomHash();
}
}
Aggregations