-
Notifications
You must be signed in to change notification settings - Fork 50
Add README instructions to examples [HZ-5257] #1395
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,5 @@ | ||
| # enableBackPressure | ||
|
|
||
| - Start server: | ||
|
|
||
| ```bash | ||
| java -Dhazelcast.config=examples/backpressure/hazelcast-backpressure.xml -cp hazelcast-enterprise-<SERVER VERSION>.jar:hazelcast-<SERVER VERSION>-tests.jar com.hazelcast.core.server.HazelcastMemberStarter | ||
| ``` | ||
|
|
||
| - Run client test: | ||
|
|
||
| ```bash | ||
| ./build/examples/backpressure/enableBackPressure | ||
| ``` | ||
| Please add the hazelcast test jar into server classpath to run this example. E.g. hazelcast-<SERVER VERSION>-tests.jar | ||
| You can obtain the test jar from the Maven repository: | ||
| https://repo1.maven.org/maven2/com/hazelcast/hazelcast/<SERVER VERSION>/hazelcast-<SERVER VERSION>-tests.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,7 @@ | ||
| # Client Statistics Example | ||
| # clientStatistics | ||
|
|
||
| - Start server: | ||
|
|
||
| ```bash | ||
| java -jar hazelcast-<SERVER VERSION>.jar | ||
| ``` | ||
|
|
||
| - Run client test: | ||
|
|
||
| ```bash | ||
| ./build/examples/client-statistics/clientStatistics | ||
| ``` | ||
|
|
||
| - Management Center | ||
| - Start MC using the instructions at https://docs.hazelcast.com/management-center/latest/getting-started/install | ||
| - Open MC in your browser at http://localhost:8080 | ||
| - Connect to the Hazelcast cluster | ||
| - Go to the "Clients" section and observe the client statistics being reported for the test client. | ||
| You need to start the Hazelcast Management Center to see the client statistics( | ||
| see [Install and start Management Center](https://docs.hazelcast.com/management-center/latest/getting-started/install)). | ||
| You can see the details about | ||
| client statistics | ||
| at [View details about a connected client](https://docs.hazelcast.com/management-center/latest/clusters/clients#view-details-about-a-connected-client) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # CP Subsystem Examples | ||
|
|
||
| This is an enterprise feature. Make sure you are running Hazelcast Enterprise Edition cluster to use these examples. | ||
|
|
||
| You can find the detailed information about Hazelcast CP Subsystem and how to quick start | ||
| at [Quickstart](https://docs.hazelcast.com/hazelcast/latest/cp-subsystem/configuration#quickstart). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Blocking Queue Example | ||
|
|
||
| Make sure you start the consumer first to avoid losing messages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Item Listener Example | ||
|
|
||
| Make sure that you start the listener first to avoid missing any events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # IMap Basic Example | ||
|
|
||
| Make sure you run the `fillmap` first to populate the map before running the printall. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Custom Attributes Example | ||
|
|
||
| Write the Java class corresponding to the Car class and put that class or jar (`<my_factory>.jar`) into the classpath | ||
| when starting the server and also add a server config for adding the serializer factory to the server. |
29 changes: 29 additions & 0 deletions
29
examples/distributed-map/custom-attributes/hazelcast-attributes.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. | ||
| ~ | ||
| ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| ~ you may not use this file except in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
| <hazelcast xmlns="http://www.hazelcast.com/schema/config" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://www.hazelcast.com/schema/config | ||
| http://www.hazelcast.com/schema/config/hazelcast-config-5.6.xsd"> | ||
|
|
||
| <serialization> | ||
| <data-serializable-factories> | ||
| <data-serializable-factory factory-id="???"> | ||
| com.hazelcast.client.test.MyIdentifiedDataSerializableFactory | ||
| </data-serializable-factory> | ||
| </data-serializable-factories> | ||
| </serialization> | ||
| </hazelcast> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # IMap Entry Listener Example | ||
|
|
||
| Please make sure to start the listener first to avoid missing any events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Entry Processor Example | ||
|
|
||
| - Write the Java class corresponding to the `employee` class and put that class or jar (`<my_factory>.jar`) into the | ||
| classpath when starting the server and also add a server config for adding the serializer factory to the server. |
29 changes: 29 additions & 0 deletions
29
examples/distributed-map/entry-processor/hazelcast-entry-processor.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. | ||
| ~ | ||
| ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| ~ you may not use this file except in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
| <hazelcast xmlns="http://www.hazelcast.com/schema/config" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://www.hazelcast.com/schema/config | ||
| http://www.hazelcast.com/schema/config/hazelcast-config-5.6.xsd"> | ||
|
|
||
| <serialization> | ||
| <data-serializable-factories> | ||
| <data-serializable-factory factory-id="???"> | ||
| com.hazelcast.client.test.MyIdentifiedDataSerializableFactory | ||
| </data-serializable-factory> | ||
| </data-serializable-factories> | ||
| </serialization> | ||
| </hazelcast> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # PartitionAware Example | ||
|
|
||
| Write the Java class corresponding to the `PartitionAwareString` class and put that class or jar (`<my_factory>.jar`) | ||
| into the classpath when starting the server and also add a server config for adding the serializer factory to the | ||
| server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Query Example | ||
|
|
||
| Write the Java class corresponding to the `employee`, `person`, `employee_entry_comparator`, | ||
| `employee_entry_key_comparator` classes and put the classes or jar (`<my_factory>.jar`) into the classpath when | ||
| starting the server and also add a server config for adding the serializer factory to the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # RemoveAll Example | ||
|
|
||
| Write the Java class corresponding to the `Person`, class and put the class or jar (`<my_factory>.jar`) into the | ||
| classpath when starting the server and also add a server config for adding the serializer factory to the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # ReliableTopic Example | ||
|
|
||
| Make sure that you start the `rtSubscriber` first to avoid missing any events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # ReplicatedMap EntryListener Example | ||
|
|
||
| Make sure that you start the `ListeningMember` first to avoid missing any events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Compact Serialization Example | ||
|
|
||
| Write the Java class corresponding to the `PersonDTO` class, it's serializer class and put that class or | ||
| jar (`<my_factory>.jar`) into the classpath when starting the server and also add a server config for adding the | ||
| serializer factory to the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Custom Serialization Example | ||
|
|
||
| Write the Java class corresponding to the `Person` class, it's serializer class and put that class or | ||
| jar (`<my_factory>.jar`) into the classpath when starting the server and also add a server config for adding the | ||
| serializer factory to the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Global Serializer Example | ||
|
|
||
| Write the Java class corresponding to the `MyGlobalSerializer` class and put that class or | ||
| jar (`<my_factory>.jar`) into the classpath when starting the server and also add a server config for adding the | ||
| serializer factory to the server. |
5 changes: 5 additions & 0 deletions
5
examples/serialization/identified-data-serializable/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # IdentifiedDataSerializable Example | ||
|
|
||
| Write the Java class corresponding to the `Person` class, it's serializer class and put that class or | ||
| jar (`<my_factory>.jar`) into the classpath when starting the server and also add a server config for adding the | ||
| serializer factory to the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Portable Serializer Example | ||
|
|
||
| Write the Java class corresponding to the `Person` class, it's serializer class and put that class or | ||
| jar (`<my_factory>.jar`) into the classpath when starting the server and also add a server config for adding the | ||
| serializer factory to the server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,3 +6,8 @@ hazelcast config xml file (or similarly with yaml or embedded server configurati | |||||||
| ``` | ||||||||
|
|
||||||||
| A sample xml file is shared in this example folder. | ||||||||
|
|
||||||||
| In order to run the portable example (`sql_query_with_portable`), you need to | ||||||||
| Write the Java class corresponding to the `Person` class, it's serializer class and put that class or | ||||||||
| jar (`<my_factory>.jar`) into the classpath when starting the server and also add a server config for adding the | ||||||||
| serializer factory to the server. | ||||||||
|
Contributor
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
Nit line ending |
||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.