Skip to content

Commit

Permalink
Change some leftover references to external data store to data connec…
Browse files Browse the repository at this point in the history
…tion

Data connection feature was called external data store in its beta phase
(in Hazelcast 5.3). Apparently there are still some references to the
old name left. I have tried to capture everything, apart from the names
of the pages / links - I don't understand how the redirects work exactly
and didn't want to break anything.
  • Loading branch information
frant-hartm committed Aug 12, 2024
1 parent cac294e commit 1ecd8b0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/modules/configuration/pages/dynamic-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Dynamic configuration is supported for the following data structures:
- CardinalityEstimator
- PNCounter
- FlakeIdGenerator
- ExternalDataStore
- DataConnection

[[persistence]]
== Persisting Dynamic Configuration
Expand Down
8 changes: 4 additions & 4 deletions docs/modules/integrate/pages/jdbc-connector.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ p.readFrom(Sources.jdbc(
)).writeTo(Sinks.logger());
```

You can also use a configured xref:external-data-stores:external-data-stores.adoc#defining-external-data-stores[external data store] as a JDBC Source:
You can also use a configured xref:external-data-stores:external-data-stores.adoc#defining-external-data-stores[data connection] as a JDBC Source:
```java
Pipeline p = Pipeline.create();
p.readFrom(Sources.jdbc(
externalDataStoreRef("my-database"),
dataConnectionRef("my-database"),
(con, parallelism, index) -> {
PreparedStatement stmt = con.prepareStatement(
"SELECT * FROM person WHERE MOD(id, ?) = ?)");
Expand Down Expand Up @@ -88,14 +88,14 @@ p.readFrom(KafkaSources.<Person>kafka(.., "people"))
));
```

You can also use a configured xref:external-data-stores:external-data-stores.adoc#defining-external-data-stores[external data store] as a JDBC sink:
You can also use a configured xref:external-data-stores:external-data-stores.adoc#defining-external-data-stores[data connection] as a JDBC sink:

```java
Pipeline p = Pipeline.create();
p.readFrom(KafkaSources.<Person>kafka(.., "people"))
.writeTo(Sinks.jdbc(
"REPLACE INTO PERSON (id, name) values(?, ?)",
externalDataStoreRef(JDBC_DATA_STORE),
dataConnectionRef(JDBC_DATA_STORE),
(stmt, item) -> {
stmt.setInt(1, item.id);
stmt.setString(2, item.name);
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/spring/pages/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ you must enable the permissions for transactions. For further information, see t
** `semaphore`
** `countDownLatch`
** `lock`
** `externalDataStore`
** `dataConnection`
** `cpmap`
+
[source,xml]
Expand Down
29 changes: 14 additions & 15 deletions docs/modules/sql/pages/mapping-to-jdbc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,31 @@ In the MySQL database, create a `people` table.
CREATE TABLE people (id INT PRIMARY KEY, name VARCHAR(100))
```

Use the `CREATE MAPPING` statement to tell the JDBC connector the name of your data store configuration.
On all your members define a data connection of type `JDBC`:

```yaml
external-data-store:
mysql-database: <1>
class-name: com.hazelcast.datastore.JdbcDataStoreFactory
properties:
jdbcUrl: jdbc:mysql://dummy:3306
username: xyz
password: xyz
shared: true
hazelcast:
data-connection:
my-mysql-database:
type: JDBC
properties:
jdbcUrl: jdbc:mysql://dummy:3306 <1>
user: xyz
password: xyz
shared: true
```
<1> Configuration details for a MySQL database.

Use the `CREATE MAPPING` statement to tell the JDBC connector the name of your data connection.

Create the mapping.

```sql
CREATE MAPPING people
TYPE JDBC <1>
OPTIONS (
'externalDataStoreRef'='mysql-database' <2>
)
DATA CONNECTION 'mysql-database'
```

<1> The name of the connector.
<2> The name of the external data store configuration on your members.
<1> The name of the data connection configuration on your members.

== Data Type Mapping Between Hazelcast and MySQL
Hazelcast supports a subset of SQL data types. For MySQL data types, see the https://dev.mysql.com/doc/refman/8.0/en/data-types.html[official MySQL documentation]. The following MySQL types are mapped to the respective Hazelcast SQL type:
Expand Down

0 comments on commit 1ecd8b0

Please sign in to comment.