public class FilePadding
extends java.lang.Object
| Constructor | Description |
|---|---|
FilePadding() |
| Modifier and Type | Method | Description |
|---|---|---|
static long |
calculateFileSizeWithPadding(long position,
long fileSize,
long preAllocSize) |
Calculates a new file size with padding.
|
static long |
getPreAllocSize() |
Getter of preAllocSize has been added for testing
|
void |
setCurrentSize(long currentSize) |
|
static void |
setPreallocSize(long size) |
method to allow setting preallocate size
of log file to pad the file.
|
public static long getPreAllocSize()
public static void setPreallocSize(long size)
size - the size to set to in bytespublic void setCurrentSize(long currentSize)
public static long calculateFileSizeWithPadding(long position,
long fileSize,
long preAllocSize)
position - the point in the file we have written tofileSize - application keeps track of the current file sizepreAllocSize - how many bytes to padjava.io.IOExceptionCopyright © 2018 The Apache Software Foundation