File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
common/src/main/java/tech/ydb/common/transaction
query/src/main/java/tech/ydb/query/impl
table/src/main/java/tech/ydb/table/impl Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ public enum TxMode {
99
1010 SERIALIZABLE_RW ,
1111 SNAPSHOT_RO ,
12+ SNAPSHOT_RW ,
1213 STALE_RO ,
1314
1415 ONLINE_RO ,
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ class TxControl {
1616 .setSnapshotReadOnly (YdbQuery .SnapshotModeSettings .getDefaultInstance ())
1717 .build ();
1818
19+ private static final YdbQuery .TransactionSettings TS_SNAPSHOT_RW = YdbQuery .TransactionSettings .newBuilder ()
20+ .setSnapshotReadWrite (YdbQuery .SnapshotRWModeSettings .getDefaultInstance ())
21+ .build ();
22+
1923 private static final YdbQuery .TransactionSettings TS_STALE = YdbQuery .TransactionSettings .newBuilder ()
2024 .setStaleReadOnly (YdbQuery .StaleModeSettings .getDefaultInstance ())
2125 .build ();
@@ -55,15 +59,18 @@ public static YdbQuery.TransactionSettings txSettings(TxMode tx) {
5559 return TS_SERIALIZABLE ;
5660 case SNAPSHOT_RO :
5761 return TS_SNAPSHOT ;
62+ case SNAPSHOT_RW :
63+ return TS_SNAPSHOT_RW ;
5864 case STALE_RO :
5965 return TS_STALE ;
6066 case ONLINE_RO :
6167 return TS_ONLINE ;
6268 case ONLINE_INCONSISTENT_RO :
6369 return TS_ONLINE_INCONSISTENT ;
6470 case NONE :
65- default :
6671 return null ;
72+ default :
73+ throw new IllegalArgumentException ("Tx mode " + tx + " is not supported" );
6774 }
6875 }
6976
Original file line number Diff line number Diff line change @@ -61,9 +61,11 @@ public static YdbTable.TransactionSettings txSettings(TxMode tx) {
6161 return TS_ONLINE ;
6262 case ONLINE_INCONSISTENT_RO :
6363 return TS_ONLINE_INCONSISTENT ;
64+
6465 case NONE :
66+ case SNAPSHOT_RW :
6567 default :
66- return null ;
68+ throw new IllegalArgumentException ( "Tx mode " + tx + " is not supported in TableService" ) ;
6769 }
6870 }
6971}
You can’t perform that action at this time.
0 commit comments