private static void deleteCacheInfoUpdate ( CacheStatus cacheStatus ) { if ( ! cacheStatus . isInited ( ) ) { // if it is not created yet, do nothing. return ; } synchronized ( baseDirSize ) { Long dirSize = baseDirSize . get ( cacheStatus . getBaseDir ( ) ) ; if ( dirSize != null ) { dirSize -= cacheStatus . size ; baseDirSize . put ( cacheStatus . getBaseDir ( ) , dirSize ) ; } } synchronized ( baseDirNumberSubDir ) { Integer dirSubDir = baseDirNumberSubDir . get ( cacheStatus . getBaseDir ( ) ) ; if ( dirSubDir != null ) { dirSubDir -- ; baseDirNumberSubDir . put ( cacheStatus . getBaseDir ( ) , dirSubDir ) ; } } }
Update the maps baseDirSize and baseDirNumberSubDir when deleting cache .