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

add usages of data structures to documentation #378

Merged
merged 2 commits into from Oct 30, 2018

Conversation

furkansenharputlu
Copy link
Contributor

@furkansenharputlu furkansenharputlu commented Oct 15, 2018

This PR adds the usages of remaining data structures. #340

@furkansenharputlu
Copy link
Contributor Author

verify

@furkansenharputlu furkansenharputlu added this to In progress in 0.10 Oct 15, 2018
@Serdaro
Copy link
Member

Serdaro commented Oct 16, 2018

Are there any notes/exceptional situations/gotchas/important-to-knows for these data structures' usages in the Node.js client?

@furkansenharputlu
Copy link
Contributor Author

@Serdaro I think there is no exception. @mustafaiman Wdyt ?

@mustafaiman
Copy link
Contributor

@Serdaro @furkansenharputlu I dont think there is any difference worth mentioning. I only have one suggestion: Add one sentence on top of each structure to explain what they are. You can take these from Hazelcast Reference Manual. For instance flake id can be explained like this: Hazelcast Flake ID Generator is used to generate cluster-wide unique identifiers. Generated identifiers are long primitive values and are k-ordered (roughly ordered). IDs are in the range from 0 to Long.MAX_VALUE.

@furkansenharputlu furkansenharputlu force-pushed the usingClientDoc branch 2 times, most recently from cfa2cb2 to c852a99 Compare October 26, 2018 12:26
Copy link
Member

@Serdaro Serdaro left a comment

Choose a reason for hiding this comment

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

Few comments. Will be enhanced this weekend.

README.md Outdated

## 7.4.9 Using Lock

Hazelcast Lock(`ILock`) is a distributed lock implementation. You can synchronize hazelcast members and clients using a Lock. For details refer to [Lock section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#lock) in the Hazelcast IMDG Reference Manual.
Copy link
Member

Choose a reason for hiding this comment

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

... Hazelcast members ...

README.md Outdated

Hazelcast `PNCounter` (Positive-Negative Counter) is a distributed counter implementation where each Hazelcast instance can increment and decrement the counter value and these updates are propagated to all replicas. For details refer to [PN Counter section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#pn-counter) in the Hazelcast IMDG Reference Manual.

A CRDT Counter usage example is shown below.
Copy link
Member

Choose a reason for hiding this comment

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

A PN Counter usage ...

Copy link
Contributor

@mustafaiman mustafaiman left a comment

Choose a reason for hiding this comment

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

In general when you say "For details refer to [Semaphore section]", it gives the impression that there is a Semaphore section in this document. I'd say "For details refer to [Hazelcast Reference Manual#Semaphore]"

README.md Outdated
@@ -1493,6 +1504,8 @@ map.put(1, 'Furkan').then(function (oldValue) {

### 7.4.2. Using MultiMap

Hazelcast `MultiMap` is a specialized map where you can store multiple values under a single key. Just like any other distributed data structure implementation in Hazelcast, MultiMap is distributed. For details refer to [MultiMap section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#multimap) in the Hazelcast IMDG Reference Manual.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not every data structure is distributed in Hazelcast.

README.md Outdated
@@ -1525,6 +1540,8 @@ replicatedMap.put(1, 'Furkan').then(function () {

### 7.4.4. Using Queue

Hazelcast Queue(`IQueue`) is a distributed queue which enables all cluster members to interact with it. Using Hazelcast distributed queue, you can add an item in one cluster member and remove it from another one. For details refer to [Queue section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#queue) in the Hazelcast IMDG Reference Manual.
Copy link
Contributor

Choose a reason for hiding this comment

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

The second sentence is redundant I think

README.md Outdated
var list;
hazelcastClient.getList('myList').then(function (l) {
list = l;
return list.add('Mali');
Copy link
Contributor

Choose a reason for hiding this comment

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

is Mali a name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an abbreviation like Tomas-> Tom :)
But I will change it.

README.md Outdated

## 7.4.8. Using Reliable Topic

Hazelcast `ReliableTopic` is backed up by the `Ringbuffer` data structure. For details refer to [Reliable Topic section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#reliable-topic) in the Hazelcast IMDG Reference Manual.
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
Hazelcast `ReliableTopic` is backed up by the `Ringbuffer` data structure. For details refer to [Reliable Topic section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#reliable-topic) in the Hazelcast IMDG Reference Manual.
Hazelcast `ReliableTopic` is a distributed topic implementation backed up by the `Ringbuffer` data structure. For details refer to [Reliable Topic section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#reliable-topic) in the Hazelcast IMDG Reference Manual.

README.md Outdated

## 7.4.9 Using Lock

Hazelcast Lock(`ILock`) is a distributed lock implementation. You can synchronize Hazelcast Members and clients using a Lock. For details refer to [Lock section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#lock) in the Hazelcast IMDG Reference Manual.
Copy link
Contributor

Choose a reason for hiding this comment

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

Members -> members

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Serdaro requested that change. as Hazelcast Members

README.md Outdated
lock = l;
return lock.lock();
}).then(function () {
// critical section
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe the intention would be more understandable if we put cluster wide critical section instead of critical section

README.md Outdated

## 7.4.12 Using PN Counter

Hazelcast `PNCounter` (Positive-Negative Counter) is a distributed counter implementation where each Hazelcast instance can increment and decrement the counter value and these updates are propagated to all replicas. For details refer to [PN Counter section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#pn-counter) in the Hazelcast IMDG Reference Manual.
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
Hazelcast `PNCounter` (Positive-Negative Counter) is a distributed counter implementation where each Hazelcast instance can increment and decrement the counter value and these updates are propagated to all replicas. For details refer to [PN Counter section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#pn-counter) in the Hazelcast IMDG Reference Manual.
Hazelcast `PNCounter` (Positive-Negative Counter) is a CRDT positive-negative counter implementation. It is an eventually consistent counter given there is no member failure. For details refer to [PN Counter section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#pn-counter) in the Hazelcast IMDG Reference Manual.

README.md Outdated

## 7.4.13 Using Flake ID Generator

Hazelcast `FlakeIdGenerator` is used to generate cluster-wide unique identifiers. Generated identifiers are long primitive values and are k-ordered (roughly ordered). IDs are in the range from 0 to Long.MAX_VALUE. For details refer to [FlakeIdGenerator section](https://docs.hazelcast.org/docs/latest/manual/html-single/index.html#flakeidgenerator) in the Hazelcast IMDG Reference Manual.
Copy link
Contributor

Choose a reason for hiding this comment

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

Long.MAX_VALUE is a Java constant. I'd say 2^63-1 (maximum signed long value)

@furkansenharputlu furkansenharputlu force-pushed the usingClientDoc branch 2 times, most recently from ae1d7e2 to 0923f4e Compare October 26, 2018 14:57
Copy link
Member

@Serdaro Serdaro left a comment

Choose a reason for hiding this comment

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

👍

@furkansenharputlu
Copy link
Contributor Author

verify

2 similar comments
@furkansenharputlu
Copy link
Contributor Author

verify

@furkansenharputlu
Copy link
Contributor Author

verify

@furkansenharputlu furkansenharputlu merged commit 9eeced1 into hazelcast:master Oct 30, 2018
@furkansenharputlu furkansenharputlu moved this from In progress to Done in 0.10 Nov 5, 2018
@furkansenharputlu furkansenharputlu moved this from Done to In progress in 0.10 Nov 5, 2018
@furkansenharputlu furkansenharputlu moved this from In progress to Done in 0.10 Nov 5, 2018
harunalpak pushed a commit to harunalpak/hazelcast-nodejs-client that referenced this pull request Dec 8, 2022
* add usages of data structures to documentation

* add brief explanations and give links to reference manual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
0.10
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants