Merge branch 'master' of github.com:mrniko/redisson

pull/99/head
Nikita 10 years ago
commit 05d2a7cf8c

@ -38,11 +38,30 @@ Features
* Supports OSGi
* With over 110 unit tests
Projects using Redisson
================================
Setronica: [setronica.com](http://setronica.com/)
Monits: [monits.com](http://monits.com/)
Brookhaven National Laboratory: [bnl.gov](http://bnl.gov/)
Netflix Dyno client: [dyno] (https://github.com/Netflix/dyno)
Recent Releases
================================
####Please Note: trunk is current development branch.
####18-Nov-2014 - version 1.1.6 released
Feature - `RBucket.exists` and `RBucket.existsAsync` methods added
Feature - `RMap.addAndGet` method added
Feature - database index via `database` and operation timeout via `timeout` config params added
Improvement - `RLock` optimization
__Breaking api change__ - Redisson now uses `RedissonClient` interface
Fixed - NPE in `CommandOutput`
Fixed - unsubscribing during `RTopic.removeListener`
Fixed - all object names encoding, no more quotes
Fixed - HashedWheelTimer shutdown
Fixed - `RLock` race conditions (thanks to jsotuyod and AndrewKolpakov)
Fixed - `RCountDownLatch` race conditions
####23-Jul-2014 - version 1.1.5 released
Feature - operations auto-retry. `retryAttempts` and `retryInterval` params added for each connection type
Feature - `RMap.filterEntries`, `RMap.getAll`, `RMap.filterKeys`, `RMap.filterValues` methods added
@ -118,5 +137,5 @@ Include the following to your dependency list:
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
</dependency>

@ -19,13 +19,7 @@ import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.*;
import org.redisson.async.AsyncOperation;
import org.redisson.async.OperationListener;
@ -93,6 +87,9 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
@Override
public Map<K, V> getAll(final Set<K> keys) {
if (keys.size() == 0) {
return Collections.emptyMap();
}
List<V> list = connectionManager.read(new ResultOperation<List<V>, V>() {
@Override
protected Future<List<V>> execute(RedisAsyncConnection<Object, V> async) {
@ -104,6 +101,9 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
int index = 0;
for (K key : keys) {
V value = list.get(index);
if (value == null) {
continue;
}
result.put(key, value);
index++;
}
@ -442,12 +442,16 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
@Override
public Future<Long> fastRemoveAsync(final K ... keys) {
return connectionManager.writeAsync(new ResultOperation<Long, V>() {
@Override
public Future<Long> execute(RedisAsyncConnection<Object, V> async) {
return async.hdel(getName(), keys);
}
});
if (keys != null && keys.length > 0) {
return connectionManager.writeAsync(new ResultOperation<Long, V>() {
@Override
public Future<Long> execute(RedisAsyncConnection<Object, V> async) {
return async.hdel(getName(), keys);
}
});
} else {
return connectionManager.getGroup().next().newSucceededFuture(0L);
}
}
@Override

@ -136,7 +136,7 @@ public class RedissonMapTest extends BaseTest {
map.put(3, 300);
map.put(4, 400);
Map<Integer, Integer> filtered = map.getAll(new HashSet<Integer>(Arrays.asList(2, 3)));
Map<Integer, Integer> filtered = map.getAll(new HashSet<Integer>(Arrays.asList(2, 3, 5)));
Map<Integer, Integer> expectedMap = new HashMap<Integer, Integer>();
expectedMap.put(2, 200);
@ -431,4 +431,11 @@ public class RedissonMapTest extends BaseTest {
Assert.assertEquals(1, map.size());
}
@Test
public void testFastRemoveEmpty() throws Exception {
RMap<Integer, Integer> map = redisson.getMap("simple");
map.put(1, 3);
Assert.assertEquals(0, map.fastRemove());
Assert.assertEquals(1, map.size());
}
}

Loading…
Cancel
Save