Changeset 9064 in josm


Ignore:
Timestamp:
2015-11-25T22:27:31+01:00 (4 years ago)
Author:
wiktorn
Message:

Move from IndexedDiskCache to BlockDiskCache.

HEADSUP: This change trashes contents of the cache files silently (and there's nothing easy we can do about it).

Thanks to Thomans Vandahl at Apache Commons (https://issues.apache.org/jira/browse/JCS-153) the problem with restoring cache file corruptions is finally solved.

This means, that ot no time cache file optimization will be needed, thus reducing the shutdown time of JCS Caches.

Closes: #11566

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r8991 r9064  
    1717import org.apache.commons.jcs.auxiliary.AuxiliaryCacheFactory;
    1818import org.apache.commons.jcs.auxiliary.disk.behavior.IDiskCacheAttributes;
    19 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes;
    20 import org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory;
     19import org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheAttributes;
     20import org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheFactory;
    2121import org.apache.commons.jcs.engine.CompositeCacheAttributes;
    2222import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes.DiskUsagePattern;
     
    4141    private static long maxObjectTTL        = -1;
    4242    private static final String PREFERENCE_PREFIX = "jcs.cache";
    43     private static final AuxiliaryCacheFactory diskCacheFactory = new IndexedDiskCacheFactory();
     43    private static final AuxiliaryCacheFactory diskCacheFactory = new BlockDiskCacheFactory();
    4444    private static FileLock cacheDirLock;
    4545
     
    184184
    185185    private static IDiskCacheAttributes getDiskCacheAttributes(int maxDiskObjects, String cachePath) {
    186         IndexedDiskCacheAttributes ret = new IndexedDiskCacheAttributes();
     186        BlockDiskCacheAttributes ret = new BlockDiskCacheAttributes();
    187187        ret.setDiskLimitType(IDiskCacheAttributes.DiskLimitType.SIZE);
    188188        ret.setMaxKeySize(maxDiskObjects);
Note: See TracChangeset for help on using the changeset viewer.