FileRecords open(
File file) throws IOException (1)
FileRecords open(
File file,
boolean mutable) throws IOException (2)
FileRecords open(
File file,
boolean mutable,
boolean fileAlreadyExists,
int initFileSize,
boolean preallocate) throws IOException
FileRecords open(
File file,
boolean fileAlreadyExists,
int initFileSize,
boolean preallocate) throws IOException
FileRecords
FileRecords is a concrete AbstractRecords…FIXME
FileRecords is created when…FIXME
Creating FileRecords Instance
FileRecords takes the following to be created:
FileRecords initializes the internal properties.
Opening Log File — open Utility
-
Turns
mutableflag on (true) -
Turns
fileAlreadyExistsflag off (false),initFileSizeas0, andpreallocateasfalse
open opens a FileChannel.
open determines the end of a FileRecords to be created:
-
0for the givenfileAlreadyExistsflag disabled (false) and the givenpreallocateflag enabled (true) -
Integer.MAX_VALUEotherwise
In the end, open creates a new FileRecords for the given file, the channel, and the isSlice flag disabled (false).
|
Note
|
|
Reading Log Batches (Into ByteBuffer) — readInto Method
void readInto(
ByteBuffer buffer,
int position) throws IOException
readInto…FIXME
|
Note
|
|
sizeInBytes Method
int sizeInBytes()
|
Note
|
sizeInBytes is part of the BaseRecords contract for the size of the records (in bytes).
|
sizeInBytes simply the current value of the size internal registry.
Opening FileChannel — openChannel Internal Method
FileChannel openChannel(
File file,
boolean mutable,
boolean fileAlreadyExists,
int initFileSize,
boolean preallocate) throws IOException
openChannel…FIXME
|
Note
|
openChannel is used when FileRecords utility is requested to open a log file.
|
Internal Properties
| Name | Description |
|---|---|
|
|
|
Size (java.util.concurrent.atomic.AtomicInteger) that is Used when…FIXME |