private void clearCompiledQueries(){ if (this.compiledQueries.size() > 0){ this._statistics.incCompiledQueryCount(-(this.compiledQueries.size())); this.compiledQueries.clear(); if (logger.isDebugEnabled()){ logger.debug("Removed all compiled queries from ccn.compliedQueries list. Total compiled queries: {}", this._statistics.getCompiledQueryCount()); } } }
private void clearCompiledQueries(){ if (this.compiledQueries.size() > 0){ this._statistics.incCompiledQueryCount(-(this.compiledQueries.size())); this.compiledQueries.clear(); if (this._logger.fineEnabled()){ this._logger.fine("Removed all compiled queries from ccn.compliedQueries list." + ". Total compiled queries : " + this._statistics.getCompiledQueryCount()); } } }
public void addCompiledQuery(DefaultQuery query){ if (this.compiledQueries.putIfAbsent(query.getQueryString(), query) == null){ // Added successfully. this._statistics.incCompiledQueryCount(1); if (logger.isDebugEnabled()){ logger.debug("Added compiled query into ccn.compliedQueries list. Query: {}. Total compiled queries: {}", query.getQueryString(), this._statistics.getCompiledQueryCount()); } // Start the clearIdleCompiledQueries thread. startCompiledQueryCleanupThread(); } }
@Override public void run2() { final boolean isDebugEnabled = logger.isDebugEnabled(); for (Map.Entry<String, DefaultQuery> e : compiledQueries.entrySet()){ DefaultQuery q = e.getValue(); // Check if the query last used flag. // If its true set it to false. If its false it means it is not used // from the its last checked. if (q.getLastUsed()) { q.setLastUsed(false); } else { if (compiledQueries.remove(e.getKey()) != null) { // If successfully removed decrement the counter. _statistics.incCompiledQueryCount(-1); if (isDebugEnabled){ logger.debug("Removed compiled query from ccn.compliedQueries list. Query: " + q.getQueryString() + ". Total compiled queries are : " + _statistics.getCompiledQueryCount()); } } } } } };
@Override public void run2() { for (Map.Entry<String, DefaultQuery> e : compiledQueries.entrySet()){ DefaultQuery q = e.getValue(); // Check if the query last used flag. // If its true set it to false. If its false it means it is not used // from the its last checked. if (q.getLastUsed()) { q.setLastUsed(false); } else { if (compiledQueries.remove(e.getKey()) != null) { // If successfully removed decrement the counter. _statistics.incCompiledQueryCount(-1); if (_logger.fineEnabled()){ _logger.fine("Removed compiled query from ccn.compliedQueries list. Query: " + q.getQueryString() + ". Total compiled queries are : " + _statistics.getCompiledQueryCount()); } } } } } };
public void addCompiledQuery(DefaultQuery query){ if (this.compiledQueries.putIfAbsent(query.getQueryString(), query) == null){ // Added successfully. this._statistics.incCompiledQueryCount(1); if (this._logger.fineEnabled()){ this._logger.fine("Added compiled query into ccn.compliedQueries list." + " Query: " + query.getQueryString() + ". Total compiled queries : " + this._statistics.getCompiledQueryCount()); } // Start the clearIdleCompiledQueries thread. startCompiledQueryCleanupThread(); } }