cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1195802 - in /cassandra/trunk: src/java/org/apache/cassandra/db/index/ src/java/org/apache/cassandra/db/index/keys/ test/unit/org/apache/cassandra/db/
Date Tue, 01 Nov 2011 03:50:23 GMT
Author: jbellis
Date: Tue Nov  1 03:50:23 2011
New Revision: 1195802

URL: http://svn.apache.org/viewvc?rev=1195802&view=rev
Log:
renaming

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java Tue
Nov  1 03:50:23 2011
@@ -56,7 +56,6 @@ public abstract class PerColumnSecondary
      */
     public abstract void updateColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey,
IColumn col) throws IOException;
     
-    @Override
     public String getNameForSystemTable(ByteBuffer column)
     {
         return getIndexName();   

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java Tue Nov  1
03:50:23 2011
@@ -115,7 +115,7 @@ public abstract class SecondaryIndex
      * Allow access to the underlying column family store if there is one
      * @return the underlying column family store or null
      */
-    public abstract ColumnFamilyStore getUnderlyingCfs();
+    public abstract ColumnFamilyStore getIndexCfs();
    
     
     /**
@@ -245,12 +245,12 @@ public abstract class SecondaryIndex
         return f;
     }
     
-    public ColumnFamilyStore getBaseCFStore()
+    public ColumnFamilyStore getBaseCfs()
     {
         return baseCfs;
     }
 
-    private void setBaseCfStore(ColumnFamilyStore baseCfs)
+    private void setBaseCfs(ColumnFamilyStore baseCfs)
     {
         this.baseCfs = baseCfs;
     }
@@ -313,7 +313,7 @@ public abstract class SecondaryIndex
         
         index.addColumnDef(cdef);
         index.validateOptions();
-        index.setBaseCfStore(baseCfs);
+        index.setBaseCfs(baseCfs);
         
         return index;
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java Tue
Nov  1 03:50:23 2011
@@ -319,7 +319,7 @@ public class SecondaryIndexManager
 
         for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
         {
-            ColumnFamilyStore cfs = entry.getValue().getUnderlyingCfs();
+            ColumnFamilyStore cfs = entry.getValue().getIndexCfs();
             
             if (cfs != null)
                 cfsList.add(cfs);        

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java Tue Nov  1
03:50:23 2011
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
 public class KeysIndex extends PerColumnSecondaryIndex
 {
     private static final Logger logger = LoggerFactory.getLogger(KeysIndex.class);
-    private ColumnFamilyStore indexedCfs;
+    private ColumnFamilyStore indexCfs;
 
     public KeysIndex() 
     {
@@ -57,7 +57,7 @@ public class KeysIndex extends PerColumn
 
         ColumnDefinition columnDef = columnDefs.iterator().next();
         CFMetaData indexedCfMetadata = CFMetaData.newIndexMetadata(baseCfs.metadata, columnDef,
indexComparator());
-        indexedCfs = ColumnFamilyStore.createColumnFamilyStore(baseCfs.table,
+        indexCfs = ColumnFamilyStore.createColumnFamilyStore(baseCfs.table,
                                                              indexedCfMetadata.cfName,
                                                              new LocalPartitioner(columnDef.getValidator()),
                                                              indexedCfMetadata);
@@ -71,24 +71,22 @@ public class KeysIndex extends PerColumn
                : new LocalByPartionerType(StorageService.getPartitioner());
     }
 
-    @Override
     public void deleteColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn column)
     {
         if (column.isMarkedForDelete())
             return;
         
         int localDeletionTime = (int) (System.currentTimeMillis() / 1000);
-        ColumnFamily cfi = ColumnFamily.create(indexedCfs.metadata);
+        ColumnFamily cfi = ColumnFamily.create(indexCfs.metadata);
         cfi.addTombstone(rowKey, localDeletionTime, column.timestamp());
-        indexedCfs.apply(valueKey, cfi);
+        indexCfs.apply(valueKey, cfi);
         if (logger.isDebugEnabled())
             logger.debug("removed index entry for cleaned-up value {}:{}", valueKey, cfi);
     }
 
-    @Override
     public void insertColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn column)
     {
-        ColumnFamily cfi = ColumnFamily.create(indexedCfs.metadata);
+        ColumnFamily cfi = ColumnFamily.create(indexCfs.metadata);
         if (column instanceof ExpiringColumn)
         {
             ExpiringColumn ec = (ExpiringColumn)column;
@@ -99,30 +97,27 @@ public class KeysIndex extends PerColumn
             cfi.addColumn(new Column(rowKey, ByteBufferUtil.EMPTY_BYTE_BUFFER, column.timestamp()));
         }
         if (logger.isDebugEnabled())
-            logger.debug("applying index row {} in {}", indexedCfs.metadata.getKeyValidator().getString(valueKey.key),
cfi);
+            logger.debug("applying index row {} in {}", indexCfs.metadata.getKeyValidator().getString(valueKey.key),
cfi);
         
-        indexedCfs.apply(valueKey, cfi);
+        indexCfs.apply(valueKey, cfi);
     }
     
-    @Override
     public void updateColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn col)
     {        
         insertColumn(valueKey, rowKey, col);        
     }
 
-    @Override
     public void removeIndex(ByteBuffer columnName) throws IOException
     {        
-        indexedCfs.unreferenceSSTables();
-        indexedCfs.invalidate();
+        indexCfs.unreferenceSSTables();
+        indexCfs.invalidate();
     }
 
-    @Override
     public void forceBlockingFlush() throws IOException
     {       
         try
         {
-            indexedCfs.forceBlockingFlush();
+            indexCfs.forceBlockingFlush();
         } 
         catch (ExecutionException e)
         {
@@ -134,37 +129,31 @@ public class KeysIndex extends PerColumn
         }
     }
 
-    @Override
     public void invalidate()
     {
-        indexedCfs.invalidate();
+        indexCfs.invalidate();
     }
 
-    @Override
-    public ColumnFamilyStore getUnderlyingCfs()
+    public ColumnFamilyStore getIndexCfs()
     {
-       return indexedCfs;
+       return indexCfs;
     }
 
-    @Override
     public SecondaryIndexSearcher createSecondaryIndexSearcher(Set<ByteBuffer> columns)
     {
         return new KeysSearcher(baseCfs.indexManager, columns);
     }
 
-    @Override
     public String getIndexName()
     {
-        return indexedCfs.columnFamily;
+        return indexCfs.columnFamily;
     }
 
-    @Override
     public void renameIndex(String newCfName) throws IOException
     {
-        indexedCfs.renameSSTables(indexedCfs.columnFamily.replace(baseCfs.columnFamily, newCfName));
+        indexCfs.renameSSTables(indexCfs.columnFamily.replace(baseCfs.columnFamily, newCfName));
     }
 
-    @Override
     public void validateOptions() throws ConfigurationException
     {
         // no options used

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java Tue Nov
 1 03:50:23 2011
@@ -58,7 +58,7 @@ public class KeysSearcher extends Second
             SecondaryIndex index = indexManager.getIndexForColumn(expression.column_name);
             if (index == null || (expression.op != IndexOperator.EQ))
                 continue;
-            int columns = index.getUnderlyingCfs().getMeanColumns();
+            int columns = index.getIndexCfs().getMeanColumns();
             if (columns < bestMeanCount)
             {
                 best = expression;
@@ -149,17 +149,17 @@ public class KeysSearcher extends Second
              * should be pretty close to `start_key`. */
             if (logger.isDebugEnabled())
                 logger.debug(String.format("Scanning index %s starting with %s",
-                                           expressionString(primary), index.getBaseCFStore().metadata.getKeyValidator().getString(startKey)));
+                                           expressionString(primary), index.getBaseCfs().metadata.getKeyValidator().getString(startKey)));
 
             // We shouldn't fetch only 1 row as this provides buggy paging in case the first
row doesn't satisfy all clauses
             int count = Math.max(clause.count, 2);
             QueryFilter indexFilter = QueryFilter.getSliceFilter(indexKey,
-                                                                 new QueryPath(index.getUnderlyingCfs().getColumnFamilyName()),
+                                                                 new QueryPath(index.getIndexCfs().getColumnFamilyName()),
                                                                  startKey,
                                                                  ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                                  false,
                                                                  count);
-            ColumnFamily indexRow = index.getUnderlyingCfs().getColumnFamily(indexFilter);
+            ColumnFamily indexRow = index.getIndexCfs().getColumnFamily(indexFilter);
             logger.debug("fetched {}", indexRow);
             if (indexRow == null)
                 break;

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java Tue Nov 
1 03:50:23 2011
@@ -53,7 +53,6 @@ import static org.apache.cassandra.Util.
 import static org.apache.cassandra.Util.getBytes;
 import static org.junit.Assert.assertNull;
 
-import org.junit.Assert;
 import org.junit.Test;
 
 public class ColumnFamilyStoreTest extends CleanupHelper
@@ -460,7 +459,7 @@ public class ColumnFamilyStoreTest exten
         Future<?> future = cfs.indexManager.addIndexedColumn(cd);
         future.get();
         // we had a bug (CASSANDRA-2244) where index would get created but not flushed --
check for that
-        assert cfs.indexManager.getIndexForColumn(cd.name).getUnderlyingCfs().getSSTables().size()
> 0;
+        assert cfs.indexManager.getIndexForColumn(cd.name).getIndexCfs().getSSTables().size()
> 0;
 
         queryBirthdate(table);
 

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java?rev=1195802&r1=1195801&r2=1195802&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java Tue Nov  1 03:50:23 2011
@@ -656,7 +656,7 @@ public class DefsTest extends CleanupHel
         rm.apply();
         ColumnFamilyStore cfs = Table.open("Keyspace6").getColumnFamilyStore("Indexed1");
         cfs.forceBlockingFlush();
-        ColumnFamilyStore indexedCfs = cfs.indexManager.getIndexForColumn(cfs.indexManager.getIndexedColumns().iterator().next()).getUnderlyingCfs();
+        ColumnFamilyStore indexedCfs = cfs.indexManager.getIndexForColumn(cfs.indexManager.getIndexedColumns().iterator().next()).getIndexCfs();
         Descriptor desc = indexedCfs.getSSTables().iterator().next().descriptor;
 
         // drop the index



Mime
View raw message