Show
Ignore:
Timestamp:
07/21/08 20:54:23 (4 months ago)
Author:
Ryan Daum <ryan.daum@…>
Branch:
default
Message:

Application of patch to ceiling/size settings from christopher.cheetham@…

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • jmemcached-cli/src/main/java/com/thimbleware/jmemcached/Main.java

    r14 r44  
    3838        options.addOption("c", "ceiling", true, "ceiling memory to use in MB"); 
    3939        options.addOption("l", "listen", true, "Address to listen on"); 
     40        options.addOption("s", "size", true, "max items"); 
    4041        options.addOption("V", false, "Show version number"); 
    4142        options.addOption("v", false, "verbose (show commands)"); 
     
    109110        long maxBytes; 
    110111        if (cmdline.hasOption("m")) { 
    111             maxBytes = Integer.parseInt(cmdline.getOptionValue("m")) * 1024000; 
     112            maxBytes = Long.parseLong(cmdline.getOptionValue("m")) * 1024000; 
    112113            System.out.println("Setting max memory size to " + String.valueOf(maxBytes) + " bytes"); 
    113114        } else if (cmdline.hasOption("memory")) { 
    114             maxBytes = Integer.parseInt(cmdline.getOptionValue("memory")) * 1024000; 
     115            maxBytes = Long.parseLong(cmdline.getOptionValue("memory")) * 1024000; 
    115116            System.out.println("Setting max memory size to " + String.valueOf(maxBytes) + " bytes"); 
    116117        } else { 
     
    126127        // create daemon and start it 
    127128        MemCacheDaemon daemon = new MemCacheDaemon(); 
    128         LRUCacheStorageDelegate cacheStorage = new LRUCacheStorageDelegate(max_size, maxBytes, 1024000); 
     129        LRUCacheStorageDelegate cacheStorage = new LRUCacheStorageDelegate(max_size, maxBytes, ceiling); 
    129130        daemon.setCache(new Cache(cacheStorage)); 
    130131        daemon.setAddr(addr);