Skip to content

Commit

Permalink
Minor improvements to Dev Service config javadoc
Browse files Browse the repository at this point in the history
Mostly formatting and style, some phrasing.
  • Loading branch information
yrodiere committed Dec 21, 2023
1 parent 6884f92 commit bc9191c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public interface DataSourceBuildTimeConfig {
Optional<String> dbVersion();

/**
* Configuration for DevServices. DevServices allows Quarkus to automatically start a database in dev and test mode.
* Configuration for Dev Services.
* <p>
* Dev Services allow Quarkus to automatically start a database in dev and test mode.
*/
DevServicesBuildTimeConfig devservices();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
public interface DevServicesBuildTimeConfig {

/**
* If DevServices has been explicitly enabled or disabled.
* DevServices is generally enabled by default unless an existing configuration is present.
* Whether this Dev Service should start with the application in dev mode or tests.
*
* When DevServices is enabled, Quarkus will attempt to automatically configure and start a database when running in Dev or
* Test mode.
* Dev Services are enabled by default
* unless connection configuration (e.g. the JDBC URL or reactive client URL) is set explicitly.
*
* @asciidoclet
*/
Optional<Boolean> enabled();

/**
* The container image name for container-based DevServices providers.
*
* The container image name for container-based Dev Service providers.
* <p>
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
*/
Optional<String> imageName();
Expand Down Expand Up @@ -51,8 +52,8 @@ public interface DevServicesBuildTimeConfig {
OptionalInt port();

/**
* The container start command to use for container-based DevServices providers.
*
* The container start command to use for container-based Dev Service providers.
* <p>
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
*/
Optional<String> command();
Expand All @@ -74,20 +75,21 @@ public interface DevServicesBuildTimeConfig {

/**
* The path to a SQL script to be loaded from the classpath and applied to the Dev Service database.
*
* <p>
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
*/
Optional<String> initScriptPath();

/**
* The volumes to be mapped to the container.
* <p>
* The map key corresponds to the host location; the map value is the container location.
* If the host location starts with "classpath:",
* the mapping loads the resource from the classpath with read-only permission.
*
* <p>
* When using a file system location, the volume will be generated with read-write permission,
* potentially leading to data loss or modification in your file system.
*
* <p>
* This has no effect if the provider is not a container-based database, such as H2 or Derby.
*/
Map<String, String> volumes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
public class ElasticsearchDevServicesBuildTimeConfig {

/**
* If Dev Services for Elasticsearch has been explicitly enabled or disabled. Dev Services are generally enabled
* by default, unless there is an existing configuration present. For Elasticsearch, Dev Services starts a server unless
* {@code quarkus.elasticsearch.hosts} is set.
* Whether this Dev Service should start with the application in dev mode or tests.
*
* Dev Services are enabled by default
* unless connection configuration (e.g. `quarkus.elasticsearch.hosts`) is set explicitly.
*
* @asciidoclet
*/
@ConfigItem
public Optional<Boolean> enabled = Optional.empty();
Expand All @@ -28,6 +31,8 @@ public class ElasticsearchDevServicesBuildTimeConfig {
public Optional<Integer> port;

/**
* The Elasticsearch distribution to use.
*
* Defaults to a distribution inferred from the explicitly configured `image-name` (if any),
* or by default to the distribution configured in depending extensions (e.g. Hibernate Search),
* or by default to `elastic`.
Expand All @@ -39,6 +44,7 @@ public class ElasticsearchDevServicesBuildTimeConfig {

/**
* The Elasticsearch container image to use.
*
* Defaults depend on the configured `distribution`:
*
* * For the `elastic` distribution: {elasticsearch-image}
Expand All @@ -51,13 +57,15 @@ public class ElasticsearchDevServicesBuildTimeConfig {

/**
* The value for the ES_JAVA_OPTS env variable.
* Defaults to setting the heap to 512MB min - 1GB max.
*
* @asciidoclet
*/
@ConfigItem(defaultValue = "-Xms512m -Xmx1g")
public String javaOpts;

/**
* Indicates if the Elasticsearch server managed by Quarkus Dev Services is shared.
* Whether the Elasticsearch server managed by Quarkus Dev Services is shared.
* <p>
* When shared, Quarkus looks for running containers using label-based service discovery.
* If a matching container is found, it is used, and so a second one is not started.
* Otherwise, Dev Services for Elasticsearch starts a new container.
Expand All @@ -72,6 +80,7 @@ public class ElasticsearchDevServicesBuildTimeConfig {

/**
* The value of the {@code quarkus-dev-service-elasticsearch} label attached to the started container.
* <p>
* This property is used when {@code shared} is set to {@code true}.
* In this case, before starting a container, Dev Services for Elasticsearch looks for a container with the
* {@code quarkus-dev-service-elasticsearch} label
Expand Down

0 comments on commit bc9191c

Please sign in to comment.