net.spy.memcached.NodeLocator Java Examples

The following examples show how to use net.spy.memcached.NodeLocator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EVCacheNodeLocator.java    From EVCache with Apache License 2.0 5 votes vote down vote up
public NodeLocator getReadonlyCopy() {
    final TreeMap<Long, MemcachedNode> ketamaNaodes = new TreeMap<Long, MemcachedNode>(getKetamaNodes());
    final Collection<MemcachedNode> aNodes = new ArrayList<MemcachedNode>(allNodes.size());

    // Rewrite the values a copy of the map.
    for (Map.Entry<Long, MemcachedNode> me : ketamaNaodes.entrySet()) {
        me.setValue(new EVCacheMemcachedNodeROImpl(me.getValue()));
    }
    // Copy the allNodes collection.
    for (MemcachedNode n : allNodes) {
        aNodes.add(new EVCacheMemcachedNodeROImpl(n));
    }

    return new EVCacheNodeLocator(client, ketamaNaodes, aNodes, hashingAlgorithm, config);
}
 
Example #2
Source File: MemcachedConnectionFactory.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public NodeLocator createLocator(List<MemcachedNode> nodes) {
    return underlying.createLocator(nodes);
}
 
Example #3
Source File: MemcachedConnectionFactory.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Override
public NodeLocator createLocator(List<MemcachedNode> nodes) {
    return underlying.createLocator(nodes);
}
 
Example #4
Source File: EVCacheClient.java    From EVCache with Apache License 2.0 4 votes vote down vote up
public NodeLocator getNodeLocator() {
    return this.evcacheMemcachedClient.getNodeLocator();
}
 
Example #5
Source File: BaseConnectionFactory.java    From EVCache with Apache License 2.0 4 votes vote down vote up
public NodeLocator createLocator(List<MemcachedNode> list) {
    this.locator = new EVCacheNodeLocator(client, list,
            DefaultHashAlgorithm.KETAMA_HASH, new EVCacheKetamaNodeLocatorConfiguration(client));
    return locator;
}
 
Example #6
Source File: BaseAsciiConnectionFactory.java    From EVCache with Apache License 2.0 4 votes vote down vote up
public NodeLocator createLocator(List<MemcachedNode> list) {
    this.locator = new EVCacheNodeLocator(client, list, DefaultHashAlgorithm.KETAMA_HASH, new EVCacheKetamaNodeLocatorConfiguration(client));
    return locator;
}
 
Example #7
Source File: DIConnectionFactory.java    From EVCache with Apache License 2.0 4 votes vote down vote up
@Override
public NodeLocator createLocator(List<MemcachedNode> list) {
    this.locator = new EVCacheNodeLocator(client, list,  DefaultHashAlgorithm.KETAMA_HASH, new DIEVCacheKetamaNodeLocatorConfiguration(client, eurekaClient));
    return locator;
}
 
Example #8
Source File: DIAsciiConnectionFactory.java    From EVCache with Apache License 2.0 4 votes vote down vote up
@Override
public NodeLocator createLocator(List<MemcachedNode> list) {
    this.locator = new EVCacheNodeLocator(client, list,  DefaultHashAlgorithm.KETAMA_HASH, new DIEVCacheKetamaNodeLocatorConfiguration(client, eurekaClient));
    return locator;
}