|
|
|
@ -33,11 +33,14 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
|
import org.redisson.api.MapOptions;
|
|
|
|
|
import org.redisson.api.RCountDownLatch;
|
|
|
|
|
import org.redisson.api.MapOptions.WriteMode;
|
|
|
|
|
import org.redisson.api.RFuture;
|
|
|
|
|
import org.redisson.api.RLock;
|
|
|
|
|
import org.redisson.api.RMap;
|
|
|
|
|
import org.redisson.api.RPermitExpirableSemaphore;
|
|
|
|
|
import org.redisson.api.RReadWriteLock;
|
|
|
|
|
import org.redisson.api.RSemaphore;
|
|
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
|
|
import org.redisson.api.mapreduce.RMapReduce;
|
|
|
|
|
import org.redisson.client.RedisClient;
|
|
|
|
@ -106,7 +109,31 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
|
|
|
|
|
public <KOut, VOut> RMapReduce<K, V, KOut, VOut> mapReduce() {
|
|
|
|
|
return new RedissonMapReduce<K, V, KOut, VOut>(this, redisson, commandExecutor.getConnectionManager());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RPermitExpirableSemaphore getPermitExpirableSemaphore(K key) {
|
|
|
|
|
String lockName = getLockName(key, "permitexpirablesemaphore");
|
|
|
|
|
return new RedissonPermitExpirableSemaphore(commandExecutor, lockName, ((Redisson)redisson).getSemaphorePubSub());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RSemaphore getSemaphore(K key) {
|
|
|
|
|
String lockName = getLockName(key, "semaphore");
|
|
|
|
|
return new RedissonSemaphore(commandExecutor, lockName, ((Redisson)redisson).getSemaphorePubSub());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RCountDownLatch getCountDownLatch(K key) {
|
|
|
|
|
String lockName = getLockName(key, "countdownlatch");
|
|
|
|
|
return new RedissonCountDownLatch(commandExecutor, lockName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLock getFairLock(K key) {
|
|
|
|
|
String lockName = getLockName(key, "fairlock");
|
|
|
|
|
return new RedissonFairLock(commandExecutor, lockName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLock getLock(K key) {
|
|
|
|
|
String lockName = getLockName(key, "lock");
|
|
|
|
|