cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1040579 - in /cassandra/branches/cassandra-0.6: ./ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/io/
Date Tue, 30 Nov 2010 15:26:46 GMT
Author: jbellis
Date: Tue Nov 30 15:26:46 2010
New Revision: 1040579

URL: http://svn.apache.org/viewvc?rev=1040579&view=rev
Log:
backport r1040536, r1040577 from 0.7

Modified:
    cassandra/branches/cassandra-0.6/   (props changed)
    cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
  (props changed)
    cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
  (props changed)
    cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableReader.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableTracker.java

Propchange: cassandra/branches/cassandra-0.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 30 15:26:46 2010
@@ -1,3 +1,4 @@
+/cassandra/branches/cassandra-0.7:1040536
 /cassandra/trunk:931148,963941
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350

Propchange: cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 30 15:26:46 2010
@@ -1,3 +1,4 @@
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1040536
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:931148,963941
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350

Propchange: cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 30 15:26:46 2010
@@ -1,3 +1,4 @@
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1040536
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:931148,963941
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350

Propchange: cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 30 15:26:46 2010
@@ -1,3 +1,4 @@
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1040536
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:931148,963941
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350

Propchange: cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 30 15:26:46 2010
@@ -1,3 +1,4 @@
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1040536
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:931148,963941
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350

Propchange: cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 30 15:26:46 2010
@@ -1,3 +1,4 @@
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1040536
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:931148,963941
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1040579&r1=1040578&r2=1040579&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Tue Nov 30 15:26:46 2010
@@ -177,7 +177,7 @@ public class ColumnFamilyStore implement
         }
         Collections.sort(sstableFiles, new FileUtils.FileComparator());
 
-        /* Load the index files and the Bloom Filters associated with them. */
+        // scan for sstables corresponding to this cf and load them
         ssTables_ = new SSTableTracker(table, columnFamilyName);
         Set<String> savedKeys = readSavedCache(DatabaseDescriptor.getSerializedKeyCachePath(table,
columnFamilyName), false);
         List<SSTableReader> sstables = new ArrayList<SSTableReader>();
@@ -202,7 +202,7 @@ public class ColumnFamilyStore implement
         ssTables_.add(sstables);
     }
 
-    protected Set<String> readSavedCache(File path, boolean sort) throws IOException
+    protected Set<String> readSavedCache(File path, boolean sort)
     {
         Set<String> keys;
         if (sort)
@@ -215,25 +215,31 @@ public class ColumnFamilyStore implement
         {
             keys = new HashSet<String>();
         }
-        
-        long start = System.currentTimeMillis();
+
         if (path.exists())
         {
-            if (logger_.isDebugEnabled())
-                logger_.debug("reading saved cache from " + path);
-            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(path)));
-            Charset UTF8 = Charset.forName("UTF-8");
-            while (in.available() > 0)
-            {
-                int size = in.readInt();
-                byte[] bytes = new byte[size];
-                in.readFully(bytes);
-                keys.add(new String(bytes, UTF8));
+            try
+            {
+                long start = System.currentTimeMillis();
+                logger_.info("reading saved cache " + path);
+                ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new
FileInputStream(path)));
+                Charset UTF8 = Charset.forName("UTF-8");
+                while (in.available() > 0)
+                {
+                    int size = in.readInt();
+                    byte[] bytes = new byte[size];
+                    in.readFully(bytes);
+                    keys.add(new String(bytes, UTF8));
+                }
+                in.close();
+                if (logger_.isDebugEnabled())
+                    logger_.debug(String.format("completed reading (%d ms; %d keys) saved
cache %s",
+                                                (System.currentTimeMillis() - start), keys.size(),
path));
+            }
+            catch (IOException ioe)
+            {
+                logger_.warn("error reading saved cache " + path, ioe);
             }
-            in.close();
-            if (logger_.isDebugEnabled())
-                logger_.debug(String.format("completed reading (%d ms; %d keys) from saved
cache at %s",
-                                            (System.currentTimeMillis() - start), keys.size(),
path));
         }
 
         return keys;
@@ -246,19 +252,21 @@ public class ColumnFamilyStore implement
         int rowCacheSavePeriodInSeconds = DatabaseDescriptor.getTableMetaData(table_).get(columnFamily_).rowCacheSavePeriodInSeconds;
         int keyCacheSavePeriodInSeconds = DatabaseDescriptor.getTableMetaData(table_).get(columnFamily_).keyCacheSavePeriodInSeconds;
 
+        long start = System.currentTimeMillis();
         try
         {
-            long start = System.currentTimeMillis();
-            logger_.info(String.format("loading%s", msgSuffix));
             for (String key : readSavedCache(DatabaseDescriptor.getSerializedRowCachePath(table_,
columnFamily_), true))
                 cacheRow(key);
-            logger_.info(String.format("completed loading (%d ms; %d keys) %s",
-                                       System.currentTimeMillis()-start, ssTables_.getRowCache().getSize(),
msgSuffix));
         }
         catch (IOException ioe)
         {
             logger_.warn("error loading " + msgSuffix, ioe);
         }
+        if (ssTables_.getRowCache().getSize() > 0)
+            logger_.info(String.format("completed loading (%d ms; %d keys) %s",
+                                       System.currentTimeMillis() - start,
+                                       ssTables_.getRowCache().getSize(),
+                                       msgSuffix));
 
         rowCacheWriteTask = new WrappedRunnable()
         {

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableReader.java?rev=1040579&r1=1040578&r2=1040579&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableReader.java (original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableReader.java Tue
Nov 30 15:26:46 2010
@@ -122,7 +122,7 @@ public class SSTableReader extends SSTab
         long start = System.currentTimeMillis();
         SSTableReader sstable = new SSTableReader(dataFileName, partitioner);
         sstable.setTrackedBy(tracker);
-        logger.info("Sampling index and loading saved keyCache for " + dataFileName + " ("
+ savedKeyCacheKeys.size() + " saved keys)");
+        logger.info("Opening " + dataFileName);
         sstable.loadIndexAndCache(savedKeyCacheKeys);
         sstable.loadBloomFilter();
 

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableTracker.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableTracker.java?rev=1040579&r1=1040578&r2=1040579&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableTracker.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/io/SSTableTracker.java
Tue Nov 30 15:26:46 2010
@@ -63,8 +63,8 @@ public class SSTableTracker implements I
         public void saveCache(JMXInstrumentedCache<K, V> cache, File savedCachePath,
Function<K, byte[]> converter) throws IOException
         {
             long start = System.currentTimeMillis();
-            String msgSuffix = " " + savedCachePath.getName() + " for " + cfname + " of "
+ ksname;
-            logger.debug("saving" + msgSuffix);
+            String msgSuffix = savedCachePath.getName() + " for " + cfname + " of " + ksname;
+            logger.info("saving " + msgSuffix);
             int count = 0;
             File tmpFile = File.createTempFile(savedCachePath.getName(), null, savedCachePath.getParentFile());
             FileOutputStream fout = new FileOutputStream(tmpFile);
@@ -83,7 +83,7 @@ public class SSTableTracker implements I
             if (!tmpFile.renameTo(savedCachePath))
                 throw new IOException("Unable to rename cache to " + savedCachePath);
             if (logger.isDebugEnabled())
-                logger.debug("saved " + count + " keys in " + (System.currentTimeMillis()
- start) + " ms from" + msgSuffix);
+                logger.debug("saved " + count + " keys in " + (System.currentTimeMillis()
- start) + " ms from " + msgSuffix);
         }
     }
 



Mime
View raw message