Skip to content

Commit

Permalink
ServerProperties and server.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklaskowski committed Oct 20, 2024
1 parent 6bec491 commit 95ccd2b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docs/credential-vending/AwsCredentialVendor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`AwsCredentialVendor` is used to [vend S3 bucket credentials](#vendAwsCredentials) for [CredentialOperations](CredentialOperations.md#awsCredentialVendor) (to [vend credentials](CredentialOperations.md#vendCredential) for `s3://` storage scheme).

`AwsCredentialVendor` uses [server.properties](../server/ServerPropertiesUtils.md#getS3Configurations) configuration file for S3 bucket security configurations.
`AwsCredentialVendor` uses [server.properties](../server/ServerProperties.md#getS3Configurations) configuration file for S3 bucket security configurations.

!!! note "AWS Security Token Service (STS)"
`AwsCredentialVendor` uses [AWS Security Token Service (STS)](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html) to request [temporary, limited-privilege security credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html):
Expand All @@ -17,7 +17,7 @@
Map<String, S3StorageConfig> s3Configurations
```

`AwsCredentialVendor` initializes `s3Configurations` based on [server.properties](../server/ServerPropertiesUtils.md#getS3Configurations) configuration file.
`AwsCredentialVendor` initializes `s3Configurations` based on [server.properties](../server/ServerProperties.md#getS3Configurations) configuration file.

This `s3Configurations` is used to look up [S3StorageConfig](S3StorageConfig.md)s to [vend S3 bucket credentials](#vendAwsCredentials).

Expand Down
2 changes: 1 addition & 1 deletion docs/credential-vending/S3StorageConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* <span id="secretKey"> Secret Key
* <span id="sessionToken"> Session Token

`S3StorageConfig` is created only when `ServerProperties` is requested for the [S3 configurations](../server/ServerPropertiesUtils.md#getS3Configurations).
`S3StorageConfig` is created only when `ServerProperties` is requested for the [S3 configurations](../server/ServerProperties.md#getS3Configurations).

`S3StorageConfig` is used by the following services:

Expand Down
4 changes: 2 additions & 2 deletions docs/persistent-storage/HibernateUtil.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

`HibernateUtil` is used to access the system-wide [SessionFactory](#sessionFactory) ([Hibernate]({{ hibernate.javadoc }}/org/hibernate/SessionFactory.html)).

## ServerPropertiesUtils { #properties }
## ServerProperties { #properties }

`HibernateUtil` gets at the only instance of [ServerPropertiesUtils](../server/ServerPropertiesUtils.md#instance) in a static initializer.
`HibernateUtil` gets at the only instance of [ServerProperties](../server/ServerProperties.md#instance) in a static initializer.

??? note "Static Initializer"
A **static initializer** declared in a class is executed when the class is initialized.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# ServerPropertiesUtils
# ServerProperties

## Creating Instance

`ServerPropertiesUtils` takes no arguments to be created.
`ServerProperties` takes no arguments to be created.

While being created, `ServerPropertiesUtils` [loads server configuration](#loadProperties).
While being created, `ServerProperties` [loads server configuration](#loadProperties).

`ServerPropertiesUtils` is created once to be available [system-wide](#instance).
`ServerProperties` is created once to be available [system-wide](#instance).

## ServerPropertiesUtils Instance { #instance }
## ServerProperties Instance { #instance }

``` java
ServerPropertiesUtils instance
ServerProperties instance
```

`ServerPropertiesUtils` is available system-wide as one single instance.
`ServerProperties` is available system-wide as one single instance.

``` scala
import io.unitycatalog.server.persist.utils.ServerPropertiesUtils
val s3conf = ServerPropertiesUtils.getInstance.getS3Configurations
import io.unitycatalog.server.persist.utils.ServerProperties
val s3conf = ServerProperties.getInstance.getS3Configurations
```

This `ServerPropertiesUtils` instance is used when:
This `ServerProperties` instance is used when:

* `UnityCatalogServer` is requested to [addServices](UnityCatalogServer.md#addServices)
* [FileUtils](../persistent-storage/FileUtils.md#properties) is created (and requested to [modifyS3Directory](../persistent-storage/FileUtils.md#modifyS3Directory))
Expand All @@ -36,11 +36,11 @@ This `ServerPropertiesUtils` instance is used when:

## Server Properties { #properties }

`ServerPropertiesUtils` [loads server configuration](#loadProperties) from `etc/conf/server.properties` when [created](#creating-instance).
`ServerProperties` [loads server configuration](#loadProperties) from `etc/conf/server.properties` when [created](#creating-instance).

When there is no `etc/conf/server.properties`, the server properties is empty.

`ServerPropertiesUtils` uses the properties for the following:
`ServerProperties` uses the properties for the following:

* [getProperty](#getProperty)
* [getS3Configurations](#getS3Configurations)
Expand Down Expand Up @@ -124,13 +124,13 @@ Properties loaded successfully

## Logging

Enable `ALL` logging level for `io.unitycatalog.server.persist.utils.ServerPropertiesUtils` logger to see what happens inside.
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`:

```text
logger.ServerPropertiesUtils.name = io.unitycatalog.server.persist.utils.ServerPropertiesUtils
logger.ServerPropertiesUtils.level = all
logger.ServerProperties.name = io.unitycatalog.server.persist.utils.ServerProperties
logger.ServerProperties.level = all
```

Refer to [Logging](../logging.md).
2 changes: 1 addition & 1 deletion docs/server/UnityCatalogServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The summary of the single metastore is available through [MetastoreService](Meta
`UnityCatalogServer` uses the following configuration files:

* `etc/conf/server.log4j2.properties`
* [etc/conf/server.properties](ServerPropertiesUtils.md)
* [etc/conf/server.properties](ServerProperties.md)

## Port

Expand Down
4 changes: 4 additions & 0 deletions docs/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ usage: bin/start-uc-server

!!! note
The REST API requests can come from any Unity Catalog API-compatible client, incl. [Unity Catalog CLI](../cli/index.md).

## Server Configuration

The Localhost Reference Server uses `etc/conf/server.properties` file for [server configuration](ServerProperties.md#loadProperties).

0 comments on commit 95ccd2b

Please sign in to comment.