Multimaps added to RBatch objects. #404

pull/427/head^2
Nikita 9 years ago
parent e5b3f64d7a
commit a365d3551c

@ -33,12 +33,14 @@ import org.redisson.core.RHyperLogLogAsync;
import org.redisson.core.RKeysAsync; import org.redisson.core.RKeysAsync;
import org.redisson.core.RLexSortedSetAsync; import org.redisson.core.RLexSortedSetAsync;
import org.redisson.core.RListAsync; import org.redisson.core.RListAsync;
import org.redisson.core.RListMultimap;
import org.redisson.core.RMapAsync; import org.redisson.core.RMapAsync;
import org.redisson.core.RQueueAsync; import org.redisson.core.RQueueAsync;
import org.redisson.core.RScoredSortedSetAsync; import org.redisson.core.RScoredSortedSetAsync;
import org.redisson.core.RScriptAsync; import org.redisson.core.RScriptAsync;
import org.redisson.core.RSetAsync; import org.redisson.core.RSetAsync;
import org.redisson.core.RSetCacheAsync; import org.redisson.core.RSetCacheAsync;
import org.redisson.core.RSetMultimap;
import org.redisson.core.RTopicAsync; import org.redisson.core.RTopicAsync;
import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Future;
@ -229,5 +231,25 @@ public class RedissonBatch implements RBatch {
return executorService.executeAsync(); return executorService.executeAsync();
} }
@Override
public <K, V> RSetMultimap<K, V> getSetMultimap(String name) {
return new RedissonSetMultimap<K, V>(executorService, name);
}
@Override
public <K, V> RSetMultimap<K, V> getSetMultimap(String name, Codec codec) {
return new RedissonSetMultimap<K, V>(codec, executorService, name);
}
@Override
public <K, V> RListMultimap<K, V> getListMultimap(String name) {
return new RedissonListMultimap<K, V>(executorService, name);
}
@Override
public <K, V> RListMultimap<K, V> getListMultimap(String name, Codec codec) {
return new RedissonListMultimap<K, V>(codec, executorService, name);
}
} }

@ -37,6 +37,24 @@ import io.netty.util.concurrent.Future;
*/ */
public interface RBatch { public interface RBatch {
/**
* Returns Set based MultiMap instance by name.
*
* @param name
* @return
*/
<K, V> RSetMultimap<K, V> getSetMultimap(String name);
/**
* Returns Set based MultiMap instance by name
* using provided codec for both map keys and values.
*
* @param name
* @param codec
* @return
*/
<K, V> RSetMultimap<K, V> getSetMultimap(String name, Codec codec);
/** /**
* Returns set-based cache instance by <code>name</code>. * Returns set-based cache instance by <code>name</code>.
* Uses map (value_hash, value) under the hood for minimal memory consumption. * Uses map (value_hash, value) under the hood for minimal memory consumption.
@ -118,6 +136,24 @@ public interface RBatch {
<V> RListAsync<V> getList(String name, Codec codec); <V> RListAsync<V> getList(String name, Codec codec);
/**
* Returns List based MultiMap instance by name.
*
* @param name
* @return
*/
<K, V> RListMultimap<K, V> getListMultimap(String name);
/**
* Returns List based MultiMap instance by name
* using provided codec for both map keys and values.
*
* @param name
* @param codec
* @return
*/
<K, V> RListMultimap<K, V> getListMultimap(String name, Codec codec);
/** /**
* Returns map instance by name. * Returns map instance by name.
* *

Loading…
Cancel
Save