private void doPreallocationKernelCopy(RecoverableRandomAccessFile file) { try (RandomAccessFile templateRaf = new RandomAccessFile(osKernelCopyTemplateFile, "rw");){ templateRaf.getChannel().transferTo(0, getMaxFileLength(), file.getChannel()); } catch (ClosedByInterruptException ignored) { LOG.trace("Could not preallocate journal file with kernel copy", ignored); } catch (FileNotFoundException e) { LOG.error("Could not find the template file on disk at " + osKernelCopyTemplateFile.getAbsolutePath(), e); } catch (IOException e) { LOG.error("Could not transfer the template file to journal, transferFile=" + osKernelCopyTemplateFile.getAbsolutePath(), e); } }
public boolean canAppend(Journal.WriteCommand write) { int newSize = size + write.location.getSize(); if (newSize >= maxWriteBatchSize || offset+newSize > journal.getMaxFileLength() ) { return false; } return true; }
preAllocateDirectBuffer = allocateDirectBuffer(getMaxFileLength());
public boolean canAppend(Journal.WriteCommand write) { int newSize = size + write.location.getSize(); if (newSize >= maxWriteBatchSize || offset+newSize > journal.getMaxFileLength() ) { return false; } return true; }
public boolean canAppend(Journal.WriteCommand write) { int newSize = size + write.location.getSize(); if (newSize >= maxWriteBatchSize || offset+newSize > journal.getMaxFileLength() ) { return false; } return true; }
private void doPreallocationKernelCopy(RecoverableRandomAccessFile file) { try (RandomAccessFile templateRaf = new RandomAccessFile(osKernelCopyTemplateFile, "rw");){ templateRaf.getChannel().transferTo(0, getMaxFileLength(), file.getChannel()); } catch (ClosedByInterruptException ignored) { LOG.trace("Could not preallocate journal file with kernel copy", ignored); } catch (FileNotFoundException e) { LOG.error("Could not find the template file on disk at " + osKernelCopyTemplateFile.getAbsolutePath(), e); } catch (IOException e) { LOG.error("Could not transfer the template file to journal, transferFile=" + osKernelCopyTemplateFile.getAbsolutePath(), e); } }
public boolean canAppend(Journal.WriteCommand write) { int newSize = size + write.location.getSize(); if (newSize >= maxWriteBatchSize || offset+newSize > journal.getMaxFileLength() ) { return false; } return true; }
private void doPreallocationKernelCopy(RecoverableRandomAccessFile file) { try (RandomAccessFile templateRaf = new RandomAccessFile(osKernelCopyTemplateFile, "rw");){ templateRaf.getChannel().transferTo(0, getMaxFileLength(), file.getChannel()); } catch (ClosedByInterruptException ignored) { LOG.trace("Could not preallocate journal file with kernel copy", ignored); } catch (FileNotFoundException e) { LOG.error("Could not find the template file on disk at " + osKernelCopyTemplateFile.getAbsolutePath(), e); } catch (IOException e) { LOG.error("Could not transfer the template file to journal, transferFile=" + osKernelCopyTemplateFile.getAbsolutePath(), e); } }
private void doPreallocationKernelCopy(RecoverableRandomAccessFile file) { try (RandomAccessFile templateRaf = new RandomAccessFile(osKernelCopyTemplateFile, "rw");){ templateRaf.getChannel().transferTo(0, getMaxFileLength(), file.getChannel()); } catch (ClosedByInterruptException ignored) { LOG.trace("Could not preallocate journal file with kernel copy", ignored); } catch (FileNotFoundException e) { LOG.error("Could not find the template file on disk at " + osKernelCopyTemplateFile.getAbsolutePath(), e); } catch (IOException e) { LOG.error("Could not transfer the template file to journal, transferFile=" + osKernelCopyTemplateFile.getAbsolutePath(), e); } }
preAllocateDirectBuffer = allocateDirectBuffer(getMaxFileLength());
preAllocateDirectBuffer = allocateDirectBuffer(getMaxFileLength());
preAllocateDirectBuffer = allocateDirectBuffer(getMaxFileLength());