|
18 | 18 | import io.weaviate.client6.v1.api.collections.Quantization; |
19 | 19 | import io.weaviate.client6.v1.api.collections.ReferenceProperty; |
20 | 20 | import io.weaviate.client6.v1.api.collections.Replication; |
| 21 | +import io.weaviate.client6.v1.api.collections.Replication.AsyncReplicationConfig; |
21 | 22 | import io.weaviate.client6.v1.api.collections.VectorConfig; |
22 | 23 | import io.weaviate.client6.v1.api.collections.config.Shard; |
23 | 24 | import io.weaviate.client6.v1.api.collections.config.ShardStatus; |
@@ -328,4 +329,53 @@ public void test_objectTtl() throws IOException { |
328 | 329 | .extracting(CollectionConfig::objectTtl).isNotNull() |
329 | 330 | .returns(false, ObjectTtl::enabled); |
330 | 331 | } |
| 332 | + |
| 333 | + @Test |
| 334 | + public void test_asyncReplicationConfig() throws IOException { |
| 335 | + Weaviate.Version.latest().orSkip(); |
| 336 | + |
| 337 | + // Arrange |
| 338 | + var nsThings = ns("Things"); |
| 339 | + |
| 340 | + // Act |
| 341 | + var things = client.collections.create(nsThings, |
| 342 | + c -> c.replication(Replication.of( |
| 343 | + repl -> repl |
| 344 | + .asyncEnabled(true) |
| 345 | + .asyncReplication(AsyncReplicationConfig.of( |
| 346 | + async -> async |
| 347 | + .hashTreeHeight(1) |
| 348 | + .maxWorkers(2) |
| 349 | + .frequencyMillis(3) |
| 350 | + .frequencyMillisWhilePropagating(4) |
| 351 | + .aliveNodesCheckingFrequencyMillis(5) |
| 352 | + .loggingFrequencySeconds(6) |
| 353 | + .diffBatchSize(7) |
| 354 | + .diffPerNodeTimeoutSeconds(8) |
| 355 | + .prePropagationTimeoutSeconds(9) |
| 356 | + .propagationTimeoutSeconds(10) |
| 357 | + .propagationDelayMillis(11) |
| 358 | + .propagationLimit(12) |
| 359 | + .propagationConcurrency(13) |
| 360 | + .propagationBatchSize(14)))))); |
| 361 | + |
| 362 | + // Assert |
| 363 | + Assertions.assertThat(things.config.get()).get() |
| 364 | + .extracting(CollectionConfig::replication) |
| 365 | + .extracting(Replication::asyncReplicationConfig) |
| 366 | + .returns(1, AsyncReplicationConfig::hashTreeHeight) |
| 367 | + .returns(2, AsyncReplicationConfig::maxWorkers) |
| 368 | + .returns(3, AsyncReplicationConfig::frequencyMillis) |
| 369 | + .returns(4, AsyncReplicationConfig::frequencyMillisWhilePropagating) |
| 370 | + .returns(5, AsyncReplicationConfig::aliveNodesCheckingFrequencyMillis) |
| 371 | + .returns(6, AsyncReplicationConfig::loggingFrequencySeconds) |
| 372 | + .returns(7, AsyncReplicationConfig::diffBatchSize) |
| 373 | + .returns(8, AsyncReplicationConfig::diffPerNodeTimeoutSeconds) |
| 374 | + .returns(9, AsyncReplicationConfig::prePropagationTimeoutSeconds) |
| 375 | + .returns(10, AsyncReplicationConfig::propagationTimeoutSeconds) |
| 376 | + .returns(11, AsyncReplicationConfig::propagationDelayMillis) |
| 377 | + .returns(12, AsyncReplicationConfig::propagationLimit) |
| 378 | + .returns(13, AsyncReplicationConfig::propagationConcurrency) |
| 379 | + .returns(14, AsyncReplicationConfig::propagationBatchSize); |
| 380 | + } |
331 | 381 | } |
0 commit comments