public void start() { // cache AlertThreadGroup for later ToePool launch AlertThreadGroup atg = AlertThreadGroup.current(); if(atg!=null) { alertThreadGroup = atg; } if(isRunning) { return; } sExit = CrawlStatus.FINISHED_ABNORMAL; // force creation of DNS Cache now -- avoids CacheCleaner in toe-threads group // also cap size at 1 (we never wanta cached value; 0 is non-operative) Lookup.getDefaultCache(DClass.IN).setMaxEntries(1); reserveMemory = new LinkedList<byte[]>(); for(int i = 0; i < RESERVE_BLOCKS; i++) { reserveMemory.add(new byte[RESERVE_BLOCK_SIZE]); } isRunning = true; }
public void start() { // cache AlertThreadGroup for later ToePool launch AlertThreadGroup atg = AlertThreadGroup.current(); if(atg!=null) { alertThreadGroup = atg; } if(isRunning) { return; } sExit = CrawlStatus.FINISHED_ABNORMAL; // force creation of DNS Cache now -- avoids CacheCleaner in toe-threads group // also cap size at 1 (we never wanta cached value; 0 is non-operative) Lookup.getDefaultCache(DClass.IN).setMaxEntries(1); reserveMemory = new LinkedList<byte[]>(); for(int i = 0; i < RESERVE_BLOCKS; i++) { reserveMemory.add(new byte[RESERVE_BLOCK_SIZE]); } isRunning = true; }
public DNSCacheManager() { setProperty(new CollectionProperty(SERVERS, new ArrayList<String>())); this.systemDefaultDnsResolver = new SystemDefaultDnsResolver(); this.cache = new LinkedHashMap<>(); //disabling cache lookupCache = new Cache(); lookupCache.setMaxCache(0); lookupCache.setMaxEntries(0); }
cache.setMaxEntries(maxCacheSize); cache.setMaxNCache(negativeCacheTTL);
cache.setMaxEntries(maxCacheSize); cache.setMaxNCache(negativeCacheTTL);