fileFactory.deactivateBuffer();
fileFactory.deactivateBuffer();
public void closeFile(final JournalFile file) throws Exception { fileFactory.deactivateBuffer(); file.getFile().close(); if (!dataFiles.contains(file)) { // This is not a retry from openFile // If you don't check this then retries keep adding the same file into // dataFiles list and the compactor then re-adds multiple copies of the // same file into freeFiles. // The consequence of that is that you can end up with the same file // twice in a row in the list of openedFiles // The consequence of that is that JournalImpl::switchFileIfNecessary // will throw throw new IllegalStateException("Invalid logic on buffer allocation") // because the file will be checked effectively twice and the buffer will // not fit in it dataFiles.add(file); } }
public void closeFile(final JournalFile file) throws Exception { fileFactory.deactivateBuffer(); file.getFile().close(); if (!dataFiles.contains(file)) { // This is not a retry from openFile // If you don't check this then retries keep adding the same file into // dataFiles list and the compactor then re-adds multiple copies of the // same file into freeFiles. // The consequence of that is that you can end up with the same file // twice in a row in the list of openedFiles // The consequence of that is that JournalImpl::switchFileIfNecessary // will throw throw new IllegalStateException("Invalid logic on buffer allocation") // because the file will be checked effectively twice and the buffer will // not fit in it dataFiles.add(file); } }