stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [3/3] stratos git commit: Simplifying cloud controller service implementation
Date Fri, 05 Dec 2014 13:54:21 GMT
Simplifying cloud controller service implementation


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/24ba6982
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/24ba6982
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/24ba6982

Branch: refs/heads/master
Commit: 24ba6982f688f8b1d36b0c35e6d828524fa43cdc
Parents: 3bd20e5
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Fri Dec 5 19:23:58 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Fri Dec 5 19:24:12 2014 +0530

----------------------------------------------------------------------
 .../context/CloudControllerContext.java         |   8 +-
 .../stratos/cloud/controller/iaases/Iaas.java   |   1 -
 .../messaging/topology/TopologyBuilder.java     |  15 +-
 .../impl/CloudControllerServiceImpl.java        | 901 ++++---------------
 .../impl/CloudControllerServiceUtil.java        | 144 +++
 .../services/impl/InstanceCreator.java          | 289 ++++++
 .../services/impl/InstanceTerminator.java       |  99 ++
 7 files changed, 734 insertions(+), 723 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/24ba6982/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
index d3a61bd..ff2dc62 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
@@ -588,9 +588,13 @@ public class CloudControllerContext implements Serializable {
         this.coordinator = coordinator;
     }
 
-    public void persist() throws RegistryException {
+    public void persist() {
         if ((!isClustered()) || (isCoordinator())) {
-            RegistryManager.getInstance().persist(CloudControllerConstants.DATA_RESOURCE,
this);
+            try {
+                RegistryManager.getInstance().persist(CloudControllerConstants.DATA_RESOURCE,
this);
+            } catch (RegistryException e) {
+                log.error("Could not persist cloud controller context in registry", e);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/24ba6982/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/Iaas.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/Iaas.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/Iaas.java
index 5faeca1..b42f8b9 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/Iaas.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/Iaas.java
@@ -81,7 +81,6 @@ public abstract class Iaas {
     
     /**
      * This will deallocate/release the given IP address back to pool.
-     * @param iaasInfo corresponding {@link IaasProvider}
      * @param ip public IP address to be released.
      */
     public abstract void releaseAddress(String ip);

http://git-wip-us.apache.org/repos/asf/stratos/blob/24ba6982/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
index 743ab73..6e2637d 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
@@ -201,7 +201,7 @@ public class TopologyBuilder {
                     log.info("Removed application [ " + appId + " ]'s Cluster [ " + aClusterData.getClusterId()
+ " ] from the topology");
                 }
                 // persist runtime data changes
-                persist(context);
+                CloudControllerContext.getInstance().persist();
             } else {
                 log.info("No cluster data found for application " + appId + " to remove");
             }
@@ -216,19 +216,6 @@ public class TopologyBuilder {
 
     }
 
-    /**
-     * Persist data in registry.
-     */
-    private static void persist(CloudControllerContext context) {
-        try {
-            context.persist();
-        } catch (RegistryException e) {
-            String msg = "Failed to persist the cloud controller context in registry.";
-            log.error(msg);
-            throw new CloudControllerException(msg, e);
-        }
-    }
-
     public static void handleClusterReset(ClusterStatusClusterResetEvent event) {
         TopologyManager.acquireWriteLock();
 


Mime
View raw message