io.craft.atom.redis.DefaultShardedRedis Maven / Gradle / Ivy
package io.craft.atom.redis;
import io.craft.atom.redis.api.Redis;
import io.craft.atom.redis.api.ShardedRedis;
import io.craft.atom.redis.spi.Sharded;
import java.util.List;
import lombok.ToString;
/**
* @author mindwind
* @version 1.0, Jun 25, 2013
*/
@ToString(callSuper = true)
public class DefaultShardedRedis extends AbstractShardedRedis implements ShardedRedis {
public DefaultShardedRedis(List shards) {
this.sharded = new RedisMurmurHashSharded(shards);
}
public DefaultShardedRedis(Sharded sharded) {
this.sharded = sharded;
}
// ~ ---------------------------------------------------------------------------------------------------------
@Override
public List shards() {
return sharded.shards();
}
@Override
public Redis shard(String shardkey) {
return sharded.shard(shardkey);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy