Book Image

Apache ZooKeeper Essentials

By : Haloi
Book Image

Apache ZooKeeper Essentials

By: Haloi

Overview of this book

Whether you are a novice to ZooKeeper or already have some experience, you will be able to master the concepts of ZooKeeper and its usage with ease. This book assumes you to have some prior knowledge of distributed systems and high-level programming knowledge of C, Java, or Python, but no experience with Apache ZooKeeper is required.
Table of Contents (9 chapters)
4
4. Performing Common Distributed System Tasks
8
Index

Quota and authorization

ZooKeeper has configurable quotas associated with its data model. It's possible to set the quota limit on the znodes and the data amount of data stored. If a subtree in the ZooKeeper namespace crosses the quota associated with it, ZooKeeper prints warning messages in the log. However, the operation is never cancelled if the quota assigned is exceeded.

ZooKeeper quotas are stored in the ZooKeeper tree in the /zookeeper/quota path. It is possible to set, list, and delete quotas from the ZooKeeper client APIs and through the ZooKeeper Java shell. The following screenshot shows the results of using the set, list, and del commands:

Quota and authorization

In the preceding example, we created a new znode called /quota_example and set a quota of two child znodes. We then did a listing of the assigned quota and also saw how to delete the assigned quota.

When we created the third child under /quota_example, the following log message is printed as a warning in the ZooKeeper logfile, informing us...