kfaraz commented on code in PR #18302: URL: https://github.com/apache/druid/pull/18302#discussion_r2236189665
########## embedded-tests/src/test/java/org/apache/druid/testing/embedded/docker/DruidContainers.java: ########## @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.testing.embedded.docker; + +import org.apache.druid.testing.DruidCommand; + +/** + * Factory for {@link DruidContainerResource} that can run specific services. + * + * @see #newOverlord() + * @see #newCoordinator() + */ +public final class DruidContainers +{ + private DruidContainers() + { + // no instantiation + } + + /** + * Creates a new {@link DruidContainerResource} to run a Coordinator node. + */ + public static DruidContainerResource newCoordinator() + { + return new DruidContainerResource(DruidCommand.COORDINATOR) + .addProperty("druid.coordinator.startDelay", "PT0.1S") + .addProperty("druid.coordinator.period", "PT0.5S") + .addProperty("druid.manager.segments.pollDuration", "PT0.1S"); + } + + /** + * Creates a new {@link DruidContainerResource} to run an Overlord node. + */ + public static DruidContainerResource newOverlord() + { + // Keep a small sync timeout so that Peons and Indexers are not stuck + // handling a change request when Overlord has already shutdown + return new DruidContainerResource(DruidCommand.OVERLORD) + .addProperty("druid.indexer.storage.type", "metadata") + .addProperty("druid.indexer.queue.startDelay", "PT0S") + .addProperty("druid.indexer.queue.restartDelay", "PT0S") + .addProperty("druid.indexer.runner.syncRequestTimeout", "PT1S"); + } + + /** + * Creates a new {@link DruidContainerResource} to run an Indexer node. + */ + public static DruidContainerResource newIndexer() + { + return new DruidContainerResource(DruidCommand.INDEXER) + .addProperty("druid.lookup.enableLookupSyncOnStartup", "false") + .addProperty("druid.processing.buffer.sizeBytes", "50MiB") + .addProperty("druid.processing.numMergeBuffers", "2") + .addProperty("druid.processing.numThreads", "5"); + } Review Comment: Some of these properties might make it into DruidCommand itself if we feel that these are always needed out of the box whenever running a DruidContainer. I have just kept the minimal set in DruidCommand for now but will double check to confirm if some of these can't be moved there. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
