Changeset 10417 in josm for trunk/src/org/openstreetmap/josm/data/cache
- Timestamp:
- 2016-06-18T15:26:31+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r10406 r10417 45 45 private static long maxObjectTTL = -1; 46 46 private static final String PREFERENCE_PREFIX = "jcs.cache"; 47 p rivatestatic BooleanProperty USE_BLOCK_CACHE = new BooleanProperty(PREFERENCE_PREFIX + ".use_block_cache", true);47 public static BooleanProperty USE_BLOCK_CACHE = new BooleanProperty(PREFERENCE_PREFIX + ".use_block_cache", true); 48 48 49 49 private static final AuxiliaryCacheFactory diskCacheFactory = … … 203 203 BlockDiskCacheAttributes blockAttr = new BlockDiskCacheAttributes(); 204 204 blockAttr.setMaxKeySize(maxDiskObjects); 205 blockAttr.setBlockSizeBytes(4096); // use 4k blocks 205 206 ret = blockAttr; 206 207 } else { … … 216 217 ret.setDiskPath(cachePath); 217 218 } 218 ret.setCacheName(cacheName + (USE_BLOCK_CACHE.get() ? "_BLOCK " : "_INDEX"));219 220 removeStaleFiles(cachePath + File.separator + cacheName, (USE_BLOCK_CACHE.get() ? "_INDEX " : "_BLOCK"));219 ret.setCacheName(cacheName + (USE_BLOCK_CACHE.get() ? "_BLOCK_v2" : "_INDEX_v2")); 220 221 removeStaleFiles(cachePath + File.separator + cacheName, (USE_BLOCK_CACHE.get() ? "_INDEX_v2" : "_BLOCK_v2")); 221 222 return ret; 222 223 } … … 224 225 private static void removeStaleFiles(String basePathPart, String suffix) { 225 226 deleteCacheFiles(basePathPart); // TODO: this can be removed around 2016.09 227 deleteCacheFiles(basePathPart + "_BLOCK"); // TODO: this can be removed around 2016.09 228 deleteCacheFiles(basePathPart + "_INDEX"); // TODO: this can be removed around 2016.09 226 229 deleteCacheFiles(basePathPart + suffix); 227 230 }
Note:
See TracChangeset
for help on using the changeset viewer.