-
Notifications
You must be signed in to change notification settings - Fork 105
DOCS-903: add dependencies and POJO tip; backport type-name #1297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
647caf5
7907fb8
edda967
4176134
543beb0
8d58bb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,16 +1,37 @@ | ||||||
= 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 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. | ||||||
|
||||||
== Quickstart Configuration | ||||||
== Add dependencies | ||||||
|
||||||
If you are using a Hazelcast JAR file, you need to ensure the following is added to your classpath: | ||||||
|
||||||
[source,xml] | ||||||
---- | ||||||
<dependency> | ||||||
<groupId>com.hazelcast</groupId> | ||||||
<artifactId>hazelcast-sql</artifactId> | ||||||
</dependency> | ||||||
|
||||||
<dependency> | ||||||
<groupId>com.hazelcast</groupId> | ||||||
<artifactId>hazelcast-mapstore</artifactId> | ||||||
</dependency> | ||||||
---- | ||||||
|
||||||
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 | ||||||
|
||||||
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 +91,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 | ||||||
oliverhowell marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
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 <<data-connection-ref, configuration properties>>. | ||||||
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 <<data-connection-ref, configuration properties>>. | ||||||
|
||||||
== Configuration Properties for the Generic MapLoader | ||||||
== Configuration properties for the generic MapLoader | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, IMHO should have the same case. This case is used also in the title btw. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've looked at the other sources and I think we should refer to "generic MapLoader" in normal text. I know in code it is "Generic.MapLoader" and we use that when specifically including or referring to code (if we always used code names then our docs and marketing content would be all over the place). Check latest commit for proposed version. |
||||||
|
||||||
These configuration properties allow you to configure the generic MapLoader and its SQL mapping. | ||||||
|
||||||
|
@@ -436,19 +457,19 @@ 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: | ||||||
|
||||||
- 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. | ||||||
See the xref:configuration-guide.adoc[MapStore configuration guide] for details about configuration options, including caching behaviors. |
Uh oh!
There was an error while loading. Please reload this page.