cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1198842 - in /cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db: ColumnFamilyStore.java index/SecondaryIndex.java index/SecondaryIndexManager.java index/keys/KeysIndex.java
Date Mon, 07 Nov 2011 17:56:49 GMT
Author: jbellis
Date: Mon Nov  7 17:56:48 2011
New Revision: 1198842

URL: http://svn.apache.org/viewvc?rev=1198842&view=rev
Log:
r/m unused renameSSTables code
patch by Marcus Eriksson; reviewed by jbellis for CASSANDRA-3464

Modified:
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1198842&r1=1198841&r2=1198842&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Mon Nov  7 17:56:48 2011
@@ -1633,30 +1633,6 @@ public class ColumnFamilyStore implement
         return CompactionManager.instance.submitTruncate(this, truncatedAt);
     }
 
-    // if this errors out, we are in a world of hurt.
-    public void renameSSTables(String newCfName) throws IOException
-    {
-        // complete as much of the job as possible.  Don't let errors long the way prevent
as much renaming as possible
-        // from happening.
-        IOException mostRecentProblem = null;
-        for (File existing : DefsTable.getFiles(table.name, columnFamily))
-        {
-            try
-            {
-                String newFileName = existing.getName().replaceFirst("\\w+-", newCfName +
"-");
-                FileUtils.renameWithConfirm(existing, new File(existing.getParent(), newFileName));
-            }
-            catch (IOException ex)
-            {
-                mostRecentProblem = ex;
-            }
-        }
-        if (mostRecentProblem != null)
-            throw new IOException("One or more IOExceptions encountered while renaming files.
Most recent problem is included.", mostRecentProblem);
-
-        indexManager.renameIndexes(newCfName);
-    }
-
     public long getBloomFilterFalsePositives()
     {
         return data.getBloomFilterFalsePositives();

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndex.java?rev=1198842&r1=1198841&r2=1198842&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
Mon Nov  7 17:56:48 2011
@@ -123,14 +123,7 @@ public abstract class SecondaryIndex
      * @param columnName the indexed column to remove
      */
     public abstract void removeIndex(ByteBuffer columnName) throws IOException;
-    
-    /**
-     * Renames the underlying index files to reflect the new CF name
-     * @param newCfName new column family name.
-     * @throws IOException on any I/O error.
-     */
-    public abstract void renameIndex(String newCfName) throws IOException;
-    
+
     /**
      * Remove the index and unregisters this index's mbean if one exists
      */

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java?rev=1198842&r1=1198841&r2=1198842&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
Mon Nov  7 17:56:48 2011
@@ -246,17 +246,7 @@ public class SecondaryIndexManager
         for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
             entry.getValue().invalidate();
     }
-        
-    /**
-     * Rename all underlying index files
-     * @param newCfName the new index Name
-     */
-    public void renameIndexes(String newCfName) throws IOException
-    {
-        for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
-            entry.getValue().renameIndex(newCfName);
-    }
-    
+
     /**
      * Flush all indexes to disk
      * @throws ExecutionException

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java?rev=1198842&r1=1198841&r2=1198842&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
Mon Nov  7 17:56:48 2011
@@ -148,11 +148,6 @@ public class KeysIndex extends PerColumn
         return indexCfs.columnFamily;
     }
 
-    public void renameIndex(String newCfName) throws IOException
-    {
-        indexCfs.renameSSTables(indexCfs.columnFamily.replace(baseCfs.columnFamily, newCfName));
-    }
-
     public void validateOptions() throws ConfigurationException
     {
         // no options used



Mime
View raw message