platform-core/platform-cache/src/main/java/org/sunbird/cache/util/RedisCacheUtil.java
public static void deleteByPattern(String pattern) {
        if (StringUtils.isNotBlank(pattern) && !StringUtils.equalsIgnoreCase(pattern, "*")) {
            Jedis jedis = getConnection();
            try {
                Set<String> keys = jedis.keys(pattern);
                if (keys != null && keys.size() > 0) {
                    List<String> keyList = new ArrayList<>(keys);
                    jedis.del(keyList.toArray(new String[keyList.size()]));
                }
            } catch (Exception e) {
                TelemetryManager.error("Exception Occurred While Deleting Records From Redis Cache for Pattern : " + pattern + " | Exception is : ", e);
                throw new ServerException(CacheErrorCode.ERR_CACHE_DELETE_PROPERTY_ERROR.name(), e.getMessage());
            } finally {
                returnConnection(jedis);
            }
        }
    }
/**
     * This method delete data from cache for all key/keys matched with given pattern
     *
     * @param pattern
     */
This method delete data from cache for all key/keys matched with given pattern
@param pattern
This method delete data from cache for all key / keys matched with given pattern @param pattern
public static void deleteByPattern(String pattern) {
        if (StringUtils.isNotBlank(pattern) && !StringUtils.equalsIgnoreCase(pattern, "*")) {
            Jedis jedis = getConnection();
            try {
                Set<String> keys = jedis.keys(pattern);
                if (keys != null && keys.size() > 0) {
                    List<String> keyList = new ArrayList<>(keys);
                    jedis.del(keyList.toArray(new String[keyList.size()]));
                }
            } catch (Exception e) {
                TelemetryManager.error("Exception Occurred While Deleting Records From Redis Cache for Pattern : " + pattern + " | Exception is : ", e);
                throw new ServerException(CacheErrorCode.ERR_CACHE_DELETE_PROPERTY_ERROR.name(), e.getMessage());
            } finally {
                returnConnection(jedis);
            }
        }
    }
public static void deleteByPattern ( String pattern ) { if ( StringUtils . isNotBlank ( pattern ) && ! StringUtils . equalsIgnoreCase ( pattern , "*" ) ) { Jedis jedis = getConnection ( ) ; try { Set < String > keys = jedis . keys ( pattern ) ; if ( keys != null && keys . size ( ) > 0 ) { List < String > keyList = new ArrayList < > ( keys ) ; jedis . del ( keyList . toArray ( new String [ keyList . size ( ) ] ) ) ; } } catch ( Exception e ) { TelemetryManager . error ( "Exception Occurred While Deleting Records From Redis Cache for Pattern : " + pattern + " | Exception is : " , e ) ; throw new ServerException ( CacheErrorCode . ERR_CACHE_DELETE_PROPERTY_ERROR . name ( ) , e . getMessage ( ) ) ; } finally { returnConnection ( jedis ) ; } } }
This method delete data from cache for all key/keys matched with given pattern
 @param pattern
This method delete data from cache for all key / keys matched with given pattern @param pattern