Skip to content
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

DOCS-903: add dependencies and POJO tip; backport type-name #1297

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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).
oliverhowell marked this conversation as resolved.
Show resolved Hide resolved

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 you have added the following dependencies to your pom.xml:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better wording would be that they need to be on the classpath. E.g. if you use the full docker image they are. If you use the slim image the hazelcast-mapstore is missing.

Also the section Supported backends below also mentions that you need jdbc driver or in case of using MongoDB you need the hazelcast-jet-mongodb jar. Maybe this could be unified into single place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?

Suggested change
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:
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`.


[source,xml]
----
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-sql</artifactId>
</dependency>

<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-mapstore</artifactId>
</dependency>
----

oliverhowell marked this conversation as resolved.
Show resolved Hide resolved
== 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.

Expand Down Expand Up @@ -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
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>>.

== Configuration Properties for the Generic MapLoader
== Configuration properties for the generic MapLoader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
== Configuration properties for the generic MapLoader
== Configuration properties for the Generic MapLoader

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And is generic mapStore correct then?

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Expand Down Expand Up @@ -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.
27 changes: 23 additions & 4 deletions docs/modules/mapstore/pages/configuring-a-generic-mapstore.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 you have added the following dependencies to your pom.xml:

[source,xml]
----
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-sql</artifactId>
</dependency>

<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-mapstore</artifactId>
</dependency>
----

oliverhowell marked this conversation as resolved.
Show resolved Hide resolved
== 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.

Expand Down Expand Up @@ -70,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
oliverhowell marked this conversation as resolved.
Show resolved Hide resolved

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 <<data-connection-ref, configuration properties>>.

== Configuration Properties for the Generic MapStore
== Configuration properties for the generic mapStore
oliverhowell marked this conversation as resolved.
Show resolved Hide resolved

These configuration properties allow you to configure the generic MapStore and its SQL mapping.

Expand Down Expand Up @@ -443,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.

Expand Down