cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1040577 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Date Tue, 30 Nov 2010 15:25:29 GMT
Author: jbellis
Date: Tue Nov 30 15:25:29 2010
New Revision: 1040577

URL: http://svn.apache.org/viewvc?rev=1040577&view=rev
Log:
minor cleanup of readSavedCache
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1040577&r1=1040576&r2=1040577&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Tue Nov 30 15:25:29 2010
@@ -263,12 +263,12 @@ public class ColumnFamilyStore implement
     protected Set<DecoratedKey> readSavedCache(File path)
     {
         Set<DecoratedKey> keys = new TreeSet<DecoratedKey>();
-        try
+        if (path.exists())
         {
-            long start = System.currentTimeMillis();
-
-            if (path.exists())
+            try
             {
+                long start = System.currentTimeMillis();
+
                 logger.info(String.format("reading saved cache %s", path));
                 ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new
FileInputStream(path)));
                 while (in.available() > 0)
@@ -280,13 +280,13 @@ public class ColumnFamilyStore implement
                 }
                 in.close();
                 if (logger.isDebugEnabled())
-                    logger.debug(String.format("completed reading (%d ms; %d keys) saved
cache from %s",
+                    logger.debug(String.format("completed reading (%d ms; %d keys) saved
cache %s",
                                                System.currentTimeMillis() - start, keys.size(),
path));
             }
-        }
-        catch (IOException ioe)
-        {
-            logger.warn(String.format("error reading saved cache at %s", path.getAbsolutePath()),
ioe);
+            catch (IOException ioe)
+            {
+                logger.warn(String.format("error reading saved cache %s", path.getAbsolutePath()),
ioe);
+            }
         }
         return keys;
     }



Mime
View raw message