BP-41 BookieId - client side implementation (#2404)

### Motivation

This is the client side implementation of BP-41, see the design doc here
https://github.com/apache/bookkeeper/blob/master/site/bps/BP-41-bookieid.md

### Changes

- Introduce BookeId concept
- Separated BookieId from BookieSocketAddress
- in LedgerMetadata we use now BookieId and not BookieSocketAddress
- a BookieId is basically a wrapper around a string
- BookieId is compatible with BookieSocketAddress
- In order to *resolve" a BookieId to a BookieSocketAddress we use a BookieAddressResolver
- the DefaultBookieAddressResolver implementation uses BookieServiceInfo metadata, read from ZooKeeper in order to discover the current network address of the Bookie (see BP-38)

Unfortunately the patch is huge due to the changes in the client API and LedgerMetadata. This patch tries to be the smallest set of changes, see #2396 for the list of the follow up patches that will be contributed.

Notes:
- The new client and the bookie is 100% compatible with previous Bookies and Clients (and integration tests were not touched)
- We are going to introduce, in a follow up patch, a flag to not use the metadata on ZooKeeper for the resolution of the BookieSocketAddress, in order to save resources
- The ability to configure a custom BookieId, different from the network address will come in a separate patch



Master Issue: #2396 

Co-authored-by: Enrico Olivelli <eolivelli@apache.org>
Co-authored-by: Enrico Olivelli <enrico.olivelli@diennea.com>
221 files changed
tree: 5c7efbac0ab379839e9cf0a7527efa0d9c50a763
  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-stats/
  12. bookkeeper-stats-providers/
  13. buildtools/
  14. circe-checksum/
  15. conf/
  16. cpu-affinity/
  17. deploy/
  18. dev/
  19. docker/
  20. metadata-drivers/
  21. microbenchmarks/
  22. shaded/
  23. site/
  24. stats/
  25. stream/
  26. tests/
  27. tools/
  28. .gitignore
  29. LICENSE
  30. NOTICE
  31. pom.xml
  32. README.md
README.md

Build Status Build Status Coverage Status 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.
  • Message Store, e.g. Apache Pulsar.
  • Offset/Cursor Store, e.g. Apache Pulsar.
  • Object/Blob Store, e.g. storing state machine snapshots.

Get Started

  • Concepts: Start with the basic concepts of Apache BookKeeper. This will help you to fully understand the other parts of the documentation.
  • Getting Started to setup BookKeeper to write logs.

Documentation

Developers

You can also read Turning Ledgers into Logs to learn how to turn ledgers into continuous log streams. If you are looking for a high level log stream API, you can checkout DistributedLog.

Administrators

Contributors

Get In Touch

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, help us out by opening a Github issue or opening an Apache jira.

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 Developer Setup to get your local environment setup.

  2. Take a look at our open issues: JIRA Issues Github Issues.

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

  4. Make your changes according to our contribution guide.

Improving Website and Documentation

  1. See Building the website and documentation on how to build the website and documentation.