@@ -143,6 +143,10 @@ public GraphCreateOptions satellite(final Boolean satellite) {
143
143
return this ;
144
144
}
145
145
146
+ /**
147
+ * @deprecated use {@link #getWriteConcern()} instead
148
+ */
149
+ @ Deprecated
146
150
public Integer getMinReplicationFactor () {
147
151
return getOptions ().getMinReplicationFactor ();
148
152
}
@@ -157,12 +161,31 @@ public Integer getMinReplicationFactor() {
157
161
* are allowed. Having `minReplicationFactor > 1` requires additional insync copies on follower servers
158
162
* to allow writes.
159
163
* @return options
164
+ * @deprecated use {@link #writeConcern(Integer)} instead
160
165
*/
166
+ @ Deprecated
161
167
public GraphCreateOptions minReplicationFactor (final Integer minReplicationFactor ) {
162
168
getOptions ().setMinReplicationFactor (minReplicationFactor );
163
169
return this ;
164
170
}
165
171
172
+ public Integer getWriteConcern () {
173
+ return getOptions ().getWriteConcern ();
174
+ }
175
+
176
+ /**
177
+ * @param writeConcern Write concern for new collections in the graph.
178
+ * It determines how many copies of each shard are required to be in sync on the different
179
+ * DB-Servers. If there are less then these many copies in the cluster a shard will refuse to
180
+ * write. Writes to shards with enough up-to-date copies will succeed at the same time however.
181
+ * The value of writeConcern can not be larger than replicationFactor. (cluster only)
182
+ * @return options
183
+ */
184
+ public GraphCreateOptions writeConcern (final Integer writeConcern ) {
185
+ getOptions ().setWriteConcern (writeConcern );
186
+ return this ;
187
+ }
188
+
166
189
public Integer getNumberOfShards () {
167
190
return getOptions ().getNumberOfShards ();
168
191
}
@@ -216,6 +239,7 @@ private SmartOptions getOptions() {
216
239
public static class SmartOptions {
217
240
private ReplicationFactor replicationFactor ;
218
241
private Integer minReplicationFactor ;
242
+ private Integer writeConcern ;
219
243
private Integer numberOfShards ;
220
244
private String smartGraphAttribute ;
221
245
private Boolean isDisjoint ;
@@ -242,14 +266,30 @@ public void setSatellite(final Boolean satellite) {
242
266
replicationFactor .setSatellite (satellite );
243
267
}
244
268
269
+ /**
270
+ * @deprecated use {{@link #getWriteConcern()}} instead
271
+ */
272
+ @ Deprecated
245
273
public Integer getMinReplicationFactor () {
246
274
return minReplicationFactor ;
247
275
}
248
276
277
+ /**
278
+ * @deprecated use {{@link #setWriteConcern(Integer)}} instead
279
+ */
280
+ @ Deprecated
249
281
public void setMinReplicationFactor (final Integer minReplicationFactor ) {
250
282
this .minReplicationFactor = minReplicationFactor ;
251
283
}
252
284
285
+ public Integer getWriteConcern () {
286
+ return writeConcern ;
287
+ }
288
+
289
+ public void setWriteConcern (final Integer writeConcern ) {
290
+ this .writeConcern = writeConcern ;
291
+ }
292
+
253
293
public Integer getNumberOfShards () {
254
294
return numberOfShards ;
255
295
}
0 commit comments