Delete method fixed

pull/499/head
Nikita 9 years ago
parent dead46a732
commit 29c30a307e

@ -200,7 +200,7 @@ public class RedissonBloomFilter<T> extends RedissonExpirable implements RBloomF
@Override @Override
public Future<Boolean> deleteAsync() { public Future<Boolean> deleteAsync() {
return commandExecutor.writeAsync(getName(), RedisCommands.DEL_BOOL, getName(), getConfigName()); return commandExecutor.writeAsync(getName(), RedisCommands.DEL_OBJECTS, getName(), getConfigName());
} }
private void readConfig() { private void readConfig() {

@ -655,7 +655,7 @@ public class RedissonMapCache<K, V> extends RedissonMap<K, V> implements RMapCac
@Override @Override
public Future<Boolean> deleteAsync() { public Future<Boolean> deleteAsync() {
return commandExecutor.writeAsync(getName(), RedisCommands.DEL_BOOL, getName(), getTimeoutSetName()); return commandExecutor.writeAsync(getName(), RedisCommands.DEL_OBJECTS, getName(), getTimeoutSetName());
} }
@Override @Override

@ -474,7 +474,7 @@ public class RedissonSetCache<V> extends RedissonExpirable implements RSetCache<
@Override @Override
public Future<Boolean> deleteAsync() { public Future<Boolean> deleteAsync() {
return commandExecutor.writeAsync(getName(), RedisCommands.DEL_BOOL, getName(), getTimeoutSetName()); return commandExecutor.writeAsync(getName(), RedisCommands.DEL_OBJECTS, getName(), getTimeoutSetName());
} }
@Override @Override

@ -208,6 +208,7 @@ public interface RedisCommands {
RedisStrictCommand<Long> DEL = new RedisStrictCommand<Long>("DEL"); RedisStrictCommand<Long> DEL = new RedisStrictCommand<Long>("DEL");
RedisStrictCommand<Long> DBSIZE = new RedisStrictCommand<Long>("DBSIZE"); RedisStrictCommand<Long> DBSIZE = new RedisStrictCommand<Long>("DBSIZE");
RedisStrictCommand<Boolean> DEL_BOOL = new RedisStrictCommand<Boolean>("DEL", new BooleanReplayConvertor()); RedisStrictCommand<Boolean> DEL_BOOL = new RedisStrictCommand<Boolean>("DEL", new BooleanReplayConvertor());
RedisStrictCommand<Boolean> DEL_OBJECTS = new RedisStrictCommand<Boolean>("DEL", new BooleanAmountReplayConvertor());
RedisStrictCommand<Void> DEL_VOID = new RedisStrictCommand<Void>("DEL", new VoidReplayConvertor()); RedisStrictCommand<Void> DEL_VOID = new RedisStrictCommand<Void>("DEL", new VoidReplayConvertor());
RedisCommand<Object> GET = new RedisCommand<Object>("GET"); RedisCommand<Object> GET = new RedisCommand<Object>("GET");

@ -361,7 +361,7 @@ public class RedissonMapCacheReactive<K, V> extends RedissonMapReactive<K, V> im
@Override @Override
public Publisher<Boolean> delete() { public Publisher<Boolean> delete() {
return commandExecutor.writeReactive(getName(), RedisCommands.DEL_BOOL, getName(), getTimeoutSetName()); return commandExecutor.writeReactive(getName(), RedisCommands.DEL_OBJECTS, getName(), getTimeoutSetName());
} }
@Override @Override

@ -305,7 +305,7 @@ public class RedissonSetCacheReactive<V> extends RedissonExpirableReactive imple
@Override @Override
public Publisher<Boolean> delete() { public Publisher<Boolean> delete() {
return commandExecutor.writeReactive(getName(), RedisCommands.DEL_BOOL, getName(), getTimeoutSetName()); return commandExecutor.writeReactive(getName(), RedisCommands.DEL_OBJECTS, getName(), getTimeoutSetName());
} }
@Override @Override

@ -31,6 +31,15 @@ public class RedissonSetCacheTest extends BaseTest {
} }
} }
@Test
public void testDelete() {
RSetCache<Integer> set = redisson.getSetCache("set");
assertThat(set.delete()).isFalse();
set.add(1, 1, TimeUnit.SECONDS);
assertThat(set.delete()).isTrue();
assertThat(set.delete()).isFalse();
}
@Test @Test
public void testEmptyReadAll() { public void testEmptyReadAll() {

Loading…
Cancel
Save