public class FilePadding extends Object
Constructor and Description |
---|
FilePadding() |
Modifier and Type | Method and 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 padIOException
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.