/** * Add a new file to be indexed * @param index the index * @param path the file */ public void index(LuceneLocalIndex index, String path) { Pair<String, LuceneLocalIndex> key = new Pair<>(path, index); synchronized (this._delayedLuceneIndexing) { AtomicInteger delay = this._delayedLuceneIndexing.get(key); // add it if not there if (delay == null) this._delayedLuceneIndexing.put(key, new AtomicInteger(this._delay)); // reset otherwise else delay.set(this._delay); } }
/** * Add a new file to be indexed * @param index the index * @param path the file */ public void index(SolrLocalIndex index, String path) { Pair<String, SolrLocalIndex> key = new Pair<>(path, index); synchronized (this._delayedSolrIndexing) { AtomicInteger delay = this._delayedSolrIndexing.get(key); // add it if not there if (delay == null) this._delayedSolrIndexing.put(key, new AtomicInteger(this._delay)); // reset otherwise else delay.set(this._delay); } }
/** * Handle the pattern attribute reporting duplicates and invalid patterns as warnings. * * @param pattern The URI pattern string to parse. * * @throws SAXException Only if thrown by underlying error handler. */ private void handlePattern(@Nullable String pattern) throws SAXException { if (pattern == null) { warning("Ignoring null pattern", null); return; } try { URIPattern p = new URIPattern(pattern); Pair<HttpMethod, URIPattern> k = new Pair<>(this.method, p); if (this._patternsToMethod.add(k)) { this._patterns.add(p); } else { warning("Ignoring duplicate pattern '"+p+"'", null); } } catch (IllegalArgumentException ex) { warning("Ignoring invalid pattern '"+pattern+"'", ex); } }