Class ClusterRepositoryInfo
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.cluster.ClusterRepositoryInfo
-
public class ClusterRepositoryInfo extends Object
Utility class to manage a unique cluster/repository id for the cluster.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLUSTER_CONFIG_NODE
static String
CLUSTER_ID_PROP
static String
OAK_CLUSTERID_REPOSITORY_DESCRIPTOR_KEY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @Nullable String
getId(@NotNull NodeStore store)
static @Nullable 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)
-
-
-
Field Detail
-
OAK_CLUSTERID_REPOSITORY_DESCRIPTOR_KEY
public static final String OAK_CLUSTERID_REPOSITORY_DESCRIPTOR_KEY
- See Also:
- Constant Field Values
-
CLUSTER_CONFIG_NODE
public static final String CLUSTER_CONFIG_NODE
- See Also:
- Constant Field Values
-
CLUSTER_ID_PROP
public static final String CLUSTER_ID_PROP
- See Also:
- Constant Field Values
-
-
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
-
-