org.postgresql.clusterhealthy.FailureCluster Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mogdb-jdbc Show documentation
Show all versions of mogdb-jdbc Show documentation
Java JDBC driver for MogDB
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
package io.mogdb.clusterhealthy;
import io.mogdb.util.HostSpec;
import java.util.Properties;
import java.util.Set;
/**
* Cluster information instance, including primary and secondary nodes and connection information
*/
public class FailureCluster {
private HostSpec master;
private Set salves;
private Set props;
private int frequency;
/**
*
* @param master Current master node
* @param salves Slave set
* @param props Connection information
*/
public FailureCluster(HostSpec master, Set salves, Set props, Integer frequency) {
this.master = master;
this.salves = salves;
this.props = props;
this.frequency = null == frequency ? 0 : frequency;
}
public int getFrequency() {
return frequency;
}
public void setFrequency(int frequency) {
this.frequency = frequency;
}
public void setSalves(Set salves) {
this.salves = salves;
}
public void setProps(Set props) {
this.props = props;
}
public void setMaster(HostSpec master) {
this.master = master;
}
public HostSpec getMaster() {
return master;
}
public Set getSalves() {
return salves;
}
public Set getProps() {
return props;
}
@Override
public String toString() {
return "FailureCluster{" +
"master=" + master +
", salves=" + salves +
'}';
}
}