Skip to content

Commit

Permalink
CORE-17437: Revert State Manager Configuration Section (corda#1277)
Browse files Browse the repository at this point in the history
This reverts commit edc6b36.
  • Loading branch information
jujoramos committed Oct 10, 2023
1 parent edc6b36 commit 96beb2b
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private BootConfig() {

public static final String BOOT_SECRETS = "secrets";

public static final String BOOT_STATE_MANAGER = StateManagerConfig.STATE_MANAGER;
public static final String BOOT_STATE_MANAGER = "stateManager";
public static final String BOOT_STATE_MANAGER_TYPE = BOOT_STATE_MANAGER + ".type";
public static final String BOOT_STATE_MANAGER_DB_USER = BOOT_STATE_MANAGER + ".database.user";
public static final String BOOT_STATE_MANAGER_DB_PASS = BOOT_STATE_MANAGER + ".database.pass";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ private ConfigKeys() {
public static final String FLOW_CONFIG = "corda.flow";
public static final String MESSAGING_CONFIG = "corda.messaging";
public static final String EXTERNAL_MESSAGING_CONFIG = "corda.externalMessaging";
public static final String STATE_MANAGER_CONFIG = "corda." + StateManagerConfig.STATE_MANAGER;
public static final String UTXO_LEDGER_CONFIG = "corda.ledger.utxo";
public static final String P2P_LINK_MANAGER_CONFIG = "corda.p2p.linkManager";
public static final String P2P_GATEWAY_CONFIG = "corda.p2p.gateway";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,31 @@ private Publisher() {
* producers to stay under this limit when publishing messages.
*/
public static final String MAX_ALLOWED_MSG_SIZE = "maxAllowedMessageSize";

/**
* State Manager Configuration for connecting to the underlying persistent storage.
*/
public static final class StateManager {
private StateManager() {
}

public static final String STATE_MANAGER = "stateManager";
public static final String TYPE = STATE_MANAGER + ".type";

// Database Values
public static final String DB_PROPERTIES = STATE_MANAGER + ".database";
public static final String JDBC_USER = DB_PROPERTIES + ".user";
public static final String JDBC_PASS = DB_PROPERTIES + ".pass";

public static final String JDBC_URL = DB_PROPERTIES + ".jdbc.url";
public static final String JDBC_DRIVER = DB_PROPERTIES + ".jdbc.driver";
public static final String JDBC_DRIVER_DIRECTORY = DB_PROPERTIES + ".jdbc.directory";
public static final String JDBC_PERSISTENCE_UNIT_NAME = DB_PROPERTIES + ".jdbc.persistenceUnitName";
public static final String JDBC_POOL_MAX_SIZE = DB_PROPERTIES + ".pool.maxSize";
public static final String JDBC_POOL_MIN_SIZE = DB_PROPERTIES + ".pool.minSize";
public static final String JDBC_POOL_IDLE_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.idleTimeoutSeconds";
public static final String JDBC_POOL_MAX_LIFETIME_SECONDS = DB_PROPERTIES + ".pool.maxLifetimeSeconds";
public static final String JDBC_POOL_KEEP_ALIVE_TIME_SECONDS = DB_PROPERTIES + ".pool.keepAliveTimeSeconds";
public static final String JDBC_POOL_VALIDATION_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.validationTimeoutSeconds";
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,37 @@
"default": 972800,
"minimum": 512000,
"maximum": 8388608
},
"stateManager": {
"description": "Connection details for the underlying persistent storage used by the out of process State Manager.",
"type": "object",
"properties": {
"type": {
"description": "The type of state manager implementation.",
"enum": [
"DATABASE"
]
},
"additionalProperties": false
},
"$comment": "Polymorphic state manager storage connection configuration. The valid section depends on which state manager implementation is in use.",
"allOf": [
{
"if": {
"properties": { "type": { "const": "DATABASE" } },
"required": ["type"]
},
"then": {
"properties": {
"databaseProperties": {
"description": "Settings to connect to the state manager database.",
"$ref": "state-manager-db-properties.json"
}
},
"required": ["type","databaseProperties"]
}
}
]
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://corda.r3.com/net/corda/schema/configuration/stateManager/1.0/stateManager-db-properties.json",
"$id": "https://corda.r3.com/net/corda/schema/configuration/db/1.0/corda.db.json",
"title": "State Manager Database Configuration Schema",
"description": "Configuration schema for the database section. Note that this configuration cannot be updated dynamically through the REST endpoint.",
"type": "object",
Expand All @@ -23,11 +23,6 @@
"type": "object",
"default": {},
"properties": {
"url": {
"description": "The JDBC URL.",
"type": "string",
"default": "jdbc:postgresql://state-manager-db:5432/state_manager"
},
"driver": {
"description": "The JDBC driver.",
"type": "string",
Expand All @@ -37,6 +32,16 @@
"description": "The directory that contains the JDBC drivers.",
"type": "string",
"default": "/opt/jdbc-driver"
},
"url": {
"description": "The JDBC URL.",
"type": "string",
"default": "jdbc:postgresql://state-manager-db:5432/state_manager"
},
"persistenceUnitName": {
"description": "The persistent unit name.",
"type": "string",
"default": "corda-state-manager"
}
},
"additionalProperties": false
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import net.corda.schema.configuration.ConfigKeys.RECONCILIATION_CONFIG
import net.corda.schema.configuration.ConfigKeys.REST_CONFIG
import net.corda.schema.configuration.ConfigKeys.SANDBOX_CONFIG
import net.corda.schema.configuration.ConfigKeys.SECRETS_CONFIG
import net.corda.schema.configuration.ConfigKeys.STATE_MANAGER_CONFIG
import net.corda.schema.configuration.ConfigKeys.UTXO_LEDGER_CONFIG
import net.corda.schema.configuration.provider.ConfigSchemaException
import net.corda.v5.base.versioning.Version
Expand Down Expand Up @@ -43,7 +42,6 @@ class SchemaProviderConfigImplTest {
SANDBOX_CONFIG,
RECONCILIATION_CONFIG,
MEMBERSHIP_CONFIG,
STATE_MANAGER_CONFIG
)
private val VERSIONS = listOf("1.0")

Expand Down Expand Up @@ -101,4 +99,4 @@ class SchemaProviderConfigImplTest {
provider.getSchemaFile(BAD_SCHEMA_FILE)
}
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cordaProductVersion = 5.1.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 31
cordaApiRevision = 30

# Main
kotlinVersion = 1.8.21
Expand Down

0 comments on commit 96beb2b

Please sign in to comment.