@Override public synchronized void close() { for ( RAMDirectory ramDirectory : directories.values() ) { ramDirectory.close(); } directories.clear(); } }
/** * Closes the CPE Index. */ @Override public synchronized void close() { final int count = INSTANCE.usageCount.get() - 1; if (count <= 0) { INSTANCE.usageCount.set(0); if (searchingAnalyzer != null) { searchingAnalyzer.close(); searchingAnalyzer = null; } if (indexReader != null) { try { indexReader.close(); } catch (IOException ex) { LOGGER.trace("", ex); } indexReader = null; } queryParser = null; indexSearcher = null; if (index != null) { index.close(); index = null; } } }
/** * {@inheritDoc} * * @throws IndexException */ public void stop() throws IndexException { this.indexDirectiry.close(); this.isStoped = true; }
@Override public void stop() { directory.close(); }
@Override public void stop() { directory.close(); }
public void decRef() { ensureOpen(); if (refCount.getAndDecrement() == 1) { super.close(); } }
public void close() throws IOException { ramDir.close(); dir.close(); }
private void close0() { super.close(); } }
/** * Closes the CPE Index. */ @Override public synchronized void close() { final int count = INSTANCE.usageCount.get() - 1; if (count <= 0) { INSTANCE.usageCount.set(0); if (searchingAnalyzer != null) { searchingAnalyzer.close(); searchingAnalyzer = null; } if (indexReader != null) { try { indexReader.close(); } catch (IOException ex) { LOGGER.trace("", ex); } indexReader = null; } queryParser = null; indexSearcher = null; if (index != null) { index.close(); index = null; } } }
public void close() throws IOException { ramDir.close(); if (log.isDebugEnabled()) { log.debug("Directory [" + dir + "] shutsdown, waiting for [" + awaitTermination + "] minutes for tasks to finish executing"); } executorService.shutdown(); if (!executorService.isTerminated()) { try { if (!executorService.awaitTermination(60 * awaitTermination, TimeUnit.SECONDS)) { logAsyncErrorMessage("wait for async tasks to shutdown"); } } catch (InterruptedException e) { logAsyncErrorMessage("wait for async tasks to shutdown"); } } dir.close(); }
/** * End of blocklet notification */ public void onBlockletEnd(int blockletId) throws IOException { // close ram writer ramIndexWriter.close(); // add ram index data into disk indexWriter.addIndexes(ramDir); // delete this ram data ramDir.close(); if (storeBlockletWise) { flushCache(cache, getIndexColumns(), indexWriter, storeBlockletWise); indexWriter.close(); indexWriter = null; } }
idx.close(); return score;
public void shutDown() { resetIndexReader(); dictCache.invalidateAll(); for (Map.Entry<String, SpellChecker> entry : spellCheckerCache.asMap().entrySet()) { try { ramDirectoryCache.getUnchecked(entry.getKey()).close(); entry.getValue().close(); } catch (IOException e) { logger.error("Could not close spellchecker in indexshard [{}] for field [{}]", e, indexShard, entry.getKey()); } } spellCheckerCache.invalidateAll(); ramDirectoryCache.invalidateAll(); lookupCache.invalidateAll(); analyzingSuggesterCache.invalidateAll(); fuzzySuggesterCache.invalidateAll(); }
public void update() { resetIndexReader(); for (String field : dictCache.asMap().keySet()) { dictCache.refresh(field); } try { for (String field : spellCheckerCache.asMap().keySet()) { SpellChecker oldSpellchecker = spellCheckerCache.getUnchecked(field); RAMDirectory oldRamDirectory = ramDirectoryCache.getUnchecked(field); ramDirectoryCache.refresh(field); spellCheckerCache.refresh(field); oldRamDirectory.close(); oldSpellchecker.close(); } } catch (IOException e ) { logger.error("Error refreshing spell checker cache [{}]", e, shardId); } for (String field : lookupCache.asMap().keySet()) { lookupCache.refresh(field); } for (FieldType fieldType : analyzingSuggesterCache.asMap().keySet()) { analyzingSuggesterCache.refresh(fieldType); } for (FieldType fieldType : fuzzySuggesterCache.asMap().keySet()) { fuzzySuggesterCache.refresh(fieldType); } }
os.close(); ramDirectory.close(); directory.close();
os.close(); ramDirectory.close(); directory.close();
ramDirectory.close(); ramDirectoryCache.invalidate(field);