RedisBloom / JRedisBloom

Java Client for RedisBloom probabilistic module
https://redisbloom.io
BSD 2-Clause "Simplified" License
153 stars 33 forks source link

Unable to delete rebloom key #5

Closed Nitesh7 closed 5 years ago

Nitesh7 commented 5 years ago

I am building a daily bloom filter where I make a new bloom-filter and remove the old filter via scheduler, but the delete command doesn't seem to be able to remove key. Eg:

Client client1 = new Client("127.0.0.1", 6379); String[] bloomFilterKeyList = {"a", "b"}; client1.addMulti("testBloom", bloomFilterKeyList); client1.delete("testBloom");

Even after running the command testBloom key/filter still doesn't get deleted.

joyang1 commented 5 years ago

hi, I have test delete method of Client. It's OK. you can use createFilter to test that you whether delete successfully. If you did not delete, this will create failed, then will create successfully.

Nitesh7 commented 5 years ago

@joyang1 Delete not working for me still, I wrote test case for checking delete and it failed.

@Test

junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:55) at junit.framework.Assert.assertTrue(Assert.java:22) at junit.framework.Assert.assertFalse(Assert.java:39) at junit.framework.Assert.assertFalse(Assert.java:47) at junit.framework.TestCase.assertFalse(TestCase.java:219) at io.rebloom.client.ClientTest.testDelete(ClientTest.java:146) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at

DaC1989 commented 5 years ago

I have the same problem, any ideas?

DaC1989 commented 5 years ago

maybe there is something wrong with the method "client.delete", I changed it like this:

/**
   * Remove the filter
   * @param name
   */
  public void delete(String name) {
//    _conn().getClient().del(name);
    try (Jedis conn = _conn()) {
      conn.del(name);
    }
  }

and it worked, perhaps I will see it why later

joyang1 commented 5 years ago

I will fix this issue. And then provide a new release version. Thanks.

Nitesh7 commented 5 years ago

Fixed the issue here: https://github.com/Nitesh7/JReBloom?organization=Nitesh7&organization=Nitesh7

joyang1 commented 5 years ago

this issue is already solved. You can use 1.2.0 version.

Nitesh7 commented 5 years ago

this issue is already solved. You can use 1.2.0 version. Thanks @joyang1