You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2009/03/20 20:44:16 UTC

svn commit: r756725 - in /incubator/cassandra/trunk/src/org/apache/cassandra/db: ColumnFamilyStore.java Table.java

Author: alakshman
Date: Fri Mar 20 19:44:16 2009
New Revision: 756725

URL: http://svn.apache.org/viewvc?rev=756725&view=rev
Log:
Removed references to JDK7 specific things.

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java
    incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java?rev=756725&r1=756724&r2=756725&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java Fri Mar 20 19:44:16 2009
@@ -20,7 +20,6 @@
 
 import java.io.*;
 import java.math.BigInteger;
-import java.nio.file.Path;
 import java.util.*;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -31,7 +30,6 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
-
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.io.DataInputBuffer;
@@ -101,6 +99,7 @@
             {
                 String filename = file.getName();
                 String[] tblCfName = getTableAndColumnFamilyName(filename);
+                
                 if (tblCfName[0].equals(table_)
                         && tblCfName[1].equals(columnFamily))
                 {
@@ -133,6 +132,7 @@
                 	file.delete();
                 	continue;
                 }
+                
                 String[] tblCfName = getTableAndColumnFamilyName(filename);
                 if (tblCfName[0].equals(table_)
                         && tblCfName[1].equals(columnFamily_)
@@ -585,8 +585,6 @@
 		return (!columnFamily.isMarkedForDelete()) ? columnFamily : null;
 	}
 
-
-
     private void getColumnFamilyFromCurrentMemtable(String key, String cf, IFilter filter, List<ColumnFamily> columnFamilies)
     {
         /* Get the ColumnFamily from Memtable */
@@ -611,7 +609,6 @@
         return cf;
     }
 
-
     /*
      * This version is used only on start up when we are recovering from logs.
      * Hence no locking is required since we process logs on the main thread. In
@@ -733,7 +730,6 @@
         return pq;
     }
 
-
     /*
      * Stage the compactions , compact similar size files.
      * This fn figures out the files close enough by size and if they
@@ -776,9 +772,7 @@
     	}
     	return buckets;
     }
-    
-    
-    
+       
     /*
      * Break the files into buckets and then compact.
      */
@@ -836,6 +830,7 @@
     {
     	doMajorCompactionInternal( 0 );
     }
+    
     /*
      * Compact all the files irrespective of the size.
      * skip : is the ammount in Gb of the files to be skipped
@@ -894,7 +889,6 @@
     	return expectedFileSize;
     }
 
-
     /*
      *  Find the maximum size file in the list .
      */
@@ -914,7 +908,6 @@
     	return maxFile;
     }
 
-
     Range getMaxRange( List<Range> ranges )
     {
     	Range maxRange = new Range( BigInteger.ZERO, BigInteger.ZERO );
@@ -1526,31 +1519,4 @@
                 + totalBytesWritten + "   Total keys read ..." + totalkeysRead);
         return;
     }
-    
-    /*
-     * Take a snap shot of this columnfamily store.
-     */
-    public  void snapshot( String snapshotDirectory ) throws IOException
-    {
-    	File snapshotDir = new File(snapshotDirectory);
-    	if( !snapshotDir.exists() )
-    		snapshotDir.mkdir();
-        lock_.writeLock().lock();
-        List<String> files = new ArrayList<String>(ssTables_);
-        try
-        {
-            for (String file : files)
-            {
-            	File f = new File(file);
-            	Path existingLink = f.toPath();
-            	File hardLinkFile = new File(snapshotDirectory + System.getProperty("file.separator") + f.getName());
-            	Path hardLink = hardLinkFile.toPath();
-            	hardLink.createLink(existingLink);
-            }
-        }
-        finally
-        {
-            lock_.writeLock().unlock();
-        }
-    }
 }

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java?rev=756725&r1=756724&r2=756725&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java Fri Mar 20 19:44:16 2009
@@ -28,7 +28,6 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
-
 import org.apache.cassandra.analytics.DBAnalyticsSource;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.continuations.Suspendable;
@@ -53,7 +52,6 @@
 import org.apache.cassandra.utils.FileUtils;
 import org.apache.cassandra.utils.LogUtil;
 import org.apache.log4j.Logger;
-
 import org.apache.cassandra.io.*;
 import org.apache.cassandra.utils.*;
 import org.apache.cassandra.service.*;
@@ -518,7 +516,7 @@
             ColumnFamilyStore cfStore = columnFamilyStores_.get( columnFamily );
             if ( cfStore != null )
                 cfStore.onStart();
-        }        
+        }         
     }
     
     /** 
@@ -555,36 +553,6 @@
             }
         }
     }
-    
-    /*
-     * Take a snapshot of the entire set of column families.
-    */
-    public void snapshot( String clientSuppliedName ) throws IOException
-    {
-    	String snapshotDirectory = DatabaseDescriptor.getSnapshotDirectory();
-    	File snapshotDir = new File(snapshotDirectory);
-    	if( !snapshotDir.exists() )
-    		snapshotDir.mkdir();
-
-    	String currentSnapshotDir = null;
-    	if( clientSuppliedName != null && !clientSuppliedName.equals("") )
-    		currentSnapshotDir = snapshotDirectory + System.getProperty("file.separator") + System.currentTimeMillis() + "-" + clientSuppliedName; 
-    	else
-    		currentSnapshotDir = snapshotDirectory + System.getProperty("file.separator") + System.currentTimeMillis();
-
-    	/* First take a snapshot of the commit logs */
-    	CommitLog.open(table_).snapshot( currentSnapshotDir );
-    	/* force roll over the commit log */
-    	CommitLog.open(table_).setForcedRollOver();
-    	/* Now take a snapshot of all columnfamily stores */
-        Set<String> columnFamilies = tableMetadata_.getColumnFamilies();
-        for ( String columnFamily : columnFamilies )
-        {
-            ColumnFamilyStore cfStore = columnFamilyStores_.get( columnFamily );
-            if ( cfStore != null )
-                cfStore.snapshot( currentSnapshotDir );
-        }
-    }
 
     /*
      * Clear the existing snapshots in the system
@@ -939,11 +907,7 @@
     	            else if(column.timestamp() == 4)
     	            {
     	            	cfStore.forceCleanup();
-    	            }
-    	            else if(column.timestamp() == 5)
-    	            {
-    	            	cfStore.snapshot( new String(column.value()) );
-    	            }
+    	            }    	            
     	            else
     	            {
     	            	cfStore.applyBinary(key, column.value());