Class Cookie

java.lang.Object
org.apache.bookkeeper.bookie.Cookie

public class Cookie extends Object
When a bookie starts for the first time it generates a cookie, and stores the cookie in registration manager as well as in the each of the local filesystem directories it uses. This cookie is used to ensure that for the life of the bookie, its configuration stays the same. If any of the bookie directories becomes unavailable, the bookie becomes unavailable. If the bookie changes port, it must also reset all of its data. This is done to ensure data integrity. Without the cookie a bookie could start with one of its ledger directories missing, so data would be missing, but the bookie would be up, so the client would think that everything is ok with the cluster. It's better to fail early and obviously.