private void applyCachePrimer(DatabaseConfig config) { if (mPageDb.isDurable()) { File primer = primerFile(); try { if (config.mCachePriming && primer.exists()) { if (mEventListener != null) { mEventListener.notify(EventType.RECOVERY_CACHE_PRIMING, "Cache priming"); } FileInputStream fin; try { fin = new FileInputStream(primer); try (InputStream bin = new BufferedInputStream(fin)) { applyCachePrimer(bin); } catch (IOException e) { fin.close(); } } catch (IOException e) { } } } finally { if (!mReadOnly) { primer.delete(); } } } }
private void applyCachePrimer(DatabaseConfig config) { if (mPageDb.isDurable()) { File primer = primerFile(); try { if (config.mCachePriming && primer.exists()) { if (mEventListener != null) { mEventListener.notify(EventType.RECOVERY_CACHE_PRIMING, "Cache priming"); } FileInputStream fin; try { fin = new FileInputStream(primer); try (InputStream bin = new BufferedInputStream(fin)) { applyCachePrimer(bin); } catch (IOException e) { fin.close(); primer.delete(); } } catch (IOException e) { } } } finally { primer.delete(); } } }
private void applyCachePrimer(DatabaseConfig config) { if (mPageDb.isDurable()) { File primer = primerFile(); try { if (config.mCachePriming && primer.exists()) { if (mEventListener != null) { mEventListener.notify(EventType.RECOVERY_CACHE_PRIMING, "Cache priming"); } FileInputStream fin; try { fin = new FileInputStream(primer); try (InputStream bin = new BufferedInputStream(fin)) { applyCachePrimer(bin); } catch (IOException e) { fin.close(); } } catch (IOException e) { } } } finally { if (!mReadOnly) { primer.delete(); } } } }
applyCachePrimer(config);