/** * You need to guarantee lock.acquire() before calling this method! */ protected void moveNextFile(final boolean scheduleReclaim) throws Exception { filesRepository.closeFile(currentFile); currentFile = filesRepository.openFile(); if (scheduleReclaim) { scheduleReclaim(); } if (logger.isTraceEnabled()) { logger.trace("Moving next file " + currentFile); } fileFactory.activateBuffer(currentFile.getFile()); }
/** * You need to guarantee lock.acquire() before calling this method! */ protected void moveNextFile(final boolean scheduleReclaim) throws Exception { filesRepository.closeFile(currentFile); currentFile = filesRepository.openFile(); if (scheduleReclaim) { scheduleReclaim(); } if (logger.isTraceEnabled()) { logger.trace("Moving next file " + currentFile); } fileFactory.activateBuffer(currentFile.getFile()); }
fileFactory.activateBuffer(journal.getCurrentFile().getFile()); throw ActiveMQJournalBundle.BUNDLE.fileNotOpened();
fileFactory.activateBuffer(journal.getCurrentFile().getFile()); throw ActiveMQJournalBundle.BUNDLE.fileNotOpened();
/** * @param lastDataPos * @return * @throws Exception */ protected JournalFile setUpCurrentFile(int lastDataPos) throws Exception { // Create any more files we need filesRepository.ensureMinFiles(); // The current file is the last one that has data currentFile = filesRepository.pollLastDataFile(); if (currentFile != null) { if (!currentFile.getFile().isOpen()) currentFile.getFile().open(); currentFile.getFile().position(currentFile.getFile().calculateBlockStart(lastDataPos)); } else { currentFile = filesRepository.getFreeFile(); filesRepository.openFile(currentFile, true); } fileFactory.activateBuffer(currentFile.getFile()); filesRepository.pushOpenedFile(); return currentFile; }
/** * @param lastDataPos * @return * @throws Exception */ protected JournalFile setUpCurrentFile(int lastDataPos) throws Exception { // Create any more files we need filesRepository.ensureMinFiles(); // The current file is the last one that has data currentFile = filesRepository.pollLastDataFile(); if (currentFile != null) { if (!currentFile.getFile().isOpen()) currentFile.getFile().open(); currentFile.getFile().position(currentFile.getFile().calculateBlockStart(lastDataPos)); } else { currentFile = filesRepository.getFreeFile(); filesRepository.openFile(currentFile, true); } fileFactory.activateBuffer(currentFile.getFile()); filesRepository.pushOpenedFile(); return currentFile; }