Class ClusterRepositoryInfo

  • public class ClusterRepositoryInfo
    extends Object
    Utility class to manage a unique cluster/repository id for the cluster.
    • Method Detail

      • getOrCreateId

        public static @Nullable String getOrCreateId​(@NotNull
                                                     @NotNull NodeStore store)
        Gets the {# CLUSTER_ID_PROP} if available, if it doesn't it creates it and returns the newly created one (or if that happened concurrently and another cluster instance won, return that one)

        Note that this method doesn't require synchronization as concurrent execution within the VM would be covered within NodeStore's merge and result in a conflict for one of the two threads - in which case the looser would re-read and find the clusterId set.

        store - the NodeStore instance
        the persistent clusterId
      • getId

        public static @Nullable String getId​(@NotNull
                                             @NotNull NodeStore store)