ServerProperties¶
Creating Instance¶
ServerProperties takes no arguments to be created.
While being created, ServerProperties loads the default server configuration.
ServerProperties is created once to be available system-wide.
ServerProperties Instance¶
ServerProperties instance
ServerProperties is available system-wide as one single instance.
import io.unitycatalog.server.utils.ServerProperties
val s3conf = ServerProperties.getInstance.getS3Configurations
This ServerProperties instance is used when:
UnityCatalogServeris requested to addApiServices- FileUtils is created (and requested to modifyS3Directory)
- HibernateUtils is created
- UriUtils is created
AuthServiceis requested to grantTokenIcebergRestCatalogServiceis requested to handle config and write requests (see server.iceberg-table.enabled)AwsCredentialVendoris createdAzureCredentialVendoris createdGcpCredentialVendoris createdFileIOFactoryis requested to getS3FileIOTableConfigServiceis created
Server Properties¶
ServerProperties loads server configuration from etc/conf/server.properties when created.
When there is no etc/conf/server.properties, the server properties are empty.
ServerProperties uses the properties for the following:
Get Storage Configurations¶
GCS¶
Map<String, String> getGcsConfigurations()
getGcsConfigurations collects all non-empty gcs.bucketPath.- and gcs.jsonKeyFilePath.-prefixed configuration properties (from the properties).
getGcsConfigurations does so until there are no more pairs starting from 0.
getGcsConfigurations returns a collection of pairs of gcs.bucketPath.[n] keys and gcs.jsonKeyFilePath.[n] values.
getGcsConfigurations is used when:
GcpCredentialVendoris created
S3¶
Map<String, S3StorageConfig> getS3Configurations()
getS3Configurations creates a S3StorageConfig for every collection of n-indexed properties from the server.properties file (with n starting from 0):
s3.bucketPath.[n]s3.region.[n]s3.awsRoleArn.[n]s3.accessKey.[n]s3.secretKey.[n]s3.sessionToken.[n]
getS3Configurations returns S3StorageConfigs by their bucketPaths.
Note
getS3Configurations disregards a S3StorageConfig when the following hold true:
- Any of
bucketPath,regionandawsRoleArnis undefined - Any of
accessKey,secretKey,sessionTokenis undefined
getS3Configurations is used when:
AwsCredentialVendoris createdFileIOFactoryis requested to getS3FileIOTableConfigServiceis created
Load Default Server Configuration¶
Properties generateDefaults()
?? note "Static Method" generateDefaults is a Java class method to be invoked without a reference to a particular object.
Learn more in the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.4.3.2).
generateDefaults takes all the server properties that have the default value defined.
isAuthorizationEnabled¶
boolean isAuthorizationEnabled()
isAuthorizationEnabled is enabled (true) when server.authorization server property is enabled.
isAuthorizationEnabled is used when:
ArmeriaServerBuilderis createdUnityCatalogServeris requested to initialize (and initializes the authorizer and registers the Unity Catalog API security decorators)AuthorizedServiceis requested to applyResponseFilterAuthServiceis requested to create access token
Logging¶
Enable ALL logging level for io.unitycatalog.server.utils.ServerProperties logger to see what happens inside.
Add the following line to etc/conf/server.log4j2.properties:
logger.ServerProperties.name = io.unitycatalog.server.utils.ServerProperties
logger.ServerProperties.level = all
Refer to Logging.