FilePathReorderWrites

An unstable file system. It is used to simulate file system problems (for example out of disk space).

Methods
static boolean isPartialWrites()
static boolean isPartialWrites()
static FilePathReorderWrites register()
Register the file system.
static FilePathReorderWrites register()
Register the file system.
Returns:
the instance
static void setPartialWrites(boolean b)
Whether partial writes are possible (writing only part of the data).
static void setPartialWrites(boolean b)
Whether partial writes are possible (writing only part of the data).
Parameters:
b - true to enable
void checkError()
Check if the simulated problem occurred.
void checkError() throws IOException
Check if the simulated problem occurred. This call will decrement the countdown.
Throws:
IOException - if the simulated power failure occurred
void delete()
void delete()
long getMaxAge()
long getMaxAge()
int getPowerOffCountdown()
int getPowerOffCountdown()
Random getRandom()
Random getRandom()
ByteBuffer getRandomSubset(ByteBuffer src)
Get a buffer with a subset (the head) of the data of the source buffer.
ByteBuffer getRandomSubset(ByteBuffer src)
Get a buffer with a subset (the head) of the data of the source buffer.
Parameters:
src - the source buffer
Returns:
a buffer with a subset of the data
String getScheme()
String getScheme()
FileChannel open(String mode)
FileChannel open(String mode) throws IOException
void setPowerOffCountdown(int count, int seed)
Set the number of write operations before a simulated power failure, and the random seed (for partial writes).
void setPowerOffCountdown(int count, int seed)
Set the number of write operations before a simulated power failure, and the random seed (for partial writes).
Parameters:
count - the number of write operations (0 to never fail, Integer.MAX_VALUE to count the operations)
seed - the new seed

Fields
static boolean TRACE = false

TRACE = false

Whether trace output of all method calls is enabled.