cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1040538 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/Descriptor.java
Date Tue, 30 Nov 2010 14:28:57 GMT
Author: jbellis
Date: Tue Nov 30 14:28:56 2010
New Revision: 1040538

URL: http://svn.apache.org/viewvc?rev=1040538&view=rev
Log:
clean up Descriptor.toString so it looks less like a bug
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/Descriptor.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/Descriptor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/Descriptor.java?rev=1040538&r1=1040537&r2=1040538&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/Descriptor.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/Descriptor.java
Tue Nov 30 14:28:56 2010
@@ -83,11 +83,7 @@ public class Descriptor
         return filenameFor(component.name());
     }
     
-    /**
-     * @param suffix A component suffix, such as 'Data.db'/'Index.db'/etc
-     * @return A filename for this descriptor with the given suffix.
-     */
-    public String filenameFor(String suffix)
+    private String baseFilename()
     {
         StringBuilder buff = new StringBuilder();
         buff.append(directory).append(File.separatorChar);
@@ -96,12 +92,20 @@ public class Descriptor
             buff.append(SSTable.TEMPFILE_MARKER).append("-");
         if (!LEGACY_VERSION.equals(version))
             buff.append(version).append("-");
-        buff.append(generation).append("-");
-        buff.append(suffix);
+        buff.append(generation);
         return buff.toString();
     }
 
     /**
+     * @param suffix A component suffix, such as 'Data.db'/'Index.db'/etc
+     * @return A filename for this descriptor with the given suffix.
+     */
+    public String filenameFor(String suffix)
+    {
+        return baseFilename() + "-" + suffix;
+    }
+
+    /**
      * @see #fromFilename(File directory, String name)
      */
     public static Descriptor fromFilename(String filename)
@@ -177,7 +181,7 @@ public class Descriptor
     @Override
     public String toString()
     {
-        return this.filenameFor("<>");
+        return baseFilename();
     }
 
     @Override



Mime
View raw message