Class ClusterRepositoryInfo


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

      • getOrCreateId

        @Nullable
        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.

        Parameters:
        store - the NodeStore instance
        Returns:
        the persistent clusterId
      • getId

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