Skip to content

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 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:

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

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:

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, region and awsRoleArn is undefined
  • Any of accessKey, secretKey, sessionToken is undefined

getS3Configurations is used when:

Load Server Configuration

void loadProperties()

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:

Properties file not found: [path]

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:

Properties loaded successfully

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.