@Override public synchronized void start() { if (state != JournalState.STOPPED) { throw new IllegalStateException("Journal " + this + " is not stopped, state is " + state); } if (providedIOThreadPool == null) { ThreadFactory factory = AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ArtemisIOThread", true, JournalImpl.class.getClassLoader()); } }); threadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L,TimeUnit.SECONDS, new SynchronousQueue(), factory); ioExecutorFactory = new OrderedExecutorFactory(threadPool); } else { ioExecutorFactory = providedIOThreadPool; } filesExecutor = ioExecutorFactory.getExecutor(); compactorExecutor = ioExecutorFactory.getExecutor(); appendExecutor = ioExecutorFactory.getExecutor(); filesRepository.setExecutor(filesExecutor); fileFactory.start(); setJournalState(JournalState.STARTED); }
@Override public synchronized void start() { if (state != JournalState.STOPPED) { throw new IllegalStateException("Journal " + this + " is not stopped, state is " + state); } if (providedIOThreadPool == null) { ThreadFactory factory = AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ArtemisIOThread", true, JournalImpl.class.getClassLoader()); } }); threadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L,TimeUnit.SECONDS, new SynchronousQueue(), factory); ioExecutorFactory = new OrderedExecutorFactory(threadPool); } else { ioExecutorFactory = providedIOThreadPool; } filesExecutor = ioExecutorFactory.getExecutor(); compactorExecutor = ioExecutorFactory.getExecutor(); appendExecutor = ioExecutorFactory.getExecutor(); filesRepository.setExecutor(filesExecutor); fileFactory.start(); setJournalState(JournalState.STARTED); }
setJournalState(JournalState.STOPPED);
setJournalState(JournalState.STOPPED);
setJournalState(JournalState.SYNCING); return new JournalLoadInformation(0, -1); setJournalState(JournalState.LOADED);
setJournalState(JournalState.SYNCING); return new JournalLoadInformation(0, -1); setJournalState(JournalState.LOADED);