gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] storm/org/nongnu/storm/impl/p2p P2PPool.java


From: Hermanni Hyytiälä
Subject: [Gzz-commits] storm/org/nongnu/storm/impl/p2p P2PPool.java
Date: Wed, 07 May 2003 04:21:57 -0400

CVSROOT:        /cvsroot/storm
Module name:    storm
Changes by:     Hermanni Hyytiälä <address@hidden>      03/05/07 04:21:57

Modified files:
        org/nongnu/storm/impl/p2p: P2PPool.java 

Log message:
        Fix previous commit (logging when performing search in local 
pool/searching in other pools)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/storm/storm/org/nongnu/storm/impl/p2p/P2PPool.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: storm/org/nongnu/storm/impl/p2p/P2PPool.java
diff -u storm/org/nongnu/storm/impl/p2p/P2PPool.java:1.6 
storm/org/nongnu/storm/impl/p2p/P2PPool.java:1.7
--- storm/org/nongnu/storm/impl/p2p/P2PPool.java:1.6    Wed May  7 04:10:31 2003
+++ storm/org/nongnu/storm/impl/p2p/P2PPool.java        Wed May  7 04:21:57 2003
@@ -58,27 +58,28 @@
 
     public Block get(BlockId id) throws IOException {
        try {
-           return cache.get(id);
-           p("Block found from the local pool..."
+           p("Trying to find the block from the local pool...");
+           return cache.get(id);           
        } catch(FileNotFoundException _) {
-           p("Block did't found from the local pool..."
+           p("Block didn't found from the local pool...");
            Collector c = map.get(id.toString());
            for(Iterator i=c.blockingIterator(); i.hasNext();) {
                String url = (String)i.next();
                try {
+                   p("Trying to connect to: " + url);
                    URLConnection conn = new URL(url).openConnection();
-                   String contentType = conn.getContentType();
-                   p("Trying to connect to: " + url
+                   String contentType = conn.getContentType();             
                    if(contentType == null) continue;
                    BlockOutputStream bos = 
                        cache.getBlockOutputStream(conn.getContentType());
                    CopyUtil.copy(conn.getInputStream(), bos);
-                   if(bos.getBlockId().equals(id))
-                       
+                   if(bos.getBlockId().equals(id)) { 
+                       p("Block found @ " + url);
                        return bos.getBlock();
-                   else
+                   } else { 
                        p("Block ids didn't match: "+id+" / "+
-                         bos.getBlockId()+" (from "+url+").");
+                       bos.getBlockId()+" (from "+url+").");
+                   }
                } catch(IOException e) {
                    // next iteration
                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]