Class FileSystemUtils
- java.lang.Object
-
- org.apache.ignite.internal.processors.compress.FileSystemUtils
-
public final class FileSystemUtils extends Object
Native file system API.
-
-
Constructor Summary
Constructors Constructor Description FileSystemUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckSupported()static intgetFileSystemBlockSize(int fd)static intgetFileSystemBlockSize(Path path)static longgetSparseFileSize(int fd)!!!static longpunchHole(int fd, long off, long len, int fsBlockSize)
-
-
-
Method Detail
-
checkSupported
public static void checkSupported()
-
getFileSystemBlockSize
public static int getFileSystemBlockSize(Path path)
- Parameters:
path- File system path.- Returns:
- File system block size or negative value if not supported.
-
getFileSystemBlockSize
public static int getFileSystemBlockSize(int fd)
- Parameters:
fd- Native file descriptor.- Returns:
- File system block size or negative value if not supported.
-
getSparseFileSize
public static long getSparseFileSize(int fd)
!!! Use with caution. May produce unexpected results. Known to work correctly on Linux EXT4 and Btrfs, while on XSF it returns meaningful result only after file reopening.- Parameters:
fd- Native file descriptor.- Returns:
- Approximate system dependent size of the sparse file or negative value if not supported.
-
punchHole
public static long punchHole(int fd, long off, long len, int fsBlockSize)- Parameters:
fd- Native file descriptor.off- Offset of the hole.len- Length of the hole.fsBlockSize- File system block size.- Returns:
- Actual punched hole size.
-
-