public class GlobalClusterStatusTracker extends Object
| Constructor and Description |
|---|
GlobalClusterStatusTracker() |
| Modifier and Type | Method and Description |
|---|---|
static Iterator<ClusterSpec> |
getClusterFromHostSpecs(HostSpec[] hostSpecs,
Properties info)
Split the clusters in the url, get the master cluster first when there are dual clusters.
|
static ClusterStatus |
getClusterStatus(HostSpec[] hostSpecs) |
static String |
getMasterClusterkey(String key,
boolean block)
If block is set to true, waiting will be prevented if the master cluster cannot be found.
|
static boolean |
isVaildPriorityServers(Properties props)
Determine whether the configuration to support disaster recovery switching is effective.
|
static String |
keyFromClusterSpec(ClusterSpec clusterSpec)
Returns a key representing the cluster based on clusterSpec.
|
static void |
refreshProperties(Properties props)
Submit the cluster information in props.
|
static void |
reportClusterStatus(ClusterSpec clusterSpec,
ClusterStatus clusterStatus)
Store the actual observed cluster status.
|
static void |
reportMasterCluster(Properties props,
ClusterSpec clusterSpec)
The actual primary cluster in the storage cluster.
|
public static void reportClusterStatus(ClusterSpec clusterSpec, ClusterStatus clusterStatus)
clusterSpec - The cluster whose status is known.clusterStatus - Latest known status for the cluster.public static void reportMasterCluster(Properties props, ClusterSpec clusterSpec)
props - clusterSpec - public static ClusterStatus getClusterStatus(HostSpec[] hostSpecs)
hostSpecs - public static void refreshProperties(Properties props)
props - Connection properties.public static String getMasterClusterkey(String key, boolean block)
key - Key in the connection string.block - Concurrency lock.public static boolean isVaildPriorityServers(Properties props)
Return true if the above conditions are met, otherwise, return false.
props - Connection propertiespublic static Iterator<ClusterSpec> getClusterFromHostSpecs(HostSpec[] hostSpecs, Properties info)
hostSpecs - Specification information of all hosts in the cluster.info - the parsed/defaulted connection propertiespublic static String keyFromClusterSpec(ClusterSpec clusterSpec)
clusterSpec - Nodes in the cluster.Copyright © 2023 openGauss. All rights reserved.