Skip to content

Commit

Permalink
Replace usage of deprecated ConfigProperties with ConfigMapping
Browse files Browse the repository at this point in the history
  • Loading branch information
nastra committed Aug 24, 2021
1 parent a9a7c5b commit 525ddef
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<openapi.version>2.0</openapi.version>
<prometheus.version>0.9.0</prometheus.version>
<protobuf.version>3.17.3</protobuf.version>
<quarkus.version>2.1.3.Final</quarkus.version>
<quarkus.version>2.2.0.CR1</quarkus.version>
<reactor.version>2020.0.10</reactor.version>
<scala2.12.version>2.12.13</scala2.12.version>
<scala2.13.version>2.13.6</scala2.13.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import org.projectnessie.versioned.dynamodb.DynamoStoreConfig;

/** DynamoDB version store configuration. */
@ConfigProperties(prefix = "nessie.version.store.dynamo")
@ConfigMapping(prefix = "nessie.version.store.dynamo")
public interface DynamoVersionStoreConfig {

@ConfigProperty(name = "initialize", defaultValue = "false")
@WithName("initialize")
@WithDefault("false")
boolean isDynamoInitialize();

@ConfigProperty(defaultValue = DynamoStoreConfig.TABLE_PREFIX)
@WithName("table-prefix")
@WithDefault(DynamoStoreConfig.TABLE_PREFIX)
String getTablePrefix();

@ConfigProperty(name = "tracing", defaultValue = "true")
@WithName("tracing")
@WithDefault("true")
boolean enableTracing();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import io.quarkus.runtime.annotations.RegisterForReflection;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import java.util.Optional;
import org.eclipse.microprofile.config.inject.ConfigProperty;

/** JGit version store configuration. */
@ConfigProperties(prefix = "nessie.version.store.jgit")
@ConfigMapping(prefix = "nessie.version.store.jgit")
public interface JGitVersionStoreConfig {
@RegisterForReflection
public enum JGitStoreType {
DISK,
INMEMORY
}

@ConfigProperty(name = "type", defaultValue = "INMEMORY")
@WithName("type")
@WithDefault("INMEMORY")
JGitStoreType getJgitStoreType();

@ConfigProperty(name = "directory")
@WithName("directory")
Optional<String> getJgitDirectory();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import org.projectnessie.services.config.ServerConfig;

/** Nessie server config for Quarkus. */
@ConfigProperties(prefix = "nessie.server")
@ConfigMapping(prefix = "nessie.server")
public interface QuarkusServerConfig extends ServerConfig {

@ConfigProperty(name = "default-branch", defaultValue = "main")
@Override
@WithName("default-branch")
@WithDefault("main")
String getDefaultBranch();

@ConfigProperty(name = "send-stacktrace-to-client", defaultValue = "false")
@Override
@WithName("send-stacktrace-to-client")
@WithDefault("false")
boolean sendStacktraceToClient();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;

/** Version store configuration. */
@ConfigProperties(prefix = "nessie.version.store")
@ConfigMapping(prefix = "nessie.version.store")
public interface VersionStoreConfig {

@RegisterForReflection
Expand All @@ -30,17 +31,20 @@ public enum VersionStoreType {
JGIT
}

@ConfigProperty(name = "type", defaultValue = "INMEMORY")
@WithName("type")
@WithDefault("INMEMORY")
VersionStoreType getVersionStoreType();

/**
* Whether calls against the version-store are traced with OpenTracing/OpenTelemetry (Jaeger),
* enabled by default.
*/
@ConfigProperty(name = "trace.enable", defaultValue = "true")
@WithName("trace.enable")
@WithDefault("true")
boolean isTracingEnabled();

/** Whether metrics for the version-store are enabled (enabled by default). */
@ConfigProperty(name = "metrics.enable", defaultValue = "true")
@WithName("metrics.enable")
@WithDefault("true")
boolean isMetricsEnabled();
}

0 comments on commit 525ddef

Please sign in to comment.