cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/master to 4bbaac2
Date Wed, 17 Jul 2013 17:17:14 GMT
Updated Branches:
  refs/heads/master 53e6a1c0f -> 4bbaac2d2


fix NPE in localhostendpoint


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4bbaac2d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4bbaac2d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4bbaac2d

Branch: refs/heads/master
Commit: 4bbaac2d28644100ab92a0825089c6f19ccbcc1a
Parents: 53e6a1c
Author: Edison Su <sudison@gmail.com>
Authored: Wed Jul 17 10:15:38 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Jul 17 10:16:58 2013 -0700

----------------------------------------------------------------------
 .../src/org/apache/cloudstack/storage/LocalHostEndpoint.java   | 6 ++++++
 .../cloudstack/storage/endpoint/DefaultEndPointSelector.java   | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4bbaac2d/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java b/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
index 932a07f..060ad6a 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
 import com.cloud.configuration.Config;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.configuration.dao.ConfigurationDaoImpl;
+import com.cloud.utils.component.ComponentContext;
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.storage.command.CopyCommand;
@@ -56,6 +57,11 @@ public class LocalHostEndpoint implements EndPoint {
         executor = Executors.newScheduledThreadPool(10);
     }
 
+    public static EndPoint getEndpoint() {
+        LocalHostEndpoint endpoint = ComponentContext.inject(LocalHostEndpoint.class);
+        return endpoint;
+    }
+
     @Override
     public long getId() {
         // TODO Auto-generated method stub

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4bbaac2d/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index a44bbec..bbd6b6e 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -191,7 +191,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
         // we can arbitrarily pick one ssvm to do that task
         List<HostVO> ssAHosts = listUpAndConnectingSecondaryStorageVmHost(dcId);
         if (ssAHosts == null || ssAHosts.isEmpty()) {
-            return new LocalHostEndpoint(); // use local host as endpoint in
+            return LocalHostEndpoint.getEndpoint(); // use local host as endpoint in
                                             // case of no ssvm existing
         }
         Collections.shuffle(ssAHosts);


Mime
View raw message