use of com.linkedin.d2.balancer.URIMapper in project rest.li by linkedin.
the class TestRestLiScatterGather method getURIMapper.
private static URIMapper getURIMapper(boolean sticky, boolean partitioned, String regex) throws ServiceUnavailableException {
int partitionCount = partitioned ? 10 : 1;
int totalHostCount = 100;
HashRingProvider ringProvider = createStaticHashRingProvider(totalHostCount, partitionCount, getHashFunction(sticky));
PartitionInfoProvider infoProvider = createHashBasedPartitionInfoProvider(partitionCount, regex);
return new RingBasedUriMapper(ringProvider, infoProvider);
}
Aggregations