use of com.alibaba.cobar.config.model.CobarNodeConfig in project cobar by alibaba.
the class CobarDetectorFactory method make.
public CobarDetector make(CobarHeartbeat heartbeat) throws IOException {
SocketChannel channel = openSocketChannel();
CobarNodeConfig cnc = heartbeat.getNode().getConfig();
SystemConfig sys = CobarServer.getInstance().getConfig().getSystem();
CobarDetector detector = new CobarDetector(channel);
detector.setHost(cnc.getHost());
detector.setPort(cnc.getPort());
detector.setUser(sys.getClusterHeartbeatUser());
detector.setPassword(sys.getClusterHeartbeatPass());
detector.setHeartbeatTimeout(sys.getClusterHeartbeatTimeout());
detector.setHeartbeat(heartbeat);
postConnect(detector, CobarServer.getInstance().getConnector());
return detector;
}
use of com.alibaba.cobar.config.model.CobarNodeConfig in project cobar by alibaba.
the class ShowCobarCluster method getRow.
private static RowDataPacket getRow(CobarNode node, String charset) {
CobarNodeConfig conf = node.getConfig();
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(StringUtil.encode(conf.getHost(), charset));
row.add(IntegerUtil.toBytes(conf.getWeight()));
return row;
}
Aggregations