Skip to content

Commit 40aea3a

Browse files
authored
[JDBC] : Deprecate EclipseLink (#1515)
1 parent 4db7998 commit 40aea3a

File tree

6 files changed

+53
-35
lines changed

6 files changed

+53
-35
lines changed

helm/polaris/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ A Helm chart for Apache Polaris (incubating).
4848

4949
### Optional
5050

51-
When using a custom `persistence.xml`, a Kubernetes Secret must be created for it. Below is a sample command:
51+
When using EclipseLink backed metastore a custom `persistence.xml` is required, a Kubernetes Secret must be created for it. Below is a sample command:
5252
```bash
5353
kubectl create secret generic polaris-secret -n polaris --from-file=persistence.xml
5454
```
@@ -67,7 +67,7 @@ helm unittest helm/polaris
6767
The below instructions assume Kind and Helm are installed.
6868

6969
Simply run the `run.sh` script from the Polaris repo root, making sure to specify the
70-
`--eclipse-link-deps` option:
70+
`--eclipse-link-deps` if using EclipseLink backed metastore, option:
7171

7272
```bash
7373
./run.sh
@@ -186,8 +186,8 @@ kubectl delete namespace polaris
186186

187187
## Values
188188

189-
| Key | Type | Default | Description |
190-
|-----|------|---------|-------------|
189+
Key | Type | Default | Description |
190+
|-----|------|-----|-------------|
191191
| advancedConfig | object | `{}` | Advanced configuration. You can pass here any valid Polaris or Quarkus configuration property. Any property that is defined here takes precedence over all the other configuration values generated by this chart. Properties can be passed "flattened" or as nested YAML objects (see examples below). Note: values should be strings; avoid using numbers, booleans, or other types. |
192192
| affinity | object | `{}` | Affinity and anti-affinity for polaris pods. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity. |
193193
| authentication | object | `{"authenticator":{"type":"default"},"tokenBroker":{"maxTokenGeneration":"PT1H","secret":{"name":null,"privateKey":"private.pem","publicKey":"public.pem","secretKey":"secret"},"type":"rsa-key-pair"},"tokenService":{"type":"default"}}` | Polaris authentication configuration. |
@@ -285,7 +285,7 @@ kubectl delete namespace polaris
285285
| persistence.eclipseLink.secret | object | `{"key":"persistence.xml","name":null}` | The secret name to pull persistence.xml from. |
286286
| persistence.eclipseLink.secret.key | string | `"persistence.xml"` | The key in the secret to pull persistence.xml from. |
287287
| persistence.eclipseLink.secret.name | string | `nil` | The name of the secret to pull persistence.xml from. If not provided, the default built-in persistence.xml will be used. This is probably not what you want. |
288-
| persistence.type | string | `"eclipse-link"` | The type of persistence to use. Two built-in types are supported: in-memory and eclipse-link. |
288+
| persistence.type | string | `"relational-jdbc"` | Three built-in types are available: "relational-jdbc", "in-memory", "eclipse-link". The in-memory type is not recommended for production use. The eclipse-link type is deprecated and will be unsupported in a future release. |
289289
| podAnnotations | object | `{}` | Annotations to apply to polaris pods. |
290290
| podLabels | object | `{}` | Additional Labels to apply to polaris pods. |
291291
| podSecurityContext | object | `{"fsGroup":10001,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for the polaris pod. See https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. |
@@ -343,4 +343,4 @@ kubectl delete namespace polaris
343343
| tracing.attributes | object | `{}` | Resource attributes to identify the polaris service among other tracing sources. See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. If left empty, traces will be attached to a service named "Apache Polaris"; to change this, provide a service.name attribute here. |
344344
| tracing.enabled | bool | `false` | Specifies whether tracing for the polaris server should be enabled. |
345345
| tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). See https://quarkus.io/guides/opentelemetry for more information. |
346-
| tracing.sample | string | `"1.0d"` | Which requests should be sampled. Valid values are: "all", "none", or a ratio between 0.0 and "1.0d" (inclusive). E.g. "0.5d" means that 50% of the requests will be sampled. Note: avoid entering numbers here, always prefer a string representation of the ratio. |
346+
| tracing.sample | string | `"1.0d"` | Which requests should be sampled. Valid values are: "all", "none", or a ratio between 0.0 and "1.0d" (inclusive). E.g. "0.5d" means that 50% of the requests will be sampled. Note: avoid entering numbers here, always prefer a string representation of the ratio. |

quarkus/admin/src/main/resources/application.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ quarkus.container-image.additional-tags=latest
3535
# ---- Runtime Configuration ----
3636
# Below are default values for properties that can be changed in runtime.
3737

38-
polaris.persistence.type=eclipse-link
38+
polaris.persistence.type=relational-jdbc
3939

4040
quarkus.arc.ignored-split-packages=\
4141
org.apache.polaris.admintool.config,\

quarkus/admin/src/testFixtures/java/org/apache/polaris/admintool/PostgresTestResourceLifecycleManager.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ public Map<String, String> start() {
6363
context.containerNetworkId().ifPresent(postgres::withNetworkMode);
6464
postgres.start();
6565
return Map.of(
66-
"polaris.persistence.eclipselink.configuration-file", createPersistenceXml().toString());
66+
"polaris.persistence.type",
67+
"eclipse-link",
68+
"polaris.persistence.eclipselink.configuration-file",
69+
createPersistenceXml().toString());
6770
}
6871

6972
@Override

site/content/in-dev/unreleased/admin-tool.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,13 @@ The Polaris Admin Tool must be executed with the same configuration as the Polar
7474
configuration can be done via environment variables or system properties.
7575

7676
At a minimum, it is necessary to configure the Polaris Admin Tool to connect to the same database
77-
used by the Polaris server. This can be done by setting the following system properties:
78-
79-
```shell
80-
java \
81-
-Dpolaris.persistence.eclipselink.configuration-file=/path/to/persistence.xml \
82-
-Dpolaris.persistence.eclipselink.persistence-unit=polaris \
83-
-jar quarkus/admin/build/polaris-quarkus-admin-*-runner.jar
84-
```
77+
used by the Polaris server.
8578

8679
See the [metastore documentation]({{% ref "metastores" %}}) for more information on configuring the
8780
database connection.
8881

82+
Note: Polaris will always create schema 'polaris_schema' during bootstrap under the configured database.
83+
8984
## Bootstrapping Realms and Principal Credentials
9085

9186
The `bootstrap` command is used to bootstrap realms and create the necessary principal credentials

site/content/in-dev/unreleased/configuring-polaris-for-production.md

+15-17
Original file line numberDiff line numberDiff line change
@@ -135,34 +135,32 @@ default, Polaris uses an in-memory metastore.
135135
> The default in-memory metastore is not suitable for production use, as it will lose all data
136136
> when the server is restarted; it is also unusable when multiple Polaris replicas are used.
137137
138-
To use a durable metastore, you need to switch to the EclipseLink metastore, and provide your own
139-
`persistence.xml` file. This file contains details of the database used for metastore management and
140-
the connection settings. For more information, refer to the [metastore documentation]({{% ref
141-
"metastores" %}}).
138+
To enable a durable metastore, configure your system to use the Relational JDBC-backed metastore.
139+
This implementation leverages Quarkus for datasource management and supports configuration through
140+
environment variables or JVM -D flags at startup. For more information, refer to the [Quarkus configuration reference](https://quarkus.io/guides/config-reference#env-file).
142141

143-
Then, configure Polaris to use your metastore by setting the following properties:
142+
Configure the metastore by setting the following ENV variables:
144143

145-
```properties
146-
polaris.persistence.type=eclipse-link
147-
polaris.persistence.eclipselink.configuration-file=/path/to/persistence.xml
148-
polaris.persistence.eclipselink.persistence-unit=polaris
149144
```
145+
POLARIS_PERSISTENCE_TYPE=relational-jdbc
150146
151-
Where:
147+
QUARKUS_DATASOURCE_DB_KIND=postgresql
148+
QUARKUS_DATASOURCE_USERNAME=<your-username>
149+
QUARKUS_DATASOURCE_PASSWORD=<your-password>
150+
QUARKUS_DATASOURCE_JDBC_URL=<jdbc-url-of-postgres>
151+
```
152152

153-
- `polaris.persistence.type` indicates that we are using the EclipseLink metastore.
154-
- `polaris.persistence.eclipselink.configuration-file` is the path to the `persistence.xml` file.
155-
- `polaris.persistence.eclipselink.persistence-unit` is the name of the persistence unit to use (in
156-
case the configuration file has many persistence units).
157153

158-
Typically, in Kubernetes, you would define the `persistence.xml` file as a `ConfigMap` and set the
159-
`polaris.persistence.eclipselink.configuration-file` property to the path of the mounted file in
160-
the container.
154+
The relational JDBC metastore is a Quarkus-managed datasource and only supports Postgres and H2 as of now.
155+
Please refer to the documentation here:
156+
[Configure data sources in Quarkus](https://quarkus.io/guides/datasource)
161157

162158
> [!IMPORTANT]
163159
> Be sure to secure your metastore backend since it will be storing sensitive data and catalog
164160
> metadata.
165161
162+
Note: Polaris will always create schema 'polaris_schema' during bootstrap under the configured database.
163+
166164
### Bootstrapping
167165

168166
Before using Polaris, you must **bootstrap** the metastore. This is a manual operation that must be

site/content/in-dev/unreleased/metastores.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,27 @@ In order to add other JDBC drivers, you have to build Polaris using the `eclipse
3232

3333
## Polaris Server Configuration
3434

35+
### Relational JDBC
36+
This implementation leverages Quarkus for datasource management and supports configuration through
37+
environment variables or JVM -D flags at startup. For more information, refer to the [Quarkus configuration reference](https://quarkus.io/guides/config-reference#env-file).
38+
39+
40+
```
41+
POLARIS_PERSISTENCE_TYPE=relational-jdbc
42+
43+
QUARKUS_DATASOURCE_DB_KIND=postgresql
44+
QUARKUS_DATASOURCE_USERNAME=<your-username>
45+
QUARKUS_DATASOURCE_PASSWORD=<your-password>
46+
QUARKUS_DATASOURCE_JDBC_URL=<jdbc-url-of-postgres>
47+
```
48+
49+
The Relational JDBC metastore currently relies on a Quarkus-managed datasource and supports only PostgreSQL and H2 databases. This limitation is similar to that of EclipseLink, primarily due to underlying schema differences. At this time, official documentation is provided exclusively for usage with PostgreSQL.
50+
Please refer to the documentation here:
51+
[Configure data sources in Quarkus](https://quarkus.io/guides/datasource)
52+
53+
### EclipseLink
54+
> [!IMPORTANT] Eclipse link is deprecated, its recommend to use Relational JDBC as persistence instead.
55+
3556
Configure the `polaris.persistence` section in your Polaris configuration file
3657
(`application.properties`) as follows:
3758

@@ -58,7 +79,7 @@ Polaris creates and connects to a separate database for each realm. Specifically
5879
5980
A single `persistence.xml` can describe multiple [persistence units](https://eclipse.dev/eclipselink/documentation/4.0/concepts/concepts.html#APPDEV001). For example, with both a `polaris-dev` and `polaris` persistence unit defined, you could use a single `persistence.xml` to easily switch between development and production databases. Use the `persistence-unit` option in the Polaris server configuration to easily switch between persistence units.
6081

61-
### Using H2
82+
#### Using H2
6283

6384
> [!IMPORTANT] H2 is an in-memory database and is not suitable for production!
6485
@@ -101,7 +122,7 @@ java -Dpolaris.persistence.type=eclipse-link \
101122
-jar quarkus/server/build/quarkus-app/quarkus-run.jar
102123
```
103124

104-
### Using Postgres
125+
#### Using Postgres
105126

106127
PostgreSQL is included by default in the Polaris server distribution.
107128

@@ -130,3 +151,4 @@ The following shows a sample configuration for integrating Polaris with Postgres
130151
</properties>
131152
</persistence-unit>
132153
```
154+

0 commit comments

Comments
 (0)