Enum IsolationLevel
- java.lang.Object
-
- java.lang.Enum<IsolationLevel>
-
- org.apache.iceberg.IsolationLevel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IsolationLevel>
public enum IsolationLevel extends java.lang.Enum<IsolationLevel>
An isolation level in a table.Two isolation levels are supported: serializable and snapshot isolation. Both of them provide a read consistent view of the table to all operations and allow readers to see only already committed data. While serializable is the strongest isolation level in databases, snapshot isolation is beneficial for environments with many concurrent writers.
The serializable isolation level guarantees that an ongoing UPDATE/DELETE/MERGE operation fails if a concurrent transaction commits a new file that might contain rows matching the condition used in UPDATE/DELETE/MERGE. For example, if there is an ongoing update on a subset of rows and a concurrent transaction adds a new file with records that potentially match the update condition, the update operation must fail under the serializable isolation but can still commit under the snapshot isolation.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description SERIALIZABLE
SNAPSHOT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IsolationLevel
fromName(java.lang.String levelName)
static IsolationLevel
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static IsolationLevel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SERIALIZABLE
public static final IsolationLevel SERIALIZABLE
-
SNAPSHOT
public static final IsolationLevel SNAPSHOT
-
-
Method Detail
-
values
public static IsolationLevel[] 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 (IsolationLevel c : IsolationLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IsolationLevel 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
-
fromName
public static IsolationLevel fromName(java.lang.String levelName)
-
-