chia7712 commented on code in PR #22445:
URL: https://github.com/apache/kafka/pull/22445#discussion_r3367630045
##########
storage/src/test/java/org/apache/kafka/tiered/storage/utils/TieredStorageTestUtils.java:
##########
@@ -66,6 +73,34 @@ public class TieredStorageTestUtils {
private static final Integer RLM_TASK_INTERVAL_MS = 500;
private static final Integer RLMM_INIT_RETRY_INTERVAL_MS = 300;
+ public static List<LocalTieredStorage>
remoteStorageManagers(Collection<KafkaBroker> brokers) {
+ List<LocalTieredStorage> storages = new ArrayList<>();
+ brokers.forEach(broker -> {
+ if (broker.remoteLogManagerOpt().isDefined()) {
+ RemoteLogManager remoteLogManager =
broker.remoteLogManagerOpt().get();
+ RemoteStorageManager storageManager =
remoteLogManager.storageManager();
+ if (storageManager instanceof
ClassLoaderAwareRemoteStorageManager loaderAwareRSM) {
+ if (loaderAwareRSM.delegate() instanceof
LocalTieredStorage) {
+ storages.add((LocalTieredStorage)
loaderAwareRSM.delegate());
+ }
+ } else if (storageManager instanceof LocalTieredStorage) {
+ storages.add((LocalTieredStorage) storageManager);
+ }
+ } else {
+ throw new AssertionError("Broker " + broker.config().brokerId()
+ + " does not have a remote log manager.");
+ }
+ });
+ return storages;
+ }
+
+ public static List<BrokerLocalStorage>
localStorages(Collection<KafkaBroker> brokers) {
+ return brokers.stream()
+ .map(b -> new BrokerLocalStorage(b.config().brokerId(),
Set.copyOf(b.config().logDirs()),
+ STORAGE_WAIT_TIMEOUT_SEC))
+ .collect(Collectors.toList());
Review Comment:
`.toList`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]