@Override public void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException { LOG.info("reload()"); if (dictionary == null && storeDir != null) { // this may be a firstSearcher event, try loading it FileInputStream is = new FileInputStream(new File(storeDir, factory.storeFileName())); try { if (lookup.load(is)) { return; // loaded ok } } finally { IOUtils.closeWhileHandlingException(is); } LOG.debug("load failed, need to build Lookup again"); } // loading was unsuccessful - build it again build(core, searcher); }
/** * Calls {@link #load(DataInput)} after converting * {@link InputStream} to {@link DataInput} */ public boolean load(InputStream input) throws IOException { DataInput dataIn = new InputStreamDataInput(input); try { return load(dataIn); } finally { IOUtils.close(input); } }
@Override public void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException { LOG.info("reload()"); if (dictionary == null && storeDir != null) { // this may be a firstSearcher event, try loading it FileInputStream is = new FileInputStream(new File(storeDir, factory.storeFileName())); try { if (lookup.load(is)) { return; // loaded ok } } finally { IOUtils.closeWhileHandlingException(is); } LOG.debug("load failed, need to build Lookup again"); } // loading was unsuccessful - build it again build(core, searcher); }
lookup.load(new FileInputStream(new File(storeDir, factory.storeFileName()))); } catch (IOException e) { LOG.warn("Loading stored lookup data failed", e);
lookup.load(new FileInputStream(new File(storeDir, factory.storeFileName()))); } catch (IOException e) { LOG.warn("Loading stored lookup data failed", e);