From 647caf5cae6e3c8bc3689d244e63fb183aa2ba0d Mon Sep 17 00:00:00 2001 From: Oliver Howell Date: Tue, 17 Sep 2024 15:19:28 +0100 Subject: [PATCH 1/4] DOCS-903: add dependencies and POJO tip; backport type-name --- .../configuring-a-generic-maploader.adoc | 31 +++++++++++++++---- .../pages/configuring-a-generic-mapstore.adoc | 19 ++++++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc index c1abd38aa..22bc22bc1 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc @@ -4,13 +4,32 @@ {description} +NOTE: The objects created in the distributed map are stored in a GenericRecord. You can build a map interceptor to store the data in a POJO (Plain Old Java Object). + For a list of all supported external systems, including databases, see available xref:external-data-stores:external-data-stores.adoc#connectors[data connection types]. -== Before you Begin +== Before you begin You need a xref:external-data-stores:external-data-stores.adoc[data connection] that's configured on all cluster members. -== Quickstart Configuration +== Add dependencies + +Add the following dependencies to your pom.xml: + +[source,xml] +---- + + com.hazelcast + hazelcast-sql + + + + com.hazelcast + hazelcast-mapstore + +---- + +== Quickstart configuration This example shows a basic map configuration that uses a data connection called `my-mysql-database`. See xref:data-structures:map.adoc[] for the details of other properties that you can include in your map configuration. @@ -70,11 +89,11 @@ instance().getConfig().addMapConfig(mapConfig); <2> The name of your data connection. [[mapping]] -== SQL Mapping for the Generic MapLoader +== SQL mapping for the generic MapLoader When you configure a map with the generic MapLoader, Hazelcast creates a xref:sql:mapping-to-jdbc.adoc[SQL mapping with the JDBC connector]. The name of the mapping is the same name as your map prefixed with `__map-store.`. This mapping is used to read data from the external system, and it is removed whenever the configured map is removed. You can also configure this SQL mapping, using <>. -== Configuration Properties for the Generic MapLoader +== Configuration properties for the generic MapLoader These configuration properties allow you to configure the generic MapLoader and its SQL mapping. @@ -443,12 +462,12 @@ Officially supported connectors: - MySQL, PostgreSQL, Microsoft SQL Server, Oracle (it uses JDBC SQL Connector). - MongoDB (make sure you have `hazelcast-jet-mongodb` artifact included on the classpath). -== Related Resources +== Related resources - To monitor MapStores for each loaded entry, use the `EntryLoadedListener` interface. See the xref:events:object-events.adoc#listening-for-map-events[Listening for Map Events section] to learn how you can catch entry-based events. - xref:mapstore-triggers.adoc[]. -== Next Steps +== Next steps See the MapStore xref:configuration-guide.adoc[configuration guide] for details about configuration options, including caching behaviors. diff --git a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc index f24407057..107523cb1 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc @@ -4,12 +4,31 @@ {description} +NOTE: The objects created in the distributed map are stored in a GenericRecord. You can build a map interceptor to store the data in a POJO (Plain Old Java Object). + For a list of all supported external systems, including databases, see available xref:external-data-stores:external-data-stores.adoc#connectors[data connection types]. == Before you Begin You need a xref:external-data-stores:external-data-stores.adoc[data connection] that's configured on all cluster members. +== Add dependencies + +Add the following dependencies to your pom.xml: + +[source,xml] +---- + + com.hazelcast + hazelcast-sql + + + + com.hazelcast + hazelcast-mapstore + +---- + == Quickstart Configuration This example shows a basic map configuration that uses a data connection called `my-mysql-database`. See xref:data-structures:map.adoc[] for the details of other properties that you include in your map configuration. From 7907fb8a83fcc22c067397736d711689d5b08c1b Mon Sep 17 00:00:00 2001 From: Oliver Howell Date: Tue, 17 Sep 2024 15:35:55 +0100 Subject: [PATCH 2/4] DOCS-903: add jar note --- .../pages/configuring-a-generic-maploader.adoc | 2 +- .../mapstore/pages/configuring-a-generic-mapstore.adoc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc index 22bc22bc1..e57b7ad99 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc @@ -14,7 +14,7 @@ You need a xref:external-data-stores:external-data-stores.adoc[data connection] == Add dependencies -Add the following dependencies to your pom.xml: +If you are using a Hazelcast JAR file, you need to ensure you have added the following dependencies to your pom.xml: [source,xml] ---- diff --git a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc index 107523cb1..165410316 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc @@ -14,7 +14,7 @@ You need a xref:external-data-stores:external-data-stores.adoc[data connection] == Add dependencies -Add the following dependencies to your pom.xml: +If you are using a Hazelcast JAR file, you need to ensure you have added the following dependencies to your pom.xml: [source,xml] ---- @@ -29,7 +29,7 @@ Add the following dependencies to your pom.xml: ---- -== Quickstart Configuration +== Quickstart configuration This example shows a basic map configuration that uses a data connection called `my-mysql-database`. See xref:data-structures:map.adoc[] for the details of other properties that you include in your map configuration. @@ -89,11 +89,11 @@ instance().getConfig().addMapConfig(mapConfig); <2> The name of your data connection. [[mapping]] -== SQL Mapping for the Generic MapStore +== SQL mapping for the generic mapStore When you configure a map with the generic MapStore, Hazelcast creates a xref:sql:mapping-to-jdbc.adoc[SQL mapping with the JDBC connector]. The name of the mapping is the same name as your map prefixed with `__map-store.`. This mapping is used to read data from or write data to the external system and it is removed whenever the configured map is removed. You can also configure this SQL mapping, using <>. -== Configuration Properties for the Generic MapStore +== Configuration properties for the generic mapStore These configuration properties allow you to configure the generic MapStore and its SQL mapping. @@ -462,7 +462,7 @@ Officially supported connectors: - MySQL, PostgreSQL, Microsoft SQL Server, Oracle (it uses JDBC SQL Connector). - MongoDB (make sure you have `hazelcast-jet-mongodb` artifact included on the classpath). -== Related Resources +== Related resources - To monitor MapStores for each loaded entry, use the `EntryLoadedListener` interface. See the xref:events:object-events.adoc#listening-for-map-events[Listening for Map Events section] to learn how you can catch entry-based events. From edda9672dba81b857c58d09f9460002d1d3bda12 Mon Sep 17 00:00:00 2001 From: Oliver Howell Date: Wed, 18 Sep 2024 09:48:45 +0100 Subject: [PATCH 3/4] DOCS-903: fix GR and POJO refs --- .../pages/configuring-a-generic-maploader.adoc | 12 +++++++----- .../pages/configuring-a-generic-mapstore.adoc | 18 ++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc index e57b7ad99..490287a4c 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc @@ -1,10 +1,10 @@ -= Using the Generic MapLoader += Using the generic MapLoader :description: With the xref:working-with-external-data.adoc#options[generic MapLoader], you can configure a map to cache data from an external system. This topic includes an example of how to configure a map with a generic MapLoader that connects to a MySQL database. :page-beta: false {description} -NOTE: The objects created in the distributed map are stored in a GenericRecord. You can build a map interceptor to store the data in a POJO (Plain Old Java Object). +NOTE: The objects created in the distributed map are stored as GenericRecord. You can use the `type-name` property to store the data in a POJO (Plain Old Java Object). For a list of all supported external systems, including databases, see available xref:external-data-stores:external-data-stores.adoc#connectors[data connection types]. @@ -29,6 +29,8 @@ If you are using a Hazelcast JAR file, you need to ensure you have added the fol ---- +If you are using the slim distribution (including Docker), make sure the `hazelcast-mapstore` JAR is added to the classpath e.g. add it to the `custom-lib` directory. + == Quickstart configuration This example shows a basic map configuration that uses a data connection called `my-mysql-database`. See xref:data-structures:map.adoc[] for the details of other properties that you can include in your map configuration. @@ -91,7 +93,7 @@ instance().getConfig().addMapConfig(mapConfig); [[mapping]] == SQL mapping for the generic MapLoader -When you configure a map with the generic MapLoader, Hazelcast creates a xref:sql:mapping-to-jdbc.adoc[SQL mapping with the JDBC connector]. The name of the mapping is the same name as your map prefixed with `__map-store.`. This mapping is used to read data from the external system, and it is removed whenever the configured map is removed. You can also configure this SQL mapping, using <>. +When you configure a map with the generic MapLoader, Hazelcast creates a xref:sql:mapping-to-jdbc.adoc[SQL mapping with the JDBC connector]. The name of the mapping is the same name as your map prefixed with `__map-store.`. This mapping is used to read data from the external system, and is removed whenever the configured map is removed. You can also configure this SQL mapping, using <>. == Configuration properties for the generic MapLoader @@ -455,7 +457,7 @@ mapConfig.setMapStoreConfig(mapStoreConfig); == Supported backends -GenericMapStore needs a SQL Connector that supports `SELECT`, `UPDATE`, `SINK INTO` and `DELETE` statements. +The generic MapStore needs a SQL Connector that supports `SELECT`, `UPDATE`, `SINK INTO` and `DELETE` statements. Officially supported connectors: @@ -470,4 +472,4 @@ Officially supported connectors: == Next steps -See the MapStore xref:configuration-guide.adoc[configuration guide] for details about configuration options, including caching behaviors. +See the xref:configuration-guide.adoc[MapStore configuration guide] for details about configuration options, including caching behaviors. diff --git a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc index 165410316..51a2b7367 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc @@ -1,14 +1,14 @@ -= Using the Generic MapStore += Using the generic MapStore :description: With the xref:working-with-external-data.adoc#options[generic MapStore], you can configure a map to cache data from and write data back to an external system. This topic includes an example of how to configure a map with a generic MapStore that connects to a MySQL database. :page-beta: false {description} -NOTE: The objects created in the distributed map are stored in a GenericRecord. You can build a map interceptor to store the data in a POJO (Plain Old Java Object). +NOTE: The objects created in the distributed map are stored as GenericRecord. You can use the `type-name` property to store the data in a POJO (Plain Old Java Object). For a list of all supported external systems, including databases, see available xref:external-data-stores:external-data-stores.adoc#connectors[data connection types]. -== Before you Begin +== Before you begin You need a xref:external-data-stores:external-data-stores.adoc[data connection] that's configured on all cluster members. @@ -29,6 +29,8 @@ If you are using a Hazelcast JAR file, you need to ensure you have added the fol ---- +If you are using the slim distribution (including Docker), make sure the `hazelcast-mapstore` JAR is added to the classpath e.g. add it to the `custom-lib` directory. + == Quickstart configuration This example shows a basic map configuration that uses a data connection called `my-mysql-database`. See xref:data-structures:map.adoc[] for the details of other properties that you include in your map configuration. @@ -89,11 +91,11 @@ instance().getConfig().addMapConfig(mapConfig); <2> The name of your data connection. [[mapping]] -== SQL mapping for the generic mapStore +== SQL mapping for the generic MapStore -When you configure a map with the generic MapStore, Hazelcast creates a xref:sql:mapping-to-jdbc.adoc[SQL mapping with the JDBC connector]. The name of the mapping is the same name as your map prefixed with `__map-store.`. This mapping is used to read data from or write data to the external system and it is removed whenever the configured map is removed. You can also configure this SQL mapping, using <>. +When you configure a map with the generic MapStore, Hazelcast creates a xref:sql:mapping-to-jdbc.adoc[SQL mapping with the JDBC connector]. The name of the mapping is the same name as your map prefixed with `__map-store.`. This mapping is used to read data from or write data to the external system and is removed whenever the configured map is removed. You can also configure this SQL mapping, using <>. -== Configuration properties for the generic mapStore +== Configuration properties for the generic MapStore These configuration properties allow you to configure the generic MapStore and its SQL mapping. @@ -455,7 +457,7 @@ mapConfig.setMapStoreConfig(mapStoreConfig); == Supported backends -GenericMapStore needs a SQL Connector that supports `SELECT`, `UPDATE`, `SINK INTO` and `DELETE` statements. +The generic MapStore needs a SQL Connector that supports `SELECT`, `UPDATE`, `SINK INTO` and `DELETE` statements. Officially supported connectors: @@ -470,4 +472,4 @@ Officially supported connectors: == Next Steps -See the MapStore xref:configuration-guide.adoc[configuration guide] for details about configuration options, including caching behaviors. +See the xref:configuration-guide.adoc[MapStore configuration guide] for details about configuration options, including caching behaviors. From 543beb00463b7386f1edb64ae07b81723a98b1cc Mon Sep 17 00:00:00 2001 From: Oliver Howell Date: Wed, 18 Sep 2024 12:22:31 +0100 Subject: [PATCH 4/4] DOCS-903: final review suggestions --- .../mapstore/pages/configuring-a-generic-maploader.adoc | 4 ++-- .../mapstore/pages/configuring-a-generic-mapstore.adoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc index 490287a4c..4752a4731 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-maploader.adoc @@ -14,7 +14,7 @@ You need a xref:external-data-stores:external-data-stores.adoc[data connection] == Add dependencies -If you are using a Hazelcast JAR file, you need to ensure you have added the following dependencies to your pom.xml: +If you are using a Hazelcast JAR file, you need to ensure the following is added to your classpath: [source,xml] ---- @@ -29,7 +29,7 @@ If you are using a Hazelcast JAR file, you need to ensure you have added the fol ---- -If you are using the slim distribution (including Docker), make sure the `hazelcast-mapstore` JAR is added to the classpath e.g. add it to the `custom-lib` directory. +NOTE: If you are using the slim distribution, you need to add `hazelcast-mapstore`. If you are using MongoDb, you also need to add `hazelcast-jet-mongodb`. == Quickstart configuration diff --git a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc index 51a2b7367..77f146d94 100644 --- a/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc +++ b/docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc @@ -14,7 +14,7 @@ You need a xref:external-data-stores:external-data-stores.adoc[data connection] == Add dependencies -If you are using a Hazelcast JAR file, you need to ensure you have added the following dependencies to your pom.xml: +If you are using a Hazelcast JAR file, you need to ensure the following is added to your classpath: [source,xml] ---- @@ -29,7 +29,7 @@ If you are using a Hazelcast JAR file, you need to ensure you have added the fol ---- -If you are using the slim distribution (including Docker), make sure the `hazelcast-mapstore` JAR is added to the classpath e.g. add it to the `custom-lib` directory. +NOTE: If you are using the slim distribution, you need to add `hazelcast-mapstore`. If you are using MongoDb, you also need to add `hazelcast-jet-mongodb`. == Quickstart configuration