-
Notifications
You must be signed in to change notification settings - Fork 97
/
IsolationLevel.scala
36 lines (30 loc) · 1004 Bytes
/
IsolationLevel.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* Copyright 2018-2022 OVO Energy Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
package fs2.kafka
/**
* The available options for [[ConsumerSettings#withIsolationLevel]].<br>
* <br>
* Available options include:<br>
* - [[IsolationLevel#ReadCommitted]] to only read committed records,<br>
* - [[IsolationLevel#ReadUncommitted]] to also read uncommitted records.
*/
sealed abstract class IsolationLevel
object IsolationLevel {
private[kafka] case object ReadCommittedIsolationLevel extends IsolationLevel {
override def toString: String = "ReadCommitted"
}
private[kafka] case object ReadUncommittedIsolationLevel extends IsolationLevel {
override def toString: String = "ReadUncommitted"
}
/**
* Option to only read committed records.
*/
val ReadCommitted: IsolationLevel = ReadCommittedIsolationLevel
/**
* Option to read both committed and uncommitted records.
*/
val ReadUncommitted: IsolationLevel = ReadUncommittedIsolationLevel
}