private static void addCacheInfoUpdate(CacheStatus cacheStatus) {
    long cacheSize = cacheStatus.size;
    synchronized (baseDirSize) {
      Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
      if( dirSize == null ) {
        dirSize = Long.valueOf(cacheSize);
      } else {
        dirSize += cacheSize;
      }
      baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
    }
    synchronized (baseDirNumberSubDir) {
      Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
      if( dirSubDir == null ) {
        dirSubDir = 1;
      } else {
        dirSubDir += 1;
      }
      baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
    }
  }
private static void addCacheInfoUpdate ( CacheStatus cacheStatus ) { long cacheSize = cacheStatus . size ; synchronized ( baseDirSize ) { Long dirSize = baseDirSize . get ( cacheStatus . getBaseDir ( ) ) ; if ( dirSize == null ) { dirSize = Long . valueOf ( cacheSize ) ; } else { dirSize += cacheSize ; } baseDirSize . put ( cacheStatus . getBaseDir ( ) , dirSize ) ; } synchronized ( baseDirNumberSubDir ) { Integer dirSubDir = baseDirNumberSubDir . get ( cacheStatus . getBaseDir ( ) ) ; if ( dirSubDir == null ) { dirSubDir = 1 ; } else { dirSubDir += 1 ; } baseDirNumberSubDir . put ( cacheStatus . getBaseDir ( ) , dirSubDir ) ; } }
Update the maps baseDirSize and baseDirNumberSubDir when adding cache.
@param cacheStatus cache status of the cache is added