getBucket(String name, Codec codec);
/**
- * Returns a list of object holder instances by a key pattern.
- *
- *
Supported glob-style patterns:
- * h?llo subscribes to hello, hallo and hxllo
- * h*llo subscribes to hllo and heeeello
- * h[ae]llo subscribes to hello and hallo, but not hillo
- * h[^e]llo matches hallo, hbllo, ... but not hello
- * h[a-b]llo matches hallo and hbllo
- * Use \ to escape special characters if you want to match them verbatim.
+ * Returns interface for mass operations with Bucket objects.
*
- *
Uses KEYS
Redis command.
- *
- * @param pattern
* @return
*/
- List> findBuckets(String pattern);
+ RBuckets getBuckets();
/**
- * Returns Redis object mapped by key. Result Map is not contains
- * key-value entry for null values.
- *
- *
Uses MGET
Redis command.
+ * Returns interface for mass operations with Bucket objects
+ * using provided codec for object.
*
- * @param keys
* @return
*/
- Map loadBucketValues(Collection keys);
+ RBuckets getBuckets(Codec codec);
/**
- * Returns Redis object mapped by key. Result Map is not contains
- * key-value entry for null values.
- *
- *
Uses MGET
Redis command.
- *
- * @param keys
- * @return
+ * Use {@link RBuckets#find(String)}
*/
- Map loadBucketValues(String ... keys);
+ @Deprecated
+ List> findBuckets(String pattern);
/**
- * Saves Redis object mapped by key.
- *
- * @param buckets
+ * Use {@link RBuckets#get(String...)}
*/
- void saveBuckets(Map buckets);
+ @Deprecated
+ Map loadBucketValues(Collection keys);
+
+ /**
+ * Use {@link RBuckets#get(String...)}
+ */
+ @Deprecated
+ Map loadBucketValues(String ... keys);
/**
- * Use {@link #findBuckets(String)}
+ * Use {@link RBuckets#set(Map)}
*/
@Deprecated
- List> getBuckets(String pattern);
+ void saveBuckets(Map buckets);
/**
* Returns HyperLogLog instance by name.
@@ -218,7 +227,7 @@ public interface RedissonClient {
RList getList(String name, Codec codec);
/**
- * Returns List based MultiMap instance by name.
+ * Returns List based Multimap instance by name.
*
* @param name
* @return
@@ -226,7 +235,7 @@ public interface RedissonClient {
RListMultimap getListMultimap(String name);
/**
- * Returns List based MultiMap instance by name
+ * Returns List based Multimap instance by name
* using provided codec for both map keys and values.
*
* @param name
@@ -235,6 +244,29 @@ public interface RedissonClient {
*/
RListMultimap getListMultimap(String name, Codec codec);
+ /**
+ * Returns List based Multimap instance by name.
+ * Supports key-entry eviction with a given TTL value.
+ *
+ * If eviction is not required then it's better to use regular map {@link #getSetMultimap(String)}.
+ *
+ * @param name
+ * @return
+ */
+ RListMultimapCache getListMultimapCache(String name);
+
+ /**
+ * Returns List based Multimap instance by name
+ * using provided codec for both map keys and values.
+ * Supports key-entry eviction with a given TTL value.
+ *
+ * If eviction is not required then it's better to use regular map {@link #getSetMultimap(String, Codec)}.
+ *
+ * @param name
+ * @return
+ */
+ RListMultimapCache getListMultimapCache(String name, Codec codec);
+
/**
* Returns map instance by name.
*
@@ -254,15 +286,15 @@ public interface RedissonClient {
RMap getMap(String name, Codec codec);
/**
- * Returns Set based MultiMap instance by name.
+ * Returns Set based Multimap instance by name.
*
* @param name
* @return
*/
RSetMultimap getSetMultimap(String name);
-
+
/**
- * Returns Set based MultiMap instance by name
+ * Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
*
* @param name
@@ -271,6 +303,29 @@ public interface RedissonClient {
*/
RSetMultimap getSetMultimap(String name, Codec codec);
+ /**
+ * Returns Set based Multimap instance by name.
+ * Supports key-entry eviction with a given TTL value.
+ *
+ * If eviction is not required then it's better to use regular map {@link #getSetMultimap(String)}.
+ *
+ * @param name
+ * @return
+ */
+ RSetMultimapCache getSetMultimapCache(String name);
+
+ /**
+ * Returns Set based Multimap instance by name
+ * using provided codec for both map keys and values.
+ * Supports key-entry eviction with a given TTL value.
+ *
+ * If eviction is not required then it's better to use regular map {@link #getSetMultimap(String, Codec)}.
+ *
+ * @param name
+ * @return
+ */
+ RSetMultimapCache getSetMultimapCache(String name, Codec codec);
+
/**
* Returns semaphore instance by name
*
@@ -537,6 +592,13 @@ public interface RedissonClient {
*/
RScript getScript();
+ /**
+ * Returns object for remote operations
+ *
+ * @return
+ */
+ RRemoteService getRemoteSerivce();
+
/**
* Return batch object which executes group of
* command in pipeline.
@@ -583,18 +645,6 @@ public interface RedissonClient {
*/
NodesGroup getClusterNodesGroup();
- /**
- * Use {@link RKeys#flushdb()}
- */
- @Deprecated
- void flushdb();
-
- /**
- * Use {@link RKeys#flushall()}
- */
- @Deprecated
- void flushall();
-
/**
* Returns {@code true} if this Redisson instance has been shut down.
*
diff --git a/src/main/java/org/redisson/RedissonCountDownLatch.java b/src/main/java/org/redisson/RedissonCountDownLatch.java
index 8f3eeef1f..5a4d660a6 100644
--- a/src/main/java/org/redisson/RedissonCountDownLatch.java
+++ b/src/main/java/org/redisson/RedissonCountDownLatch.java
@@ -53,7 +53,7 @@ public class RedissonCountDownLatch extends RedissonObject implements RCountDown
public void await() throws InterruptedException {
Future promise = subscribe();
try {
- promise.await();
+ get(promise);
while (getCount() > 0) {
// waiting for open state
@@ -71,7 +71,7 @@ public class RedissonCountDownLatch extends RedissonObject implements RCountDown
public boolean await(long time, TimeUnit unit) throws InterruptedException {
Future promise = subscribe();
try {
- if (!promise.await(time, unit)) {
+ if (!await(promise, time, unit)) {
return false;
}
diff --git a/src/main/java/org/redisson/RedissonGeo.java b/src/main/java/org/redisson/RedissonGeo.java
new file mode 100644
index 000000000..527892d25
--- /dev/null
+++ b/src/main/java/org/redisson/RedissonGeo.java
@@ -0,0 +1,197 @@
+/**
+ * Copyright 2014 Nikita Koksharov, Nickolay Borbit
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.redisson;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.redisson.client.codec.Codec;
+import org.redisson.client.codec.GeoEntryCodec;
+import org.redisson.client.codec.ScoredCodec;
+import org.redisson.client.protocol.RedisCommand;
+import org.redisson.client.protocol.RedisCommand.ValueType;
+import org.redisson.client.protocol.RedisCommands;
+import org.redisson.client.protocol.decoder.GeoDistanceDecoder;
+import org.redisson.client.protocol.decoder.GeoMapReplayDecoder;
+import org.redisson.client.protocol.decoder.GeoPositionDecoder;
+import org.redisson.client.protocol.decoder.GeoPositionMapDecoder;
+import org.redisson.client.protocol.decoder.MultiDecoder;
+import org.redisson.client.protocol.decoder.NestedMultiDecoder;
+import org.redisson.client.protocol.decoder.FlatNestedMultiDecoder;
+import org.redisson.command.CommandAsyncExecutor;
+import org.redisson.connection.decoder.MapGetAllDecoder;
+import org.redisson.core.GeoEntry;
+import org.redisson.core.GeoPosition;
+import org.redisson.core.GeoUnit;
+import org.redisson.core.RGeo;
+
+import io.netty.util.concurrent.Future;
+
+public class RedissonGeo extends RedissonExpirable implements RGeo {
+
+ MultiDecoder