/** * Deletes the files used by the PageFile object. This method can only be used when this object is not loaded. * * @throws IOException if the files cannot be deleted. * @throws IllegalStateException if this PageFile is loaded */ public void delete() throws IOException { if (loaded.get()) { throw new IllegalStateException("Cannot delete page file data when the page file is loaded"); } delete(getMainPageFile()); delete(getFreeFile()); delete(getRecoveryFile()); }
public void load() throws IOException { synchronized (indexMutex) { open(); pageFile.unload(); pageFile.delete(); loadPageFile(); } }
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(); } }
pageFile.archive(); } else { pageFile.delete();
@Override protected void doStart() throws Exception { this.indexLock.writeLock().lock(); if (getDirectory() == null) { setDirectory(getDefaultDataDirectory()); } IOHelper.mkdirs(getDirectory()); try { if (isPurgeStoreOnStartup()) { getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("{} Persistence store purged.", this); setPurgeStoreOnStartup(false); } load(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
/** * Deletes the files used by the PageFile object. This method can only be used when this object is not loaded. * * @throws IOException if the files cannot be deleted. * @throws IllegalStateException if this PageFile is loaded */ public void delete() throws IOException { if (loaded.get()) { throw new IllegalStateException("Cannot delete page file data when the page file is loaded"); } delete(getMainPageFile()); delete(getFreeFile()); delete(getRecoveryFile()); }
/** * Deletes the files used by the PageFile object. This method can only be used when this object is not loaded. * * @throws IOException if the files cannot be deleted. * @throws IllegalStateException if this PageFile is loaded */ public void delete() throws IOException { if (loaded.get()) { throw new IllegalStateException("Cannot delete page file data when the page file is loaded"); } delete(getMainPageFile()); delete(getFreeFile()); delete(getRecoveryFile()); }
/** * Deletes the files used by the PageFile object. This method can only be used when this object is not loaded. * * @throws IOException if the files cannot be deleted. * @throws IllegalStateException if this PageFile is loaded */ public void delete() throws IOException { if (loaded.get()) { throw new IllegalStateException("Cannot delete page file data when the page file is loaded"); } delete(getMainPageFile()); delete(getFreeFile()); delete(getRecoveryFile()); }
public void load() throws IOException { synchronized (indexMutex) { open(); pageFile.unload(); pageFile.delete(); loadPageFile(); } }
public void load() throws IOException { synchronized (indexMutex) { open(); pageFile.unload(); pageFile.delete(); loadPageFile(); } }
public void load() throws IOException { synchronized (indexMutex) { open(); pageFile.unload(); pageFile.delete(); loadPageFile(); } }
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 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(); } }
@Override protected void doStart() throws Exception { this.indexLock.writeLock().lock(); if (getDirectory() == null) { setDirectory(getDefaultDataDirectory()); } IOHelper.mkdirs(getDirectory()); try { if (isPurgeStoreOnStartup()) { getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("{} Persistence store purged.", this); setPurgeStoreOnStartup(false); } load(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
@Override protected void doStart() throws Exception { this.indexLock.writeLock().lock(); if (getDirectory() == null) { setDirectory(getDefaultDataDirectory()); } IOHelper.mkdirs(getDirectory()); try { if (isPurgeStoreOnStartup()) { getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("{} Persistence store purged.", this); setPurgeStoreOnStartup(false); } load(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }
@Override protected void doStart() throws Exception { this.indexLock.writeLock().lock(); if (getDirectory() == null) { setDirectory(getDefaultDataDirectory()); } IOHelper.mkdirs(getDirectory()); try { if (isPurgeStoreOnStartup()) { getJournal().start(); getJournal().delete(); getJournal().close(); journal = null; getPageFile().delete(); LOG.info("{} Persistence store purged.", this); setPurgeStoreOnStartup(false); } load(); store(new KahaTraceCommand().setMessage("LOADED " + new Date())); } finally { this.indexLock.writeLock().unlock(); } }