Skip to content

Commit 9aaa378

Browse files
author
Alex Huang
committed
Moved ClusterManager into it's own package. Removed the agent load balancing code.
1 parent 395cbcc commit 9aaa378

38 files changed

Lines changed: 527 additions & 709 deletions

core/src/com/cloud/agent/api/ScheduleHostScanTaskCommand.java

100755100644
File mode changed.

framework/cluster/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
10+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12+
<modelVersion>4.0.0</modelVersion>
13+
<artifactId>cloud-framework-cluster</artifactId>
14+
<name>Apache CloudStack Framework - Clustering</name>
15+
<parent>
16+
<groupId>org.apache.cloudstack</groupId>
17+
<artifactId>cloudstack-framework</artifactId>
18+
<version>4.2.0-SNAPSHOT</version>
19+
<relativePath>../pom.xml</relativePath>
20+
</parent>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.apache.cloudstack</groupId>
24+
<artifactId>cloud-utils</artifactId>
25+
<version>${project.version}</version>
26+
</dependency>
27+
</dependencies>
28+
</project>

server/src/com/cloud/cluster/ActiveFencingException.java renamed to framework/cluster/src/com/cloud/cluster/ActiveFencingException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
// under the License.
1717
package com.cloud.cluster;
1818

19-
import com.cloud.exception.CloudException;
2019

21-
public class ActiveFencingException extends CloudException {
20+
public class ActiveFencingException extends Exception {
2221
private static final long serialVersionUID = -3975376101728211726L;
2322

2423
public ActiveFencingException(String message) {

server/src/com/cloud/cluster/ClusterFenceManager.java renamed to framework/cluster/src/com/cloud/cluster/ClusterFenceManager.java

File renamed without changes.

server/src/com/cloud/cluster/ClusterFenceManagerImpl.java renamed to framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java

File renamed without changes.

engine/schema/src/com/cloud/cluster/ClusterInvalidSessionException.java renamed to framework/cluster/src/com/cloud/cluster/ClusterInvalidSessionException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
// under the License.
1717
package com.cloud.cluster;
1818

19-
import com.cloud.exception.CloudException;
2019

21-
public class ClusterInvalidSessionException extends CloudException {
20+
public class ClusterInvalidSessionException extends Exception {
2221

2322
private static final long serialVersionUID = -6636524194520997512L;
2423

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.cluster;
18+
19+
import com.cloud.utils.component.Manager;
20+
21+
public interface ClusterManager extends Manager {
22+
static final String ALERT_SUBJECT = "cluster-alert";
23+
24+
void OnReceiveClusterServicePdu(ClusterServicePdu pdu);
25+
26+
/**
27+
* This executes
28+
* @param strPeer
29+
* @param agentId
30+
* @param cmds
31+
* @param stopOnError
32+
* @return
33+
*/
34+
String execute(String strPeer, long agentId, String cmds, boolean stopOnError);
35+
36+
/**
37+
* Broadcast the command to all of the management server nodes.
38+
* @param agentId agent id this broadcast is regarding
39+
* @param cmds commands to broadcast
40+
*/
41+
void broadcast(long agentId, String cmds);
42+
43+
int getHeartbeatThreshold();
44+
45+
void registerListener(ClusterManagerListener listener);
46+
void unregisterListener(ClusterManagerListener listener);
47+
48+
void registerDispatcher(Dispatcher dispatcher);
49+
50+
ManagementServerHost getPeer(String peerName);
51+
52+
String getSelfPeerName();
53+
54+
public interface Dispatcher {
55+
String getName();
56+
String dispatch(ClusterServicePdu pdu);
57+
}
58+
}

0 commit comments

Comments
 (0)