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

[11.0.x] ISPN-12490 CounterManager in HR docs #8874

Merged
merged 1 commit into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ include::{topics}/ref_hotrod_remote_iterator.adoc[leveloffset=+1]
include::{topics}/proc_using_custom_filters.adoc[leveloffset=+2]
include::{topics}/ref_hotrod_versioned_api.adoc[leveloffset=+1]
include::{topics}/ref_hotrod_streaming_api.adoc[leveloffset=+1]
include::{topics}/ref_hotrod_countermanager.adoc[leveloffset=+1]
include::{topics}/ref_hotrod_listeners.adoc[leveloffset=+1]
include::{topics}/ref_hotrod_client_transactions.adoc[leveloffset=+1]


// Restore the parent context.
ifdef::parent-context[:context: {parent-context}]
ifndef::parent-context[:!context:]
16 changes: 9 additions & 7 deletions documentation/src/main/asciidoc/topics/counters.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[clustered_counters]]
[id='clustered_counters']
= Clustered Counters

_Clustered counters_ are counters which are distributed and shared among all nodes in the {brandname} cluster.
Expand Down Expand Up @@ -100,10 +100,13 @@ Its value *must be positive* and the default value is `16`.
To list all the counters defined, the method `CounterManager.getCounterNames()` returns a collection of all counter
names created cluster-wide.

== The `CounterManager` interface.
== `CounterManager` interface

The `CounterManager` interface is the entry point to define, retrieve and remove a counter.
It automatically listen to the creation of `EmbeddedCacheManager` and proceeds with the registration of an
The `CounterManager` interface is the entry point to define, retrieve and remove counters.

.Embedded deployments

`CounterManager` automatically listen to the creation of `EmbeddedCacheManager` and proceeds with the registration of an
instance of it per `EmbeddedCacheManager`.
It starts the caches needed to store the counter state and configures the default counters.

Expand All @@ -116,7 +119,8 @@ as shown in the example below:
include::code_examples/CounterManagerEmbedded.java[]
----

For Hot Rod client, the `CounterManager` is registered in the RemoteCacheManager and it can be retrieved like:
.Server deployments
For Hot Rod clients, the `CounterManager` is registered in the RemoteCacheManager and can be retrieved as follows:

[source,java]
----
Expand All @@ -125,8 +129,6 @@ include::code_examples/CounterManagerRemote.java[]

=== Remove a counter via CounterManager

WARNING: use with caution.

There is a difference between remove a counter via the `Strong/WeakCounter` interfaces and the `CounterManager`.
The `CounterManager.remove(String)` removes the counter value from the cluster and removes all the listeners registered
in the counter in the local counter instance.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[id='remotecache_countermanager-{context}']
= Counter API
The `CounterManager` interface is the entry point to define, retrieve and remove counters.

Hot Rod clients can retrieve the `CounterManager` interface as in the following example:

[source,java]
----
include::code_examples/CounterManagerRemote.java[]
----

.Reference

* link:{dev_docs}#clustered_counters[Clustered Counters]