Class ClusterRepositoryInfo


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @Nullable java.lang.String getId​(@NotNull NodeStore store)  
      static @Nullable java.lang.String getOrCreateId​(@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)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OAK_CLUSTERID_REPOSITORY_DESCRIPTOR_KEY

        public static final java.lang.String OAK_CLUSTERID_REPOSITORY_DESCRIPTOR_KEY
        See Also:
        Constant Field Values
      • CLUSTER_CONFIG_NODE

        public static final java.lang.String CLUSTER_CONFIG_NODE
        See Also:
        Constant Field Values
    • Method Detail

      • getOrCreateId

        @Nullable
        public static @Nullable java.lang.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 java.lang.String getId​(@NotNull
                                                       @NotNull NodeStore store)