karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anierb...@apache.org
Subject svn commit: r1466395 - /karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
Date Wed, 10 Apr 2013 09:16:07 GMT
Author: anierbeck
Date: Wed Apr 10 09:16:07 2013
New Revision: 1466395

URL: http://svn.apache.org/r1466395
Log:
[KARAF-2262] - cellar-cloud: The IP is not enough, sometimes the IP is hidden but a valid
dns name is available

Modified:
    karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java

Modified: karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java?rev=1466395&r1=1466394&r2=1466395&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
(original)
+++ karaf/cellar/branches/cellar-2.2.x/cloud/src/main/java/org/apache/karaf/cellar/cloud/BlobStoreDiscoveryService.java
Wed Apr 10 09:16:07 2013
@@ -18,7 +18,9 @@ import org.jclouds.blobstore.BlobStore;
 import org.jclouds.blobstore.BlobStoreContext;
 import org.jclouds.blobstore.BlobStoreContextFactory;
 import org.jclouds.blobstore.domain.Blob;
+import org.jclouds.blobstore.domain.PageSet;
 import org.jclouds.blobstore.domain.StorageMetadata;
+import org.jclouds.blobstore.domain.StorageType;
 import org.jclouds.blobstore.options.ListContainerOptions;
 import org.joda.time.DateTime;
 import org.slf4j.Logger;
@@ -91,7 +93,13 @@ public class BlobStoreDiscoveryService i
         Set<String> members = new HashSet<String>();
         ListContainerOptions opt = new ListContainerOptions();
 
-        for (StorageMetadata md : blobStore.list(container, opt)) {
+        PageSet<? extends StorageMetadata> pageSet = blobStore.list(container, opt);
+        LOGGER.debug("CELLAR CLOUD: storage contains a pageset of size {}", pageSet.size());
+		for (StorageMetadata md : pageSet) {
+			if (md.getType() != StorageType.BLOB) {
+				//skip everything that isn't of type BLOB ...
+				continue;
+			}
             String ip = md.getName();
             Object obj = readBlob(container, ip);
             //Check if ip hasn't been updated recently.
@@ -118,6 +126,7 @@ public class BlobStoreDiscoveryService i
                 }
             }
         }
+        LOGGER.debug("CELLAR CLOUD: returning members {}", members);
         return members;
     }
 



Mime
View raw message