Skip to content

Commit

Permalink
Revert "Merge branch 'mrniko/master' into feature/travis-ci"
Browse files Browse the repository at this point in the history
This reverts commit 2903622, reversing
changes made to d8189a1.
  • Loading branch information
Rui Gu committed Apr 1, 2016
1 parent 2903622 commit 1e27329
Show file tree
Hide file tree
Showing 22 changed files with 151 additions and 862 deletions.
26 changes: 15 additions & 11 deletions src/main/java/org/redisson/Redisson.java
Expand Up @@ -47,7 +47,6 @@
import org.redisson.core.RBlockingQueue;
import org.redisson.core.RBloomFilter;
import org.redisson.core.RBucket;
import org.redisson.core.RBuckets;
import org.redisson.core.RCountDownLatch;
import org.redisson.core.RDeque;
import org.redisson.core.RGeo;
Expand Down Expand Up @@ -203,16 +202,6 @@ public <V> RBucket<V> getBucket(String name, Codec codec) {
return new RedissonBucket<V>(codec, commandExecutor, name);
}

@Override
public RBuckets getBuckets() {
return new RedissonBuckets(this, commandExecutor);
}

@Override
public RBuckets getBuckets(Codec codec) {
return new RedissonBuckets(this, codec, commandExecutor);
}

@Override
public <V> List<RBucket<V>> findBuckets(String pattern) {
Collection<String> keys = commandExecutor.get(commandExecutor.<List<String>, String>readAllAsync(RedisCommands.KEYS, pattern));
Expand Down Expand Up @@ -271,6 +260,11 @@ public void saveBuckets(Map<String, ?> buckets) {
commandExecutor.write(params.get(0).toString(), RedisCommands.MSET, params.toArray());
}

@Override
public <V> List<RBucket<V>> getBuckets(String pattern) {
return findBuckets(pattern);
}

@Override
public <V> RHyperLogLog<V> getHyperLogLog(String name) {
return new RedissonHyperLogLog<V>(commandExecutor, name);
Expand Down Expand Up @@ -543,6 +537,16 @@ public NodesGroup<ClusterNode> getClusterNodesGroup() {
return new RedisNodes<ClusterNode>(connectionManager);
}

@Override
public void flushdb() {
commandExecutor.get(commandExecutor.writeAllAsync(RedisCommands.FLUSHDB));
}

@Override
public void flushall() {
commandExecutor.get(commandExecutor.writeAllAsync(RedisCommands.FLUSHALL));
}

@Override
public boolean isShutdown() {
return connectionManager.isShutdown();
Expand Down
118 changes: 0 additions & 118 deletions src/main/java/org/redisson/RedissonBuckets.java

This file was deleted.

65 changes: 45 additions & 20 deletions src/main/java/org/redisson/RedissonClient.java
Expand Up @@ -31,7 +31,6 @@
import org.redisson.core.RBlockingQueue;
import org.redisson.core.RBloomFilter;
import org.redisson.core.RBucket;
import org.redisson.core.RBuckets;
import org.redisson.core.RCountDownLatch;
import org.redisson.core.RDeque;
import org.redisson.core.RGeo;
Expand Down Expand Up @@ -152,43 +151,57 @@ public interface RedissonClient {
<V> RBucket<V> getBucket(String name, Codec codec);

/**
* Returns interface for mass operations with Bucket objects.
* <p>Returns a list of object holder instances by a key pattern.
*
* <pre>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</pre>
* <p>Use \ to escape special characters if you want to match them verbatim.
*
* <p>Uses <code>KEYS</code> Redis command.
*
* @param pattern
* @return
*/
RBuckets getBuckets();
<V> List<RBucket<V>> findBuckets(String pattern);

/**
* Returns interface for mass operations with Bucket objects
* using provided codec for object.
* <p>Returns Redis object mapped by key. Result Map is not contains
* key-value entry for null values.
*
* <p>Uses <code>MGET</code> Redis command.
*
* @param keys
* @return
*/
RBuckets getBuckets(Codec codec);

/**
* Use {@link RBuckets#find(String)}
*/
@Deprecated
<V> List<RBucket<V>> findBuckets(String pattern);
<V> Map<String, V> loadBucketValues(Collection<String> keys);

/**
* Use {@link RBuckets#get(String...)}
* <p>Returns Redis object mapped by key. Result Map is not contains
* key-value entry for null values.
*
* <p>Uses <code>MGET</code> Redis command.
*
* @param keys
* @return
*/
@Deprecated
<V> Map<String, V> loadBucketValues(Collection<String> keys);
<V> Map<String, V> loadBucketValues(String ... keys);

/**
* Use {@link RBuckets#get(String...)}
* Saves Redis object mapped by key.
*
* @param buckets
*/
@Deprecated
<V> Map<String, V> loadBucketValues(String ... keys);
void saveBuckets(Map<String, ?> buckets);

/**
* Use {@link RBuckets#set(Map)}
* Use {@link #findBuckets(String)}
*/
@Deprecated
void saveBuckets(Map<String, ?> buckets);
<V> List<RBucket<V>> getBuckets(String pattern);

/**
* Returns HyperLogLog instance by name.
Expand Down Expand Up @@ -645,6 +658,18 @@ public interface RedissonClient {
*/
NodesGroup<ClusterNode> 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.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/redisson/RedissonGeo.java
Expand Up @@ -104,7 +104,7 @@ public Future<Map<V, String>> hashAsync(V... members) {
List<Object> params = new ArrayList<Object>(members.length + 1);
params.add(getName());
params.addAll(Arrays.asList(members));
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEOHASH", new MapGetAllDecoder(params, 1), 2, ValueType.OBJECTS);
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEOHASH", new MapGetAllDecoder(params), 2, ValueType.OBJECTS);
return commandExecutor.readAsync(getName(), new ScoredCodec(codec), command, params.toArray());
}

Expand Down

0 comments on commit 1e27329

Please sign in to comment.