cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r793051 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Date Fri, 10 Jul 2009 17:48:45 GMT
Author: jbellis
Date: Fri Jul 10 17:48:45 2009
New Revision: 793051

URL: http://svn.apache.org/viewvc?rev=793051&view=rev
Log:
rename lock_ -> sstableLock_.
patch by jbellis; reviewed by Jun Rao for CASSANDRA-287

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

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=793051&r1=793050&r2=793051&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Fri
Jul 10 17:48:45 2009
@@ -84,7 +84,7 @@
     private SortedMap<String, SSTableReader> ssTables_ = new TreeMap<String, SSTableReader>(new
FileNameComparator(FileNameComparator.Descending));
 
     /* Modification lock used for protecting reads from compactions. */
-    private ReentrantReadWriteLock lock_ = new ReentrantReadWriteLock(true);
+    private ReentrantReadWriteLock sstableLock_ = new ReentrantReadWriteLock(true);
 
     private TimedStatsDeque readStats_ = new TimedStatsDeque(60000);
     private TimedStatsDeque diskReadStats_ = new TimedStatsDeque(60000);
@@ -251,14 +251,14 @@
     */
     void addToList(SSTableReader file)
     {
-        lock_.writeLock().lock();
+        sstableLock_.writeLock().lock();
         try
         {
             ssTables_.put(file.getFilename(), file);
         }
         finally
         {
-            lock_.writeLock().unlock();
+            sstableLock_.writeLock().unlock();
         }
     }
 
@@ -554,7 +554,7 @@
      */
     private void getColumnFamilyFromDisk(String key, String cf, List<ColumnFamily>
columnFamilies, IFilter filter) throws IOException
     {
-        lock_.readLock().lock();
+        sstableLock_.readLock().lock();
         try
         {
             for (SSTableReader sstable : ssTables_.values())
@@ -577,7 +577,7 @@
         }
         finally
         {
-            lock_.readLock().unlock();
+            sstableLock_.readLock().unlock();
         }
     }
 
@@ -731,7 +731,7 @@
     void storeLocation(SSTableReader sstable)
     {
         int ssTableCount;
-        lock_.writeLock().lock();
+        sstableLock_.writeLock().lock();
         try
         {
             ssTables_.put(sstable.getFilename(), sstable);
@@ -739,7 +739,7 @@
         }
         finally
         {
-            lock_.writeLock().unlock();
+            sstableLock_.writeLock().unlock();
         }
 
         /* it's ok if compaction gets submitted multiple times while one is already in process.
@@ -984,7 +984,7 @@
         doFileAntiCompaction(files, myRanges, null, newFiles);
         if (logger_.isDebugEnabled())
           logger_.debug("Original file : " + file + " of size " + new File(file).length());
-        lock_.writeLock().lock();
+        sstableLock_.writeLock().lock();
         try
         {
             ssTables_.remove(file);
@@ -999,7 +999,7 @@
         }
         finally
         {
-            lock_.writeLock().unlock();
+            sstableLock_.writeLock().unlock();
         }
     }
 
@@ -1358,7 +1358,7 @@
             ssTable = writer.closeAndOpenReader(DatabaseDescriptor.getKeysCachedFraction(table_));
             newfile = writer.getFilename();
         }
-        lock_.writeLock().lock();
+        sstableLock_.writeLock().lock();
         try
         {
             for (String file : files)
@@ -1377,7 +1377,7 @@
         }
         finally
         {
-            lock_.writeLock().unlock();
+            sstableLock_.writeLock().unlock();
         }
 
         String format = "Compacted to %s.  %d/%d bytes for %d/%d keys read/written.  Time:
%dms.";
@@ -1514,7 +1514,7 @@
 
     public ReentrantReadWriteLock.ReadLock getReadLock()
     {
-        return lock_.readLock();
+        return sstableLock_.readLock();
     }
 
     public int getReadCount()
@@ -1558,7 +1558,7 @@
     public ColumnFamily getSliceFrom(String key, String cfName, String startColumn, String
finishColumn, boolean isAscending, int offset, int count)
     throws IOException, ExecutionException, InterruptedException
     {
-        lock_.readLock().lock();
+        sstableLock_.readLock().lock();
         List<ColumnIterator> iterators = new ArrayList<ColumnIterator>();
         try
         {
@@ -1670,7 +1670,7 @@
                 }
             }
 
-            lock_.readLock().unlock();
+            sstableLock_.readLock().unlock();
         }
     }
 
@@ -1679,14 +1679,14 @@
      */
     void clearUnsafe()
     {
-        lock_.writeLock().lock();
+        sstableLock_.writeLock().lock();
         try
         {
             memtable_.clearUnsafe();
         }
         finally
         {
-            lock_.writeLock().unlock();
+            sstableLock_.writeLock().unlock();
         }
     }
 }



Mime
View raw message