Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions CONFIGURATION.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ You can run your application in dev mode that enables live coding using:
```shell script
docker run -d --rm -e CLUSTER_NAME=dse-cluster -e CLUSTER_VERSION=6.8 -e ENABLE_AUTH=true -e DEVELOPER_MODE=true -e DS_LICENSE=accept -e DSE=true -p 8081:8081 -p 8091:8091 -p 9042:9042 stargateio/coordinator-dse-next:v2

./mvnw compile quarkus:dev -Dstargate.jsonapi.operations.vectorize-enabled=true \
-Dstargate.jsonapi.operations.database-config.local-datacenter=dc1
./mvnw compile quarkus:dev -Ddata-api.operations.vectorize-enabled=true \
-Ddata-api.operations.database-config.local-datacenter=dc1
```

The command above will first spin the single Stargate DSE coordinator in dev that the API would communicate to.
Expand Down Expand Up @@ -254,5 +254,5 @@ We regularly update the integration tests and [Docker compose](docker-compose) s
```
- The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. Set the correct `local-datacenter` as the jvm option.
```
java -Dstargate.jsonapi.operations.database-config.local-datacenter=dc1 -jar target/quarkus-app/quarkus-run.jar
java -Ddata-api.operations.database-config.local-datacenter=dc1 -jar target/quarkus-app/quarkus-run.jar
```
6 changes: 3 additions & 3 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ To run local non-Docker instance of Data API, use `-d` with the script: it will
To run locally built Data API in Quarkus Development mode, you will use:

```
/mvnw compile quarkus:dev -Dstargate.data-store.ignore-bridge=true \
-Dstargate.jsonapi.operations.vectorize-enabled=true \
-Dstargate.jsonapi.operations.database-config.local-datacenter=dc1
/mvnw compile quarkus:dev -Ddata-api.data-store.ignore-bridge=true \
-Ddata-api.operations.vectorize-enabled=true \
-Ddata-api.operations.database-config.local-datacenter=dc1
```

## Script options
Expand Down
6 changes: 3 additions & 3 deletions docker-compose/docker-compose-hcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ services:
- JAVA_MAX_MEM_RATIO=75
- JAVA_INITIAL_MEM_RATIO=50
- GC_CONTAINER_OPTIONS=-XX:+UseG1GC
- STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=hcd-1
- STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1
- DATA_API_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=hcd-1
- DATA_API_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1
- QUARKUS_HTTP_ACCESS_LOG_ENABLED=${REQUESTLOG}
- QUARKUS_LOG_LEVEL=${LOGLEVEL}
- STARGATE_JSONAPI_OPERATIONS_VECTORIZE_ENABLED=true
- DATA_API_OPERATIONS_VECTORIZE_ENABLED=true
- JAVA_OPTS_APPEND=-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager
healthcheck:
test: curl -f http://localhost:8181/stargate/health || exit 1
Expand Down
6 changes: 3 additions & 3 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ services:
- JAVA_MAX_MEM_RATIO=75
- JAVA_INITIAL_MEM_RATIO=50
- GC_CONTAINER_OPTIONS=-XX:+UseG1GC
- STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=dse-1
- STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1
- DATA_API_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=dse-1
- DATA_API_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1
- QUARKUS_HTTP_ACCESS_LOG_ENABLED=${REQUESTLOG}
- QUARKUS_LOG_LEVEL=${LOGLEVEL}
- STARGATE_JSONAPI_OPERATIONS_VECTORIZE_ENABLED=true
- DATA_API_OPERATIONS_VECTORIZE_ENABLED=true
- JAVA_OPTS_APPEND=-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager
healthcheck:
test: curl -f http://localhost:8181/stargate/health || exit 1
Expand Down
2 changes: 1 addition & 1 deletion helm/jsonapi/templates/stargate_jsonapi_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
cpu: {{ .Values.cpu | default 1000 }}m
memory: {{ .Values.memory | default 1024 }}Mi
env:
- name: STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS
- name: DATA_API_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS
value: {{ .Values.cassandraEndPoints }}
- name: IO_STARGATE_SGV2_API_COMMON_PROPERTIES_DATASTORE_CONFIGURATION_DATASTOREPROPERTIESCONFIGURATION_FETCHSUPPORTEDFEATURES_RETRY_MAXRETRIES
value: "50"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ public class TenantConfiguration {

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.multi-tenancy.tenant-resolver.type", stringValue = "subdomain")
@LookupIfProperty(name = "stargate.multi-tenancy.enabled", stringValue = "true")
@LookupIfProperty(name = "data-api.multi-tenancy.tenant-resolver.type", stringValue = "subdomain")
@LookupIfProperty(name = "data-api.multi-tenancy.enabled", stringValue = "true")
DataApiTenantResolver subdomainTenantResolver(MultiTenancyConfig config) {
return new SubdomainTenantResolver(config.tenantResolver().subdomain());
}

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.multi-tenancy.tenant-resolver.type", stringValue = "fixed")
@LookupIfProperty(name = "stargate.multi-tenancy.enabled", stringValue = "true")
@LookupIfProperty(name = "data-api.multi-tenancy.tenant-resolver.type", stringValue = "fixed")
@LookupIfProperty(name = "data-api.multi-tenancy.enabled", stringValue = "true")
DataApiTenantResolver fixedTenantResolver(MultiTenancyConfig config) {
return new FixedTenantResolver(config.tenantResolver().fixed());
}

@Produces
@ApplicationScoped
@LookupIfProperty(
name = "stargate.multi-tenancy.tenant-resolver.type",
name = "data-api.multi-tenancy.tenant-resolver.type",
stringValue = "noop",
lookupIfMissing = true)
@LookupIfProperty(
name = "stargate.multi-tenancy.enabled",
name = "data-api.multi-tenancy.enabled",
stringValue = "false",
lookupIfMissing = true)
DataApiTenantResolver noopTenantResolver() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,30 @@ public class DataApiTokenConfiguration {

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.auth.token-resolver.type", stringValue = "header")
@LookupIfProperty(name = "data-api.auth.token-resolver.type", stringValue = "header")
DataApiTokenResolver headerTokenResolver(AuthConfig config) {
String headerName = config.tokenResolver().header().headerName();
return new HeaderTokenResolver(headerName);
}

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.auth.token-resolver.type", stringValue = "principal")
@LookupIfProperty(name = "data-api.auth.token-resolver.type", stringValue = "principal")
DataApiTokenResolver principalTokenResolver() {
return new PrincipalTokenResolver();
}

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.auth.token-resolver.type", stringValue = "fixed")
@LookupIfProperty(name = "data-api.auth.token-resolver.type", stringValue = "fixed")
DataApiTokenResolver fixedTokenResolver(AuthConfig config) {
return new FixedTokenResolver(config.tokenResolver().fixed());
}

@Produces
@ApplicationScoped
@LookupIfProperty(
name = "stargate.auth.token-resolver.type",
name = "data-api.auth.token-resolver.type",
stringValue = "noop",
lookupIfMissing = true)
DataApiTokenResolver noopCassandraTokenResolver() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class HeaderBasedSecurityConfiguration {

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.auth.header-based.enabled", stringValue = "true")
@LookupIfProperty(name = "data-api.auth.header-based.enabled", stringValue = "true")
HttpAuthenticationMechanism httpAuthenticationMechanism(
AuthConfig config, Instance<ErrorChallengeSender> customChallengeSender) {
String headerName = config.headerBased().headerName();
Expand All @@ -43,7 +43,7 @@ HttpAuthenticationMechanism httpAuthenticationMechanism(

@Produces
@ApplicationScoped
@LookupIfProperty(name = "stargate.auth.header-based.enabled", stringValue = "true")
@LookupIfProperty(name = "data-api.auth.header-based.enabled", stringValue = "true")
IdentityProvider<HeaderAuthenticationRequest> identityProvider() {
return new HeaderIdentityProvider();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.smallrye.config.WithDefault;
import jakarta.validation.constraints.NotBlank;

@ConfigMapping(prefix = "stargate.jsonapi.metric")
@ConfigMapping(prefix = "data-api.metric")
public interface JsonApiMetricsConfig {
@NotBlank
@WithDefault("error.class")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Map;

/** Extra, Stargate related configuration for the metrics. */
@ConfigMapping(prefix = "stargate.metrics")
@ConfigMapping(prefix = "data-api.metrics")
public interface MetricsConfig {

/**
Expand All @@ -28,7 +28,7 @@ interface TenantRequestCounterConfig {
/**
* @return If tenant request counter is enabled.
*/
@WithDefault("${stargate.multi-tenancy.enabled}")
@WithDefault("${data-api.multi-tenancy.enabled}")
boolean enabled();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.Optional;

/** Authentication configuration. */
@ConfigMapping(prefix = "stargate.auth")
@ConfigMapping(prefix = "data-api.auth")
public interface AuthConfig {

/**
Expand Down Expand Up @@ -54,7 +54,7 @@ interface HeaderBasedAuthConfig {
/**
* @return If the customization of the challenge sending should be done.
*/
@WithDefault("${stargate.exception-mappers.enabled:true}")
@WithDefault("${data-api.exception-mappers.enabled:true}")
boolean customChallengeEnabled();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Set;

/** Extra, JSON API command level logging related configurations. */
@ConfigMapping(prefix = "stargate.jsonapi.logging")
@ConfigMapping(prefix = "data-api.logging")
public interface CommandLevelLoggingConfig {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/** Configuration for limits that apply to Databases. */
@StaticInitSafe
@ConfigMapping(prefix = "stargate.database.limits")
@ConfigMapping(prefix = "data-api.database.limits")
public interface DatabaseLimitsConfig {
/**
* Default setting for {@link #maxCollections()}}: maximum number of Collections allowed to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;

@ConfigMapping(prefix = "stargate.debug")
@ConfigMapping(prefix = "data-api.debug")
public interface DebugModeConfig {

@WithDefault("false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* providers so has to be declared as {@link StaticInitSafe}.
*/
@StaticInitSafe
@ConfigMapping(prefix = "stargate.jsonapi.document.limits")
@ConfigMapping(prefix = "data-api.document.limits")
public interface DocumentLimitsConfig {
/** Defines the default maximum document size. */
int DEFAULT_MAX_DOCUMENT_SIZE = 4_000_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.OptionalInt;

/** Configuration mapping for the tenant resolver. */
@ConfigMapping(prefix = "stargate.multi-tenancy")
@ConfigMapping(prefix = "data-api.multi-tenancy")
public interface MultiTenancyConfig {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import javax.annotation.Nullable;

/** Configuration for the operation execution. */
@ConfigMapping(prefix = "stargate.jsonapi.operations")
@ConfigMapping(prefix = "data-api.operations")
public interface OperationsConfig {
/** Defines the default max size of filter fields. */
int DEFAULT_MAX_FILTER_SIZE = 64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;

@ConfigMapping(prefix = "stargate.jsonapi.http")
@ConfigMapping(prefix = "data-api.http")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment in ApiConstants that we are leaving the constant as is there and create a ticket to remove the OfflineMode complely, I dont think we use it and we need to check that. It was for the sstable loader.

public interface HttpConstants {

/** Data API Authentication token header name. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* (with possible property / sysenv overrides).
*
* <p>NOTE: actual keys in YAML or similar configuration file would be {@code
* stargate.feature.<feature-name>}, where {@code <feature-name>} comes from {@link
* data-api.feature.<feature-name>}, where {@code <feature-name>} comes from {@link
* ApiFeature#featureName()} (which is always lower-case). So, for example, to enable {@link
* ApiFeature#TABLES} feature, one would use: {@code stargate.feature.flags.tables} as the key.
* ApiFeature#TABLES} feature, one would use: {@code data-api.feature.flags.tables} as the key.
*/
@ConfigMapping(prefix = "stargate.feature")
@ConfigMapping(prefix = "data-api.feature")
public interface FeaturesConfig {
// Quarkus/SmallRye Config won't accept use of `null` values, so we must bind
// as Strings and only convert to Boolean when needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Do NOT inject this interface, use EmbeddingProvidersConfig instead EmbeddingProvidersConfig bean
* produced by EmbeddingProvidersConfigProducer based on EGW enabled or not
*/
@ConfigMapping(prefix = "stargate.jsonapi.embedding")
@ConfigMapping(prefix = "data-api.embedding")
public interface DefaultEmbeddingProviderConfig {

// TODO: WHAT DOES THIS ACTUALLY RETURN ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public String getApiName() {
}
}

@ConfigMapping(prefix = "stargate.jsonapi.custom.embedding")
@ConfigMapping(prefix = "data-api.custom.embedding")
interface CustomConfig {
@WithDefault("false")
boolean enabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private Uni<Supplier<CommandResult>> executeCollectionCreation(
collectionExisted);
Multi<AsyncResultSet> indexResultMulti;
/*
CI will override ddlDelayMillis to 0 using `-Dstargate.jsonapi.operations.database-config.ddl-delay-millis=0`
CI will override ddlDelayMillis to 0 using `-Ddata-api.operations.database-config.ddl-delay-millis=0`
to speed up the test execution
This is ok because CI is run as single cassandra instance and there is no need to wait for the schema changes to propagate
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import jakarta.annotation.Nullable;
import java.util.Map;

@ConfigMapping(prefix = "stargate.jsonapi.reranking")
@ConfigMapping(prefix = "data-api.reranking")
public interface DefaultRerankingProviderConfig {
@Nullable
Map<String, RerankingProvidersConfig.RerankingProviderConfig> providers();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# please keep properties in the alphabetical order

stargate:
data-api:
# security and authentication configuration
# see io.stargate.sgv2.jsonapi.config.AuthConfig for all config properties and options
auth:
Expand Down
Loading