@Override public void stop() throws Exception { if (started.compareAndSet(true, false) && journal != null) { journal.close(); journal = null; } }
@Override protected void doStop(ServiceStopper stopper) throws Exception { for (LegacyJobSchedulerImpl js : this.schedulers.values()) { js.stop(); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; LOG.info(this + " stopped"); }
public void close() throws IOException, InterruptedException { if (opened.compareAndSet(true, false)) { checkpointLock.writeLock().lock(); try { if (metadata.page != null) { checkpointUpdate(getCleanupOnStop()); } pageFile.unload(); metadata = createMetadata(); } finally { checkpointLock.writeLock().unlock(); } journal.close(); synchronized(schedulerLock) { if (scheduler != null) { ThreadPoolUtils.shutdownGraceful(scheduler, -1); scheduler = null; } } // clear the cache and journalSize on shutdown of the store storeCache.clear(); journalSize.set(0); } }
@Override protected synchronized void doStop(ServiceStopper stopper) throws Exception { if (scheduler != null) { if (PListStoreImpl.class.getSimpleName().equals(scheduler.getName())) { scheduler.stop(); scheduler = null; } } for (PListImpl pl : this.persistentLists.values()) { pl.unload(null); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; this.initialized = false; LOG.info(this + " stopped"); }
journal.close(); journal = null;
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(); } }
@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 public void stop() throws Exception { if (started.compareAndSet(true, false) && journal != null) { journal.close(); journal = null; } }
@Override public void stop() throws Exception { if (started.compareAndSet(true, false) && journal != null) { journal.close(); journal = null; } }
@Override public void stop() throws Exception { if (started.compareAndSet(true, false) && journal != null) { journal.close(); journal = null; } }
public void close() throws IOException, InterruptedException { if (opened.compareAndSet(true, false)) { checkpointLock.writeLock().lock(); try { if (metadata.page != null) { checkpointUpdate(true); } pageFile.unload(); metadata = createMetadata(); } finally { checkpointLock.writeLock().unlock(); } journal.close(); synchronized(schedulerLock) { if (scheduler != null) { ThreadPoolUtils.shutdownGraceful(scheduler, -1); scheduler = null; } } // clear the cache and journalSize on shutdown of the store storeCache.clear(); journalSize.set(0); } }
@Override protected void doStop(ServiceStopper stopper) throws Exception { for (LegacyJobSchedulerImpl js : this.schedulers.values()) { js.stop(); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; LOG.info(this + " stopped"); }
@Override protected void doStop(ServiceStopper stopper) throws Exception { for (LegacyJobSchedulerImpl js : this.schedulers.values()) { js.stop(); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; LOG.info(this + " stopped"); }
@Override protected void doStop(ServiceStopper stopper) throws Exception { for (LegacyJobSchedulerImpl js : this.schedulers.values()) { js.stop(); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; LOG.info(this + " stopped"); }
@Override protected synchronized void doStop(ServiceStopper stopper) throws Exception { if (scheduler != null) { if (PListStoreImpl.class.getSimpleName().equals(scheduler.getName())) { scheduler.stop(); scheduler = null; } } for (PListImpl pl : this.persistentLists.values()) { pl.unload(null); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; this.initialized = false; LOG.info(this + " stopped"); }
@Override protected synchronized void doStop(ServiceStopper stopper) throws Exception { if (scheduler != null) { if (PListStoreImpl.class.getSimpleName().equals(scheduler.getName())) { scheduler.stop(); scheduler = null; } } for (PListImpl pl : this.persistentLists.values()) { pl.unload(null); } if (this.pageFile != null) { this.pageFile.unload(); } if (this.journal != null) { journal.close(); } if (this.lockFile != null) { this.lockFile.unlock(); } this.lockFile = null; this.initialized = false; LOG.info(this + " stopped"); }
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(); } }
@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(); } }