@@ -33,6 +33,9 @@ public class ConsensusCommitConfig {
3333 public static final String ASYNC_COMMIT_ENABLED = PREFIX + "async_commit.enabled" ;
3434 public static final String ASYNC_ROLLBACK_ENABLED = PREFIX + "async_rollback.enabled" ;
3535
36+ public static final String COORDINATOR_WRITE_OMISSION_ON_READ_ONLY_ENABLED =
37+ PREFIX + "coordinator.write_omission_on_read_only.enabled" ;
38+
3639 public static final String PARALLEL_IMPLICIT_PRE_READ =
3740 PREFIX + "parallel_implicit_pre_read.enabled" ;
3841
@@ -73,10 +76,12 @@ public class ConsensusCommitConfig {
7376 private final boolean asyncCommitEnabled ;
7477 private final boolean asyncRollbackEnabled ;
7578
76- private final boolean isIncludeMetadataEnabled ;
79+ private final boolean coordinatorWriteOmissionOnReadOnlyEnabled ;
7780
7881 private final boolean parallelImplicitPreReadEnabled ;
7982
83+ private final boolean isIncludeMetadataEnabled ;
84+
8085 private final boolean coordinatorGroupCommitEnabled ;
8186 private final int coordinatorGroupCommitSlotCapacity ;
8287 private final int coordinatorGroupCommitGroupSizeFixTimeoutMillis ;
@@ -92,7 +97,9 @@ public ConsensusCommitConfig(DatabaseConfig databaseConfig) {
9297 DatabaseConfig .TRANSACTION_MANAGER + " should be '" + TRANSACTION_MANAGER_NAME + "'" );
9398 }
9499
95- if (databaseConfig .getProperties ().containsKey ("scalar.db.isolation_level" )) {
100+ Properties properties = databaseConfig .getProperties ();
101+
102+ if (properties .containsKey ("scalar.db.isolation_level" )) {
96103 logger .warn (
97104 "The property \" scalar.db.isolation_level\" is deprecated and will be removed in 5.0.0. "
98105 + "Please use \" "
@@ -102,91 +109,78 @@ public ConsensusCommitConfig(DatabaseConfig databaseConfig) {
102109 isolation =
103110 Isolation .valueOf (
104111 getString (
105- databaseConfig . getProperties () ,
112+ properties ,
106113 ISOLATION_LEVEL ,
107114 getString (
108- databaseConfig . getProperties () ,
115+ properties ,
109116 "scalar.db.isolation_level" , // for backward compatibility
110117 Isolation .SNAPSHOT .toString ()))
111118 .toUpperCase (Locale .ROOT ));
112119 if (isolation .equals (Isolation .SERIALIZABLE )) {
113120 validateCrossPartitionScanConfig (databaseConfig );
114121
115- if (databaseConfig
116- .getProperties ()
117- .containsKey ("scalar.db.consensus_commit.serializable_strategy" )) {
122+ if (properties .containsKey ("scalar.db.consensus_commit.serializable_strategy" )) {
118123 logger .warn (
119124 "The property \" scalar.db.consensus_commit.serializable_strategy\" is deprecated and will "
120125 + "be removed in 5.0.0. The EXTRA_READ strategy is always used for the SERIALIZABLE "
121126 + "isolation level." );
122127 }
123128 }
124129
125- coordinatorNamespace = getString (databaseConfig . getProperties () , COORDINATOR_NAMESPACE , null );
130+ coordinatorNamespace = getString (properties , COORDINATOR_NAMESPACE , null );
126131
127132 parallelExecutorCount =
128- getInt (
129- databaseConfig .getProperties (),
130- PARALLEL_EXECUTOR_COUNT ,
131- DEFAULT_PARALLEL_EXECUTOR_COUNT );
132- parallelPreparationEnabled =
133- getBoolean (databaseConfig .getProperties (), PARALLEL_PREPARATION_ENABLED , true );
134- parallelCommitEnabled =
135- getBoolean (databaseConfig .getProperties (), PARALLEL_COMMIT_ENABLED , true );
133+ getInt (properties , PARALLEL_EXECUTOR_COUNT , DEFAULT_PARALLEL_EXECUTOR_COUNT );
134+ parallelPreparationEnabled = getBoolean (properties , PARALLEL_PREPARATION_ENABLED , true );
135+ parallelCommitEnabled = getBoolean (properties , PARALLEL_COMMIT_ENABLED , true );
136136
137137 // Use the value of parallel commit for parallel validation and parallel rollback as default
138138 // value
139139 parallelValidationEnabled =
140- getBoolean (
141- databaseConfig .getProperties (), PARALLEL_VALIDATION_ENABLED , parallelCommitEnabled );
140+ getBoolean (properties , PARALLEL_VALIDATION_ENABLED , parallelCommitEnabled );
142141 parallelRollbackEnabled =
143- getBoolean (
144- databaseConfig .getProperties (), PARALLEL_ROLLBACK_ENABLED , parallelCommitEnabled );
142+ getBoolean (properties , PARALLEL_ROLLBACK_ENABLED , parallelCommitEnabled );
145143
146- asyncCommitEnabled = getBoolean (databaseConfig . getProperties () , ASYNC_COMMIT_ENABLED , false );
144+ asyncCommitEnabled = getBoolean (properties , ASYNC_COMMIT_ENABLED , false );
147145
148146 // Use the value of async commit for async rollback as default value
149- asyncRollbackEnabled =
150- getBoolean (databaseConfig .getProperties (), ASYNC_ROLLBACK_ENABLED , asyncCommitEnabled );
147+ asyncRollbackEnabled = getBoolean (properties , ASYNC_ROLLBACK_ENABLED , asyncCommitEnabled );
148+
149+ coordinatorWriteOmissionOnReadOnlyEnabled =
150+ getBoolean (properties , COORDINATOR_WRITE_OMISSION_ON_READ_ONLY_ENABLED , true );
151151
152- isIncludeMetadataEnabled =
153- getBoolean (databaseConfig .getProperties (), INCLUDE_METADATA_ENABLED , false );
152+ parallelImplicitPreReadEnabled = getBoolean (properties , PARALLEL_IMPLICIT_PRE_READ , true );
154153
155- parallelImplicitPreReadEnabled =
156- getBoolean (databaseConfig .getProperties (), PARALLEL_IMPLICIT_PRE_READ , true );
154+ isIncludeMetadataEnabled = getBoolean (properties , INCLUDE_METADATA_ENABLED , false );
157155
158- coordinatorGroupCommitEnabled =
159- getBoolean (databaseConfig .getProperties (), COORDINATOR_GROUP_COMMIT_ENABLED , false );
156+ coordinatorGroupCommitEnabled = getBoolean (properties , COORDINATOR_GROUP_COMMIT_ENABLED , false );
160157 coordinatorGroupCommitSlotCapacity =
161158 getInt (
162- databaseConfig . getProperties () ,
159+ properties ,
163160 COORDINATOR_GROUP_COMMIT_SLOT_CAPACITY ,
164161 DEFAULT_COORDINATOR_GROUP_COMMIT_SLOT_CAPACITY );
165162 coordinatorGroupCommitGroupSizeFixTimeoutMillis =
166163 getInt (
167- databaseConfig . getProperties () ,
164+ properties ,
168165 COORDINATOR_GROUP_COMMIT_GROUP_SIZE_FIX_TIMEOUT_MILLIS ,
169166 DEFAULT_COORDINATOR_GROUP_COMMIT_GROUP_SIZE_FIX_TIMEOUT_MILLIS );
170167 coordinatorGroupCommitDelayedSlotMoveTimeoutMillis =
171168 getInt (
172- databaseConfig . getProperties () ,
169+ properties ,
173170 COORDINATOR_GROUP_COMMIT_DELAYED_SLOT_MOVE_TIMEOUT_MILLIS ,
174171 DEFAULT_COORDINATOR_GROUP_COMMIT_DELAYED_SLOT_MOVE_TIMEOUT_MILLIS );
175172 coordinatorGroupCommitOldGroupAbortTimeoutMillis =
176173 getInt (
177- databaseConfig . getProperties () ,
174+ properties ,
178175 COORDINATOR_GROUP_COMMIT_OLD_GROUP_ABORT_TIMEOUT_MILLIS ,
179176 DEFAULT_COORDINATOR_GROUP_COMMIT_OLD_GROUP_ABORT_TIMEOUT_MILLIS );
180177 coordinatorGroupCommitTimeoutCheckIntervalMillis =
181178 getInt (
182- databaseConfig . getProperties () ,
179+ properties ,
183180 COORDINATOR_GROUP_COMMIT_TIMEOUT_CHECK_INTERVAL_MILLIS ,
184181 DEFAULT_COORDINATOR_GROUP_COMMIT_TIMEOUT_CHECK_INTERVAL_MILLIS );
185182 coordinatorGroupCommitMetricsMonitorLogEnabled =
186- getBoolean (
187- databaseConfig .getProperties (),
188- COORDINATOR_GROUP_COMMIT_METRICS_MONITOR_LOG_ENABLED ,
189- false );
183+ getBoolean (properties , COORDINATOR_GROUP_COMMIT_METRICS_MONITOR_LOG_ENABLED , false );
190184 }
191185
192186 public Isolation getIsolation () {
@@ -225,14 +219,18 @@ public boolean isAsyncRollbackEnabled() {
225219 return asyncRollbackEnabled ;
226220 }
227221
228- public boolean isIncludeMetadataEnabled () {
229- return isIncludeMetadataEnabled ;
222+ public boolean isCoordinatorWriteOmissionOnReadOnlyEnabled () {
223+ return coordinatorWriteOmissionOnReadOnlyEnabled ;
230224 }
231225
232226 public boolean isParallelImplicitPreReadEnabled () {
233227 return parallelImplicitPreReadEnabled ;
234228 }
235229
230+ public boolean isIncludeMetadataEnabled () {
231+ return isIncludeMetadataEnabled ;
232+ }
233+
236234 public boolean isCoordinatorGroupCommitEnabled () {
237235 return coordinatorGroupCommitEnabled ;
238236 }
0 commit comments