private synchronized void removeAllKeys(String storeName){
  if (storeName != null) {
    String escapedStoreName=storeName;
    escapedStoreName=escapedStoreName.replace("\\","\\\\");
    escapedStoreName=escapedStoreName.replace("*","\\*");
    escapedStoreName=escapedStoreName.replace("[","\\[");
    escapedStoreName=escapedStoreName.replace("]","\\]");
    escapedStoreName=escapedStoreName.replace("?","\\?");
    String pattern=redisKey(escapedStoreName,"*");
    try (Jedis jedis=pool.getResource()){
      Set<String> keys=jedis.keys(pattern);
      if (!keys.isEmpty()) {
        jedis.del(keys.toArray(new String[keys.size()]));
      }
    }
 catch (    JedisException e) {
      redisIsHealthy=false;
      String msg="Unable to remove all keys";
      LOG.error(msg);
      throw new RuntimeException(msg,e);
    }
  }
}

private synchronized void removeAllKeys ( String storeName ) { if ( storeName != null ) { String escapedStoreName = storeName ; escapedStoreName = escapedStoreName . replace ( "\\" , "\\\\" ) ; escapedStoreName = escapedStoreName . replace ( "*" , "\\*" ) ; escapedStoreName = escapedStoreName . replace ( "[" , "\\[" ) ; escapedStoreName = escapedStoreName . replace ( "]" , "\\]" ) ; escapedStoreName = escapedStoreName . replace ( "?" , "\\?" ) ; String pattern = redisKey ( escapedStoreName , "*" ) ; try ( Jedis jedis = pool . getResource ( ) ) { Set < String > keys = jedis . keys ( pattern ) ; if ( ! keys . isEmpty ( ) ) { jedis . del ( keys . toArray ( new String [ keys . size ( ) ] ) ) ; } } catch ( JedisException e ) { redisIsHealthy = false ; String msg = "Unable to remove all keys" ; LOG . error ( msg ) ; throw new RuntimeException ( msg , e ) ; } } }
remove all keys in the store .
