cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r918088 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/io/SSTable.java
Date Tue, 02 Mar 2010 15:58:09 GMT
Author: jbellis
Date: Tue Mar  2 15:58:08 2010
New Revision: 918088

URL: http://svn.apache.org/viewvc?rev=918088&view=rev
Log:
precompute Descriptor hashcode since it's used a lot in key cache.  patch by jbellis

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/io/SSTable.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/io/SSTable.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/io/SSTable.java?rev=918088&r1=918087&r2=918088&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/io/SSTable.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/io/SSTable.java Tue Mar  2 15:58:08
2010
@@ -253,6 +253,7 @@
         public final String cfname;
         public final int generation;
         public final boolean temporary;
+        private final int hashCode;
 
         /**
          * A descriptor that assumes CURRENT_VERSION.
@@ -271,6 +272,7 @@
             this.cfname = cfname;
             this.generation = generation;
             temporary = temp;
+            hashCode = Objects.hashCode(directory, generation, ksname, cfname);
         }
 
         /**
@@ -293,7 +295,7 @@
 
         /**
          * Filename of the form "<ksname>/<cfname>-[tmp-][<version>-]<gen>-*"
-         * @param name A full SSTable filename, including the directory.
+         * @param filename A full SSTable filename, including the directory.
          * @return A SSTable.Descriptor for the filename. 
          */
         public static Descriptor fromFilename(String filename)
@@ -367,7 +369,7 @@
         @Override
         public int hashCode()
         {
-            return Objects.hashCode(directory, generation, ksname, cfname);
+            return hashCode;
         }
     }
 }



Mime
View raw message