Class MetadataUpdateLoop


  • class MetadataUpdateLoop
    extends java.lang.Object
    Mechanism to safely update the metadata of a ledger.

    The loop takes the following steps: 1. Check if the metadata needs to be changed. 2. Make a copy of the metadata and modify it. 3. Write the modified copy to zookeeper. 3.1 If the write succeeds, go to 6. 3.2 If the write fails because of a failed compare and swap, go to 4. 4. Read the metadata back from the store 5. Update the local copy of the metadata with the metadata read in 4, go to 1. 6. Update the local copy of the metadata with the metadata which has just been written.

    All mutating operations are compare and swap operation. If the compare fails, another iteration of the loop begins.