ServerProperties¶
Creating Instance¶
ServerProperties
takes no arguments to be created.
While being created, ServerProperties
loads server configuration.
ServerProperties
is created once to be available system-wide.
ServerProperties Instance¶
ServerProperties
is available system-wide as one single instance.
import io.unitycatalog.server.persist.utils.ServerProperties
val s3conf = ServerProperties.getInstance.getS3Configurations
This ServerProperties
instance is used when:
UnityCatalogServer
is requested to addServices- FileUtils is created (and requested to modifyS3Directory)
- HibernateUtils is created
- UriUtils is created
AuthService
is requested to grantTokenAwsCredentialVendor
is createdAzureCredentialVendor
is createdGcpCredentialVendor
is createdFileIOFactory
is requested to getS3FileIOTableConfigService
is 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 is empty.
ServerProperties
uses the properties for the following:
Get Storage Configurations¶
GCS¶
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:
GcpCredentialVendor
is created
S3¶
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 S3StorageConfig
s by their bucketPath
s.
Note
getS3Configurations
disregards a S3StorageConfig
when the following hold true:
- Any of
bucketPath
,region
andawsRoleArn
is undefined - Any of
accessKey
,secretKey
,sessionToken
is undefined
getS3Configurations
is used when:
AwsCredentialVendor
is createdFileIOFactory
is requested to getS3FileIOTableConfigService
is created
Load Server Configuration¶
loadProperties
loads etc/conf/server.properties
file into the Properties.
Note
loadProperties
prints out the following ERROR message to the logs when etc/conf/server.properties
file could not be found:
It is not a fatal error when there is no server configuration file. The server properties are simply empty.
loadProperties
prints out the following DEBUG message to the logs:
Logging¶
Enable ALL
logging level for io.unitycatalog.server.persist.utils.ServerProperties
logger to see what happens inside.
Add the following line to etc/conf/server.log4j2.properties
:
logger.ServerProperties.name = io.unitycatalog.server.persist.utils.ServerProperties
logger.ServerProperties.level = all
Refer to Logging.