Ignore:
Timestamp:
2013-06-21T16:55:42+02:00 (11 years ago)
Author:
akks
Message:

JOSM/ImageryCache: add optional imagerycache.randomAccessFile parameter for slower but less system-dependent storage

Location:
applications/editors/josm/plugins/imagerycache
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagerycache/build.xml

    r29484 r29690  
    1515
    1616    <!-- enter the SVN commit message -->
    17     <property name="commit.message" value="JOSM/ImageryCache: updated MapDB (no more deadlocks, Java 1.6 compatible), less crashes, multiple-JOSM support"/>
     17    <property name="commit.message" value="JOSM/ImageryCache: add optional imagerycache.randomAccessFile parameter for slower but less system-dependent storage"/>
    1818    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    1919    <property name="plugin.main.version" value="5779"/>
  • applications/editors/josm/plugins/imagerycache/changelog

    r29484 r29690  
    1010* Cache directory is created if needed
    1111
    12 
    13 
    14        
    15 
    16          
    17            
    18 
    19 
     1221.06.2013 :
     13* Add optional imagerycache.randomAccessFile parameter for slower but less system-dependent storage
     14(RandomAccessFile instead of memory mapped file)
  • applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/OsmDBTilesLoader.java

    r29484 r29690  
    1818import org.openstreetmap.gui.jmapviewer.interfaces.TileSource;
    1919import org.openstreetmap.gui.jmapviewer.interfaces.TileSource.TileUpdate;
    20 import org.openstreetmap.josm.Main;
    2120import org.openstreetmap.josm.data.preferences.BooleanProperty;
    2221
  • applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/TileDAOMapDB.java

    r29484 r29690  
    33import java.io.File;
    44import java.util.HashMap;
    5 import java.util.HashSet;
    65import java.util.Map;
    7 import java.util.Map.Entry;
    8 import java.util.Set;
    96import org.mapdb.DB;
    107import org.mapdb.DBMaker;
     
    1714public class TileDAOMapDB implements TileDAO {
    1815    public static final boolean debug = new BooleanProperty("imagerycache.debug", false).get();
     16    public static final boolean noMmap = new BooleanProperty("imagerycache.randomAccessFile", false).get();
    1917   
    2018    public static boolean dbNotAvailable = false;
     
    5452                lock.deleteOnExit();
    5553               
    56                 db = DBMaker.newFileDB(f)
    57                     .randomAccessFileEnableIfNeeded()
    58                     .writeAheadLogDisable().closeOnJvmShutdown().make();
     54                if (noMmap) {
     55                    db = DBMaker.newFileDB(f)
     56                        .randomAccessFileEnable()
     57                        .writeAheadLogDisable().closeOnJvmShutdown().make();
     58                } else {
     59                    db = DBMaker.newFileDB(f)
     60                        .randomAccessFileEnableIfNeeded()
     61                        .writeAheadLogDisable().closeOnJvmShutdown().make();
     62                }
    5963               
    6064               
Note: See TracChangeset for help on using the changeset viewer.