Revert to previous behavior of explicit init.
This commit is contained in:
Timothy Bish 2016-03-02 17:18:30 -05:00
parent e89b7a57f1
commit e8f44a29dd
1 changed files with 6 additions and 1 deletions

View File

@ -275,7 +275,12 @@ public class Journal {
private void doPreallocationZeros(RecoverableRandomAccessFile file) {
ByteBuffer buffer = ByteBuffer.allocate(maxFileLength);
buffer.limit(maxFileLength);
// intentional double initialization due to interaction with the OS level
// file allocation mechanics.
for (int i = 0; i < maxFileLength; i++) {
buffer.put((byte) 0x00);
}
buffer.flip();
try {
FileChannel channel = file.getChannel();