@@ -34,7 +34,7 @@ import org.junit.jupiter.params.provider.CsvSource
34
34
35
35
import java .util
36
36
import java .util .concurrent .atomic .AtomicInteger
37
- import java .util .{Collections , Optional , Properties }
37
+ import java .util .{Optional , Properties }
38
38
import scala .collection .Seq
39
39
import scala .concurrent .ExecutionException
40
40
import scala .util .Random
@@ -195,7 +195,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
195
195
topicConfig = topicConfig)
196
196
197
197
// 4. create a topic with `remote.log.copy.disable=false` and have different local.retention.ms and retention.ms value,
198
- // it should successfully creates the topic.
198
+ // it should successfully create the topic.
199
199
topicConfig.clear()
200
200
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
201
201
topicConfig.put(TopicConfig .LOCAL_LOG_RETENTION_MS_CONFIG , " 100" )
@@ -207,7 +207,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
207
207
// 5. alter the config to `remote.log.copy.disable=true`, it should fail the config change
208
208
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
209
209
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName3),
210
- util.Arrays .asList (
210
+ util.List .of (
211
211
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_COPY_DISABLE_CONFIG , " true" ),
212
212
AlterConfigOp .OpType .SET ),
213
213
))
@@ -217,7 +217,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
217
217
218
218
// 6. alter the config to `remote.log.copy.disable=true` and local.retention.ms == retention.ms, it should work without error
219
219
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName3),
220
- util.Arrays .asList (
220
+ util.List .of (
221
221
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_COPY_DISABLE_CONFIG , " true" ),
222
222
AlterConfigOp .OpType .SET ),
223
223
new AlterConfigOp (new ConfigEntry (TopicConfig .LOCAL_LOG_RETENTION_MS_CONFIG , " 1000" ),
@@ -260,7 +260,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
260
260
topicConfig = topicConfig)
261
261
262
262
// 4. create a topic with `remote.log.copy.disable=false` and have different local.retention.bytes and retention.bytes value,
263
- // it should successfully creates the topic.
263
+ // it should successfully create the topic.
264
264
topicConfig.clear()
265
265
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
266
266
topicConfig.put(TopicConfig .LOCAL_LOG_RETENTION_BYTES_CONFIG , " 100" )
@@ -272,7 +272,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
272
272
// 5. alter the config to `remote.log.copy.disable=true`, it should fail the config change
273
273
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
274
274
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName3),
275
- util.Arrays .asList (
275
+ util.List .of (
276
276
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_COPY_DISABLE_CONFIG , " true" ),
277
277
AlterConfigOp .OpType .SET ),
278
278
))
@@ -282,7 +282,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
282
282
283
283
// 6. alter the config to `remote.log.copy.disable=true` and local.retention.bytes == retention.bytes, it should work without error
284
284
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName3),
285
- util.Arrays .asList (
285
+ util.List .of (
286
286
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_COPY_DISABLE_CONFIG , " true" ),
287
287
AlterConfigOp .OpType .SET ),
288
288
new AlterConfigOp (new ConfigEntry (TopicConfig .LOCAL_LOG_RETENTION_BYTES_CONFIG , " 1000" ),
@@ -300,7 +300,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
300
300
301
301
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
302
302
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
303
- Collections .singleton (
303
+ util. Set .of (
304
304
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" ),
305
305
AlterConfigOp .OpType .SET ))
306
306
)
@@ -322,7 +322,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
322
322
TestUtils .createTopicWithAdmin(admin, testTopicName, brokers, controllerServers, numPartitions, numReplicationFactor)
323
323
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
324
324
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
325
- Collections .singleton (
325
+ util. Set .of (
326
326
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" ),
327
327
AlterConfigOp .OpType .SET ))
328
328
)
@@ -341,7 +341,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
341
341
342
342
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
343
343
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
344
- util.Arrays .asList (
344
+ util.List .of (
345
345
new AlterConfigOp (new ConfigEntry (TopicConfig .RETENTION_MS_CONFIG , " 200" ),
346
346
AlterConfigOp .OpType .SET ),
347
347
new AlterConfigOp (new ConfigEntry (TopicConfig .LOCAL_LOG_RETENTION_MS_CONFIG , " 100" ),
@@ -361,7 +361,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
361
361
362
362
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
363
363
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
364
- util.Arrays .asList (
364
+ util.List .of (
365
365
new AlterConfigOp (new ConfigEntry (TopicConfig .RETENTION_BYTES_CONFIG , " 200" ),
366
366
AlterConfigOp .OpType .SET ),
367
367
new AlterConfigOp (new ConfigEntry (TopicConfig .LOCAL_LOG_RETENTION_BYTES_CONFIG , " 100" ),
@@ -382,7 +382,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
382
382
// inherited local retention ms is 1000
383
383
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
384
384
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
385
- util.Arrays .asList (
385
+ util.List .of (
386
386
new AlterConfigOp (new ConfigEntry (TopicConfig .RETENTION_MS_CONFIG , " 200" ),
387
387
AlterConfigOp .OpType .SET ),
388
388
))
@@ -401,7 +401,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
401
401
// inherited local retention bytes is 1024
402
402
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
403
403
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
404
- util.Arrays .asList (
404
+ util.List .of (
405
405
new AlterConfigOp (new ConfigEntry (TopicConfig .RETENTION_BYTES_CONFIG , " 512" ),
406
406
AlterConfigOp .OpType .SET ),
407
407
))
@@ -420,7 +420,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
420
420
421
421
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
422
422
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
423
- util.Arrays .asList (
423
+ util.List .of (
424
424
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " false" ),
425
425
AlterConfigOp .OpType .SET ),
426
426
))
@@ -440,7 +440,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
440
440
441
441
val configs = new util.HashMap [ConfigResource , util.Collection [AlterConfigOp ]]()
442
442
configs.put(new ConfigResource (ConfigResource .Type .TOPIC , testTopicName),
443
- util.Arrays .asList (
443
+ util.List .of (
444
444
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " false" ),
445
445
AlterConfigOp .OpType .SET ),
446
446
new AlterConfigOp (new ConfigEntry (TopicConfig .REMOTE_LOG_DELETE_ON_DISABLE_CONFIG , " true" ),
@@ -598,7 +598,7 @@ class MyRemoteLogMetadataManager extends NoOpRemoteLogMetadataManager {
598
598
val timestamp = time.milliseconds()
599
599
val startOffset = idx * recordsPerSegment
600
600
val endOffset = startOffset + recordsPerSegment - 1
601
- val segmentLeaderEpochs : util.Map [Integer , java.lang.Long ] = Collections .singletonMap (0 , 0L )
601
+ val segmentLeaderEpochs : util.Map [Integer , java.lang.Long ] = util. Map .of (0 , 0L )
602
602
segmentMetadataList.add(new RemoteLogSegmentMetadata (new RemoteLogSegmentId (topicIdPartition, Uuid .randomUuid()), startOffset, endOffset, timestamp, 0 , timestamp, segmentSize, Optional .empty(), RemoteLogSegmentState .COPY_SEGMENT_FINISHED , segmentLeaderEpochs))
603
603
}
604
604
segmentMetadataList.iterator()
0 commit comments