Add Cookie to LocalBookie (#4052)

### Motivation

I tried to use command `bin/bookkeeper shell listbookies -a` to get all bookies from localbookie, it raised error

```
ERROR Fail to process command 'list'
org.apache.bookkeeper.client.BKException$ZKException: Error while using ZooKeeper
        at org.apache.bookkeeper.discover.ZKRegistrationClient.lambda$getChildren$4(ZKRegistrationClient.java:352) ~[bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]
        at org.apache.bookkeeper.zookeeper.ZooKeeperClient$25$1.processResult(ZooKeeperClient.java:1177) ~[bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]
        at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:668) ~[zookeeper-3.8.1.jar:3.8.1]
        at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:553) ~[zookeeper-3.8.1.jar:3.8.1]
Caused by: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /ledgers/cookies
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:118) ~[zookeeper-3.8.1.jar:3.8.1]
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:54) ~[zookeeper-3.8.1.jar:3.8.1]
        at org.apache.bookkeeper.discover.ZKRegistrationClient.lambda$getChildren$4(ZKRegistrationClient.java:351) ~[bookkeeper-server-4.17.0-SNAPSHOT.jar:4.17.0-SNAPSHOT]
        ... 3 more

```

The reason is that no /ledgers/cookies are created in ZK when starting the local bk server. After applying this change, the command works.
1 file changed
tree: a866d6688c371beb2384844d7a2ad88ddaa4c696
  1. .github/
  2. .test-infra/
  3. bin/
  4. bookkeeper-benchmark/
  5. bookkeeper-common/
  6. bookkeeper-common-allocator/
  7. bookkeeper-dist/
  8. bookkeeper-http/
  9. bookkeeper-proto/
  10. bookkeeper-server/
  11. bookkeeper-slogger/
  12. buildtools/
  13. circe-checksum/
  14. conf/
  15. cpu-affinity/
  16. deploy/
  17. dev/
  18. docker/
  19. metadata-drivers/
  20. microbenchmarks/
  21. native-io/
  22. shaded/
  23. site3/
  24. src/
  25. stats/
  26. stream/
  27. tests/
  28. testtools/
  29. tools/
  30. .asf.yaml
  31. .dlc.json
  32. .gitignore
  33. CONTRIBUTING.md
  34. LICENSE
  35. NOTICE
  36. pom.xml
  37. README.md
README.md

Maven Central

Apache BookKeeper

Apache BookKeeper is a scalable, fault-tolerant and low latency storage service optimized for append-only workloads.

It is suitable for being used in following scenarios:

  • WAL (Write-Ahead-Logging), e.g. HDFS NameNode, Pravega.
  • Message Store, e.g. Apache Pulsar.
  • Offset/Cursor Store, e.g. Apache Pulsar.
  • Object/Blob Store, e.g. storing state machine snapshots.

Get Started

  • Checkout the project website.
  • Concepts: Start with the basic concepts of Apache BookKeeper. This will help you to fully understand the other parts of the documentation.
  • Follow the Installation guide to set up BookKeeper.

Documentation

Please visit the Documentation from the project website for more information.

Get In Touch

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, help us out by opening a GitHub issue.

Need Help?

Subscribe or mail the user@bookkeeper.apache.org list - Ask questions, find answers, and also help other users.

Subscribe or mail the dev@bookkeeper.apache.org list - Join development discussions, propose new ideas and connect with contributors.

Join us on Slack - This is the most immediate way to connect with Apache BookKeeper committers and contributors.

Contributing

We feel that a welcoming open community is important and welcome contributions.

Contributing Code

  1. See our installation guide to get your local environment setup.

  2. Take a look at our open issues: GitHub Issues.

  3. Review our coding style and follow our pull requests to learn more about our conventions.

  4. Make your changes according to our contributing guide