public void cleanCache() { long now = System.currentTimeMillis(); for (DNSEntry entry : this.getCache().allValues()) { try { DNSRecord record = (DNSRecord) entry; if (record.isExpired(now)) { this.updateRecord(now, record, Operation.Remove); this.getCache().removeDNSEntry(record); } else if (record.isStale(now)) { // we should query for the record we care about i.e. those in the service collectors this.renewServiceCollector(record); } } catch (Exception exception) { logger.log(Level.SEVERE, this.getName() + ".Error while reaping records: " + entry, exception); logger.severe(this.toString()); } } }
public void cleanCache() { long now = System.currentTimeMillis(); for (DNSEntry entry : this.getCache().allValues()) { try { DNSRecord record = (DNSRecord) entry; if (record.isExpired(now)) { this.updateRecord(now, record, Operation.Remove); this.getCache().removeDNSEntry(record); } else if (record.isStale(now)) { // we should query for the record we care about i.e. those in the service collectors this.renewServiceCollector(record); } } catch (Exception exception) { logger.log(Level.SEVERE, this.getName() + ".Error while reaping records: " + entry, exception); logger.severe(this.toString()); } } }
public void cleanCache() { long now = System.currentTimeMillis(); for (DNSEntry entry : this.getCache().allValues()) { try { DNSRecord record = (DNSRecord) entry; if (record.isExpired(now)) { this.updateRecord(now, record, Operation.Remove); this.getCache().removeDNSEntry(record); } else if (record.isStale(now)) { // we should query for the record we care about i.e. those in the service collectors this.renewServiceCollector(record); } } catch (Exception exception) { logger.log(Level.SEVERE, this.getName() + ".Error while reaping records: " + entry, exception); logger.severe(this.toString()); } } }
this.updateRecord(now, record, Operation.Remove); logger.trace("Removing DNSEntry from cache: {}", entry); this.getCache().removeDNSEntry(record); } else if (record.isStaleAndShouldBeRefreshed(now)) { record.incrementRefreshPercentage();
cacheOperation = Operation.Remove; logger.trace("Record is expired - removeDNSEntry() on:\n\t{}", cachedRecord); this.getCache().removeDNSEntry(cachedRecord);
this.getCache().removeDNSEntry(cachedRecord);
this.getCache().removeDNSEntry(cachedRecord);
this.getCache().removeDNSEntry(cachedRecord);