Got it

What is Zookeeper Znode?

Created: May 25, 2022 02:39:44Latest reply: May 25, 2022 02:44:42 181 1 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hello, everyone!

Who can help introduce ZooKeeper Znodes?

What are the characteristics of Znode? Thank you!


  • x
  • convention:

Featured Answers
olive.zhao
Admin Created May 25, 2022 02:44:42

Hello, Lisali!

Have a nice day!

Each node in the ZooKeeper directory tree corresponds to a Znode. Each Znode maintains an attribute structure that contains status information such as the version number (data version), and timestamp (ctime, mtime). ZooKeeper uses these features of nodes to implement certain functions. Each time the Znode's data changes, its corresponding version number increases. Whenever the client retrieves data, it also retrieves the version number of the data.

In addition, if a client performs an update or deletion operation on a node, it must provide the version number of the data to be operated on. If the data version number provided does not match the actual data version, the operation will fail.


The Znode is the main entity for clients to access the ZooKeeper. It has the following features:

1. Watches

The client can set the watch (which we call a monitor) on the node.

When the node status changes (adding, deleting, or modifying data), the operations corresponding to the watch are triggered. When the watch is triggered, the ZooKeeper sends only one notification to the client because the watch can be triggered only once.

2. Data access

Data stored on each node in the ZooKeeper needs to be atomically operated.

That is, a read operation obtains all data related to the node, and a write operation replaces all data related to the node.

In addition, each node has its own access control list (ACL). The ACL defines user rights, that is, restricts the operations that a specific user can perform on the target node.

3. Node type

There are two types of nodes in the ZooKeeper: temporary node and permanent node. The type of a node is determined at creation and cannot be changed. The temporary node of the ZooKeeper: The life cycle of the node depends on the session that creates the node.

Once the session ends, the temporary node is automatically deleted, or you can manually delete it.

Note that temporary ZooKeeper nodes cannot have subnodes.

Persistent nodes of ZooKeeper: The life cycle of these nodes is independent of sessions and can be deleted only when the client displays that the deletion operation is performed.

4. Sequential node (guarantee of uniqueness)

When creating a Znode, you can request that an incremental count be added to the end of the ZooKeeper path. This count is unique to the parent of this node and is in the form "d" (10-digit number. If there is no value, add 0s, for example, "00000000001").

Hope this helps!


View more
  • x
  • convention:

All Answers
olive.zhao
olive.zhao Admin Created May 25, 2022 02:44:42

Hello, Lisali!

Have a nice day!

Each node in the ZooKeeper directory tree corresponds to a Znode. Each Znode maintains an attribute structure that contains status information such as the version number (data version), and timestamp (ctime, mtime). ZooKeeper uses these features of nodes to implement certain functions. Each time the Znode's data changes, its corresponding version number increases. Whenever the client retrieves data, it also retrieves the version number of the data.

In addition, if a client performs an update or deletion operation on a node, it must provide the version number of the data to be operated on. If the data version number provided does not match the actual data version, the operation will fail.


The Znode is the main entity for clients to access the ZooKeeper. It has the following features:

1. Watches

The client can set the watch (which we call a monitor) on the node.

When the node status changes (adding, deleting, or modifying data), the operations corresponding to the watch are triggered. When the watch is triggered, the ZooKeeper sends only one notification to the client because the watch can be triggered only once.

2. Data access

Data stored on each node in the ZooKeeper needs to be atomically operated.

That is, a read operation obtains all data related to the node, and a write operation replaces all data related to the node.

In addition, each node has its own access control list (ACL). The ACL defines user rights, that is, restricts the operations that a specific user can perform on the target node.

3. Node type

There are two types of nodes in the ZooKeeper: temporary node and permanent node. The type of a node is determined at creation and cannot be changed. The temporary node of the ZooKeeper: The life cycle of the node depends on the session that creates the node.

Once the session ends, the temporary node is automatically deleted, or you can manually delete it.

Note that temporary ZooKeeper nodes cannot have subnodes.

Persistent nodes of ZooKeeper: The life cycle of these nodes is independent of sessions and can be deleted only when the client displays that the deletion operation is performed.

4. Sequential node (guarantee of uniqueness)

When creating a Znode, you can request that an incremental count be added to the end of the ZooKeeper path. This count is unique to the parent of this node and is in the form "d" (10-digit number. If there is no value, add 0s, for example, "00000000001").

Hope this helps!


View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.