public void load() throws IOException { this.indexLock.writeLock().lock(); try { IOHelper.mkdirs(directory); if (deleteAllMessages) { getJournal().setCheckForCorruptionOnStartup(false); getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("Persistence store purged."); deleteAllMessages = false; } open(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
public void open() throws IOException { if( opened.compareAndSet(false, true) ) { getJournal().start(); try { loadPageFile(); } catch (Throwable t) { LOG.warn("Index corrupted. Recovering the index through journal replay. Cause:" + t); if (LOG.isDebugEnabled()) { LOG.debug("Index load failure", t); } // try to recover index try { pageFile.unload(); } catch (Exception ignore) {} if (archiveCorruptedIndex) { pageFile.archive(); } else { pageFile.delete(); } metadata = createMetadata(); //The metadata was recreated after a detect corruption so we need to //reconfigure anything that was configured on the old metadata on startup configureMetadata(); pageFile = null; loadPageFile(); } recover(); startCheckpoint(); } }
public void load() throws IOException { this.indexLock.writeLock().lock(); try { IOHelper.mkdirs(directory); if (deleteAllMessages) { getJournal().setCheckForCorruptionOnStartup(false); getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("Persistence store purged."); deleteAllMessages = false; } open(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
public void load() throws IOException { this.indexLock.writeLock().lock(); try { IOHelper.mkdirs(directory); if (deleteAllMessages) { getJournal().setCheckForCorruptionOnStartup(false); getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("Persistence store purged."); deleteAllMessages = false; } open(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
public void load() throws IOException { this.indexLock.writeLock().lock(); try { IOHelper.mkdirs(directory); if (deleteAllMessages) { getJournal().setCheckForCorruptionOnStartup(false); getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("Persistence store purged."); deleteAllMessages = false; } open(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
public void load() throws IOException { this.indexLock.writeLock().lock(); try { lock(); if (deleteAllMessages) { getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("Persistence store purged."); deleteAllMessages = false; } open(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); }finally { this.indexLock.writeLock().unlock(); } }
public void open() throws IOException { if( opened.compareAndSet(false, true) ) { getJournal().start(); loadPageFile(); startCheckpoint(); recover(); } }
public void open() throws IOException { if( opened.compareAndSet(false, true) ) { getJournal().start(); try { loadPageFile(); } catch (Throwable t) { LOG.warn("Index corrupted. Recovering the index through journal replay. Cause:" + t); if (LOG.isDebugEnabled()) { LOG.debug("Index load failure", t); } // try to recover index try { pageFile.unload(); } catch (Exception ignore) {} if (archiveCorruptedIndex) { pageFile.archive(); } else { pageFile.delete(); } metadata = createMetadata(); //The metadata was recreated after a detect corruption so we need to //reconfigure anything that was configured on the old metadata on startup configureMetadata(); pageFile = null; loadPageFile(); } recover(); startCheckpoint(); } }
public void open() throws IOException { if( opened.compareAndSet(false, true) ) { getJournal().start(); try { loadPageFile(); } catch (Throwable t) { LOG.warn("Index corrupted. Recovering the index through journal replay. Cause:" + t); if (LOG.isDebugEnabled()) { LOG.debug("Index load failure", t); } // try to recover index try { pageFile.unload(); } catch (Exception ignore) {} if (archiveCorruptedIndex) { pageFile.archive(); } else { pageFile.delete(); } metadata = createMetadata(); //The metadata was recreated after a detect corruption so we need to //reconfigure anything that was configured on the old metadata on startup configureMetadata(); pageFile = null; loadPageFile(); } recover(); startCheckpoint(); } }
public void open() throws IOException { if( opened.compareAndSet(false, true) ) { getJournal().start(); try { loadPageFile(); } catch (Throwable t) { LOG.warn("Index corrupted. Recovering the index through journal replay. Cause:" + t); if (LOG.isDebugEnabled()) { LOG.debug("Index load failure", t); } // try to recover index try { pageFile.unload(); } catch (Exception ignore) {} if (archiveCorruptedIndex) { pageFile.archive(); } else { pageFile.delete(); } metadata = createMetadata(); //The metadata was recreated after a detect corruption so we need to //reconfigure anything that was configured on the old metadata on startup configureMetadata(); pageFile = null; loadPageFile(); } recover(); startCheckpoint(); } }