Enum WALRecordType
- java.lang.Object
-
- java.lang.Enum<WALRecordType>
-
- edu.caltech.nanodb.storage.writeahead.WALRecordType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<WALRecordType>
public enum WALRecordType extends java.lang.Enum<WALRecordType>
This enumeration specifies the various types of records that can appear in the write-ahead log, along with their numeric values that actually appear within the write-ahead log.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABORT_TXN
The record represents a "<Ti: abort transaction>" record.COMMIT_TXN
The record represents a "<Ti: commit transaction>" record.START_TXN
The record represents a "<Ti: start transaction>" record.UPDATE_PAGE
The record represents a "<Ti: update P → P' >" record.UPDATE_PAGE_REDO_ONLY
The record represents a "<Ti: update P' (redo only)>" record.
-
Field Summary
Fields Modifier and Type Field Description private int
id
-
Constructor Summary
Constructors Modifier Constructor Description private
WALRecordType(int id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getID()
static WALRecordType
valueOf(int id)
Given a numeric type ID, returns the corresponding type value for the ID, or null if no type corresponds to the ID.static WALRecordType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static WALRecordType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
START_TXN
public static final WALRecordType START_TXN
The record represents a "<Ti: start transaction>" record.
-
UPDATE_PAGE
public static final WALRecordType UPDATE_PAGE
The record represents a "<Ti: update P → P' >" record.
-
UPDATE_PAGE_REDO_ONLY
public static final WALRecordType UPDATE_PAGE_REDO_ONLY
The record represents a "<Ti: update P' (redo only)>" record.
-
COMMIT_TXN
public static final WALRecordType COMMIT_TXN
The record represents a "<Ti: commit transaction>" record.
-
ABORT_TXN
public static final WALRecordType ABORT_TXN
The record represents a "<Ti: abort transaction>" record.
-
-
Method Detail
-
values
public static WALRecordType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WALRecordType c : WALRecordType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WALRecordType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getID
public int getID()
-
valueOf
public static WALRecordType valueOf(int id)
Given a numeric type ID, returns the corresponding type value for the ID, or null if no type corresponds to the ID.- Parameters:
id
- the numeric ID of the type to retrieve- Returns:
- the type-value with that ID, or null if not found
-
-