This class encapsulates the formats of Persistit journal records. There is
one inner class per record type. The following describes the byte layout
implemented by these classes.
All multi-byte integers are stored in big-endian form. General record format:
JH |
Journal Header: written as the first record of each journal file.
Identifies the version, creation timestamp of the journal, created timestamp
of the journal file and path to which journal file was originally written.
+16 |
Version (long) |
+24 |
Journal file size (long) |
+32 |
Current journal address (long) |
+40 |
Base journal address (long) |
+48 |
Journal created timestamp (long) |
+56 |
Journal file created timestamp (long) |
+64 |
Last valid checkpoint timestamp (long) |
+72 |
Reserved (8 bytes) |
+80 |
Journal File Path (variable - length determined by record length) |
|
JE |
Journal End: written as the last record of each journal file. Indicates
that the next valid record is in the next journal file, and confirms that the
journal file is complete. Lack of a JE record at the end of a journal file
indicates the system did not shut down normally.
+16 |
Current journal address (long) |
+24 |
Base journal address (long) |
+32 |
Journal created timestamp (long) |
|
IV |
Identify Volume: associates an integer handle to a Volume. This handle is
referenced by subsequent log records to identify this Volume. The handle has
no meaning beyond the scope of one log file; every new log generation gets
new IV records.
+16 |
Volume handle (int) |
+20 |
Volume Id (long) |
+28 |
Volume Path (variable - length determined by record length) |
|
IT |
Identify Tree: associates an integer handle to a Tree. This handle is
referenced by subsequent log records to identify this Tree. The handle has no
meaning beyond the scope of one log file; every new log generation gets new
IT records.
+16 |
Tree handle (int) |
+20 |
Volume handle (int) |
+24 |
Tree Name (variable - length determined by record length) |
|
PA |
Page Image
+16 |
Volume handle (int) - refers to a volume defined in a preceding IV record
|
+20 |
page address (long) |
+28 |
leftSize (int) |
+32 |
bytes: the first leftSize bytes will go into the page at offset 0 the
remaining bytes will go to the end of the page; the middle of the page will
be cleared |
|
PM |
Page Map: written once near the top of each journal file. Represents the
state of the page map at the time the journal rolled over.
+16 |
|
Instances of the following fixed-length structure (28 bytes), number
determined by overall record size
+0 |
Transaction timestamp (long) |
+8 |
Journal address (long) |
+16 |
Volume handle (int) - refers to a volume defined in a preceding IV record
|
+20 |
Page address (long) |
|
|
TM |
Transaction Map: written once near the top of each journal file.
Represents map of transactions still open (started, but neither rolled back
nor committed) at the time the journal rolled over.
+16 |
|
Instances of the following fixed-length structure (24 bytes) number
determined by overall record size
+0 |
Transaction timestamp (long) |
+8 |
Journal address (long) |
+16 |
isCommitted (byte) - indicates whether this transaction committed |
|
|
CP |
Checkpoint. Specifies a timestamp and a system time in millis at which
all pages modified prior to that timestamp are present in the log.
+16 |
System time in milliseconds (long) |
+24 |
Base journal address (long) |
|
TX |
Transaction update record - encapsulates a set of updates applied to the
database. This record type encapsulates SR, DR, DT, DV, and CU records
defined below.
+16 |
Commit timestamp, or -1 if the transaction has not committed. |
+24 |
Previous record journal address (long). |
+32 |
serialized updates as a series of contiguous SR, DR, DT, DV, and CU
records |
|
The following sub-record types are encapsulated inside of a TX record. Their
format differs from the main record types by not including timestamp or
backpointer fields.
SR |
Store Record - specifies a Tree into which a key/value pair should be
inserted
+8 |
Tree handle (int) - matches a tree identified in a preceding IT record |
+12 |
Key size (short) |
+14 |
Key bytes immediately followed by Value bytes (variable). |
|
DR |
Delete Record - specifies a Tree and two Keys: all key/value pairs
between these two keys (inclusive) are deleted. The Key bytes field defines
two keys, key1 and key2. These delimit the range to be deleted. The first
Key1_size bytes of this field contain the encoded key1 value. The remaining
bytes define key2. The first Elision_count bytes of Key2 are the same as
Key1; only the remaining unique bytes are stored in the record.
+8 |
Tree handle (int) - matches a tree identified in a preceding IT record |
+12 |
Key1_size (short) |
+14 |
Key2 Elision_count (short) |
+16 |
Key bytes |
|
DT |
Delete Tree - specifies a Tree to be deleted.
+8 |
Tree handle (int) - matches a tree identified in a preceding IT record |
|
DV |
Delete Volume - specifies a Volume to be deleted.
+8 |
Volume handle (int) - matches a volume identified in a preceding IV
record |
|
D1 |
Delta with 1 long-valued argument - encapsulates an update with argument
to a Delta (see @link Accumulator}
+8 |
Tree handle (int) - matches a tree identified in a preceding IT record |
instance
+12 |
index (char) - an Accumulator index |
+14 |
type (char) - type of Accumulator (0=SUM, 1=MAX, 2=MIN, 3=SEQ) |
+16 |
argument (long) - value by which the Delta is to be adjusted |
|
D0 |
Delta with no argument - encapsulates an update with a argument value of
1 to a Delta (see @link Accumulator}
+8 |
Tree handle (int) - matches a tree identified in a preceding IT record |
instance
+12 |
index (char) - an Accumulator index |
+14 |
type (char) - type of Accumulator (0=SUM, 1=MAX, 2=MIN, 3=SEQ) |
|