Class JdbcBootstrapUtils
java.lang.Object
org.apache.polaris.persistence.relational.jdbc.JdbcBootstrapUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetRealmBootstrapSchemaVersion(int currentSchemaVersion, int requiredSchemaVersion, boolean hasAlreadyBootstrappedRealms) Determines the correct schema version to use for bootstrapping a realm.static intgetRequestedSchemaVersion(org.apache.polaris.core.persistence.bootstrap.BootstrapOptions bootstrapOptions) Extracts the requested schema version from the provided BootstrapOptions.
-
Method Details
-
getRealmBootstrapSchemaVersion
public static int getRealmBootstrapSchemaVersion(int currentSchemaVersion, int requiredSchemaVersion, boolean hasAlreadyBootstrappedRealms) Determines the correct schema version to use for bootstrapping a realm.- Parameters:
currentSchemaVersion- The current version of the database schema.requiredSchemaVersion- The requested schema version (-1 for auto-detection).hasAlreadyBootstrappedRealms- Flag indicating if any realms already exist.- Returns:
- The calculated bootstrap schema version.
- Throws:
IllegalStateException- if the combination of parameters represents an invalid state.
-
getRequestedSchemaVersion
public static int getRequestedSchemaVersion(org.apache.polaris.core.persistence.bootstrap.BootstrapOptions bootstrapOptions) Extracts the requested schema version from the provided BootstrapOptions.- Parameters:
bootstrapOptions- : The bootstrap options containing schema information from which to extract the version.- Returns:
- The requested schema version, or -1 if not specified.
-