cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [11/11] git commit: Rename Table to Keyspace
Date Thu, 27 Jun 2013 18:36:47 GMT
Rename Table to Keyspace

patch by Jeremiah Jordan; reviewed by Aleksey Yeschenko for
CASSANDRA-5613


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0e96e585
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0e96e585
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0e96e585

Branch: refs/heads/trunk
Commit: 0e96e585837c277073779a5f004fbb1e245964af
Parents: e22de43
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Thu Jun 27 21:35:18 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Jun 27 21:35:18 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../org/apache/cassandra/auth/DataResource.java |   2 +-
 .../apache/cassandra/cache/AutoSavingCache.java |   8 +-
 .../org/apache/cassandra/cli/CliClient.java     |  18 +-
 .../org/apache/cassandra/cli/CliCompiler.java   |   4 +-
 .../org/apache/cassandra/config/CFMetaData.java |  52 +-
 .../cassandra/config/ColumnDefinition.java      |  12 +-
 .../cassandra/config/DatabaseDescriptor.java    |  20 +-
 .../org/apache/cassandra/config/KSMetaData.java |  20 +-
 .../org/apache/cassandra/config/Schema.java     | 138 ++--
 .../apache/cassandra/config/TriggerOptions.java |   8 +-
 .../apache/cassandra/cql/QueryProcessor.java    |   4 +-
 .../apache/cassandra/cql3/QueryProcessor.java   |   2 +-
 .../cassandra/cql3/functions/Function.java      |   2 +-
 .../cql3/statements/AlterKeyspaceStatement.java |   4 +-
 .../cql3/statements/AlterTableStatement.java    |   1 -
 .../cql3/statements/BatchStatement.java         |   2 +-
 .../statements/CreateColumnFamilyStatement.java |   2 +-
 .../cql3/statements/SelectStatement.java        |   6 +-
 .../apache/cassandra/db/BatchlogManager.java    |  14 +-
 .../cassandra/db/CollationController.java       |   4 +-
 .../apache/cassandra/db/ColumnFamilyStore.java  |  92 +--
 .../apache/cassandra/db/ConsistencyLevel.java   |  64 +-
 .../apache/cassandra/db/CounterMutation.java    |  22 +-
 .../org/apache/cassandra/db/DataTracker.java    |   4 +-
 .../db/DefinitionsUpdateVerbHandler.java        |   2 +-
 src/java/org/apache/cassandra/db/DefsTable.java | 470 -----------
 .../org/apache/cassandra/db/DefsTables.java     | 470 +++++++++++
 .../org/apache/cassandra/db/Directories.java    |  16 +-
 .../cassandra/db/HintedHandOffManager.java      |  24 +-
 src/java/org/apache/cassandra/db/IMutation.java |   2 +-
 src/java/org/apache/cassandra/db/Keyspace.java  | 454 +++++++++++
 src/java/org/apache/cassandra/db/Memtable.java  |   2 +-
 .../db/MigrationRequestVerbHandler.java         |   2 +-
 .../apache/cassandra/db/PagedRangeCommand.java  |   2 +-
 .../apache/cassandra/db/RangeSliceCommand.java  |   3 +-
 .../org/apache/cassandra/db/ReadCommand.java    |  24 +-
 .../org/apache/cassandra/db/ReadResponse.java   |   4 +-
 .../apache/cassandra/db/ReadVerbHandler.java    |   4 +-
 .../db/RetriedSliceFromReadCommand.java         |   6 +-
 .../org/apache/cassandra/db/RowMutation.java    |  50 +-
 .../cassandra/db/SliceByNamesReadCommand.java   |  26 +-
 .../cassandra/db/SliceFromReadCommand.java      |  26 +-
 .../org/apache/cassandra/db/SystemKeyspace.java | 814 +++++++++++++++++++
 .../org/apache/cassandra/db/SystemTable.java    | 814 -------------------
 src/java/org/apache/cassandra/db/Table.java     | 455 -----------
 .../cassandra/db/TruncateVerbHandler.java       |   2 +-
 .../db/columniterator/SSTableSliceIterator.java |   2 +-
 .../db/commitlog/CommitLogAllocator.java        |  10 +-
 .../db/commitlog/CommitLogReplayer.java         |  26 +-
 .../db/compaction/CompactionController.java     |   4 +-
 .../db/compaction/CompactionManager.java        |  28 +-
 .../cassandra/db/compaction/CompactionTask.java |   4 +-
 .../db/compaction/LegacyLeveledManifest.java    |   2 +-
 .../db/compaction/LeveledManifest.java          |   4 +-
 .../SizeTieredCompactionStrategy.java           |   8 +-
 .../AbstractSimplePerColumnSecondaryIndex.java  |   4 +-
 .../db/index/PerColumnSecondaryIndex.java       |   2 +-
 .../db/index/PerRowSecondaryIndex.java          |   2 +-
 .../cassandra/db/index/SecondaryIndex.java      |  14 +-
 .../db/index/SecondaryIndexBuilder.java         |   4 +-
 .../db/index/SecondaryIndexManager.java         |   2 +-
 .../dht/AbstractByteOrderedPartitioner.java     |   2 +-
 .../org/apache/cassandra/dht/BootStrapper.java  |   8 +-
 .../dht/OrderPreservingPartitioner.java         |   2 +-
 .../org/apache/cassandra/dht/RangeStreamer.java |  18 +-
 .../hadoop/ColumnFamilyRecordReader.java        |   2 +-
 .../cassandra/io/compress/SnappyCompressor.java |   2 +-
 .../apache/cassandra/io/sstable/SSTable.java    |   2 +-
 .../cassandra/io/sstable/SSTableReader.java     |   4 +-
 .../cassandra/io/sstable/SSTableWriter.java     |   2 +-
 .../org/apache/cassandra/io/util/FileUtils.java |   4 +-
 .../locator/AbstractReplicationStrategy.java    |  42 +-
 .../locator/GossipingPropertyFileSnitch.java    |   6 +-
 .../apache/cassandra/locator/LocalStrategy.java |   4 +-
 .../locator/NetworkTopologyStrategy.java        |   4 +-
 .../locator/OldNetworkTopologyStrategy.java     |   4 +-
 .../cassandra/locator/SimpleStrategy.java       |   4 +-
 .../apache/cassandra/locator/TokenMetadata.java |  26 +-
 .../cassandra/metrics/ColumnFamilyMetrics.java  |   6 +-
 .../cassandra/metrics/CompactionMetrics.java    |   6 +-
 .../cassandra/metrics/HintedHandoffMetrics.java |   4 +-
 .../org/apache/cassandra/repair/RepairJob.java  |   4 +-
 .../repair/RepairMessageVerbHandler.java        |   4 +-
 .../cassandra/repair/StreamingRepairTask.java   |   1 -
 .../cassandra/service/AbstractReadExecutor.java |  14 +-
 .../cassandra/service/AbstractRowResolver.java  |   6 +-
 .../service/AbstractWriteResponseHandler.java   |  12 +-
 .../cassandra/service/ActiveRepairService.java  |   8 +-
 .../cassandra/service/CassandraDaemon.java      |  44 +-
 .../apache/cassandra/service/ClientState.java   |  16 +-
 .../DatacenterSyncWriteResponseHandler.java     |   8 +-
 .../service/DatacenterWriteResponseHandler.java |   6 +-
 .../cassandra/service/MigrationManager.java     |   8 +-
 .../apache/cassandra/service/MigrationTask.java |   4 +-
 .../service/RangeSliceResponseResolver.java     |   8 +-
 .../apache/cassandra/service/ReadCallback.java  |  16 +-
 .../cassandra/service/RowDataResolver.java      |  10 +-
 .../cassandra/service/RowDigestResolver.java    |   4 +-
 .../ScheduledRangeTransferExecutorService.java  |   6 +-
 .../cassandra/service/SnapshotVerbHandler.java  |   6 +-
 .../apache/cassandra/service/StorageProxy.java  | 114 +--
 .../cassandra/service/StorageService.java       | 436 +++++-----
 .../cassandra/service/StorageServiceMBean.java  |  48 +-
 .../cassandra/service/WriteResponseHandler.java |   6 +-
 .../service/pager/NamesQueryPager.java          |   2 +-
 .../service/pager/SliceQueryPager.java          |   4 +-
 .../cassandra/service/paxos/PaxosState.java     |  18 +-
 .../cassandra/streaming/StreamReader.java       |   4 +-
 .../cassandra/streaming/StreamReceiveTask.java  |   4 +-
 .../cassandra/streaming/StreamSession.java      |   6 +-
 .../compress/CompressedStreamReader.java        |   4 +-
 .../cassandra/thrift/CassandraServer.java       |  14 +-
 .../cassandra/thrift/ThriftValidation.java      |  26 +-
 .../org/apache/cassandra/tools/BulkLoader.java  |   8 +-
 .../org/apache/cassandra/tools/NodeCmd.java     |  62 +-
 .../org/apache/cassandra/tools/NodeProbe.java   |  56 +-
 .../apache/cassandra/tools/SSTableExport.java   |  10 +-
 .../apache/cassandra/tools/SSTableImport.java   |   4 +-
 .../cassandra/tools/StandaloneScrubber.java     |  20 +-
 .../cassandra/tools/StandaloneUpgrader.java     |   6 +-
 .../org/apache/cassandra/tracing/Tracing.java   |   2 +-
 .../cassandra/utils/BloomCalculations.java      |   2 +-
 .../org/apache/cassandra/utils/CounterId.java   |  12 +-
 .../apache/cassandra/utils/StatusLogger.java    |   2 +-
 .../org/apache/cassandra/utils/obs/BitUtil.java |   2 +-
 .../apache/cassandra/db/LongKeyspaceTest.java   |  71 ++
 .../org/apache/cassandra/db/LongTableTest.java  |  71 --
 .../apache/cassandra/db/MeteredFlusherTest.java |   4 +-
 .../db/compaction/LongCompactionsTest.java      |  14 +-
 .../LongLeveledCompactionStrategyTest.java      |   6 +-
 .../unit/org/apache/cassandra/SchemaLoader.java |   4 +-
 test/unit/org/apache/cassandra/Util.java        |  10 +-
 .../cassandra/cache/CacheProviderTest.java      |   4 +-
 .../apache/cassandra/config/CFMetaDataTest.java |  16 +-
 .../config/DatabaseDescriptorTest.java          |  12 +-
 .../org/apache/cassandra/config/DefsTest.java   |  26 +-
 .../org/apache/cassandra/db/CleanupTest.java    |  14 +-
 .../cassandra/db/CollationControllerTest.java   |   4 +-
 .../cassandra/db/ColumnFamilyStoreTest.java     | 168 ++--
 .../apache/cassandra/db/CounterColumnTest.java  |   2 +-
 .../cassandra/db/CounterMutationTest.java       |   8 +-
 .../apache/cassandra/db/HintedHandOffTest.java  |  10 +-
 .../org/apache/cassandra/db/KeyCacheTest.java   |  16 +-
 .../apache/cassandra/db/KeyCollisionTest.java   |   6 +-
 .../org/apache/cassandra/db/KeyspaceTest.java   | 649 +++++++++++++++
 .../org/apache/cassandra/db/MultitableTest.java |  14 +-
 .../org/apache/cassandra/db/NameSortTest.java   |  14 +-
 .../apache/cassandra/db/RangeTombstoneTest.java |   8 +-
 .../apache/cassandra/db/ReadMessageTest.java    |   4 +-
 .../cassandra/db/RecoveryManager2Test.java      |   6 +-
 .../cassandra/db/RecoveryManager3Test.java      |  14 +-
 .../cassandra/db/RecoveryManagerTest.java       |  20 +-
 .../db/RecoveryManagerTruncateTest.java         |  12 +-
 .../cassandra/db/RemoveColumnFamilyTest.java    |   4 +-
 .../db/RemoveColumnFamilyWithFlush1Test.java    |   4 +-
 .../db/RemoveColumnFamilyWithFlush2Test.java    |   4 +-
 .../apache/cassandra/db/RemoveColumnTest.java   |   4 +-
 .../cassandra/db/RemoveSubColumnTest.java       |   8 +-
 .../org/apache/cassandra/db/RowCacheTest.java   |   6 +-
 .../apache/cassandra/db/RowIterationTest.java   |  22 +-
 .../apache/cassandra/db/SerializationsTest.java |   4 +-
 .../apache/cassandra/db/SystemKeyspaceTest.java |  80 ++
 .../apache/cassandra/db/SystemTableTest.java    |  81 --
 .../unit/org/apache/cassandra/db/TableTest.java | 653 ---------------
 .../org/apache/cassandra/db/TimeSortTest.java   |  26 +-
 .../compaction/BlacklistingCompactionsTest.java |   6 +-
 .../db/compaction/CompactionsPurgeTest.java     |  72 +-
 .../db/compaction/CompactionsTest.java          |  56 +-
 .../LeveledCompactionStrategyTest.java          |  16 +-
 .../db/compaction/OneCompactionTest.java        |   6 +-
 .../cassandra/db/compaction/TTLExpiryTest.java  |   7 +-
 .../cassandra/db/marshal/CompositeTypeTest.java |   4 +-
 .../db/marshal/DynamicCompositeTypeTest.java    |   4 +-
 .../apache/cassandra/dht/BootStrapperTest.java  |  14 +-
 .../cassandra/io/LazilyCompactedRowTest.java    |  24 +-
 .../io/sstable/SSTableMetadataTest.java         |  18 +-
 .../cassandra/io/sstable/SSTableReaderTest.java |  32 +-
 .../io/sstable/SSTableSimpleWriterTest.java     |   8 +-
 .../cassandra/io/sstable/SSTableUtils.java      |  24 +-
 .../locator/NetworkTopologyStrategyTest.java    |   8 +-
 .../ReplicationStrategyEndpointCacheTest.java   |  18 +-
 .../cassandra/locator/SimpleStrategyTest.java   |  24 +-
 .../apache/cassandra/repair/ValidatorTest.java  |   4 +-
 .../service/AntiEntropyServiceCounterTest.java  |   4 +-
 .../service/AntiEntropyServiceStandardTest.java |   4 +-
 .../service/AntiEntropyServiceTestAbstract.java |  40 +-
 .../service/LeaveAndBootstrapTest.java          |  74 +-
 .../org/apache/cassandra/service/MoveTest.java  |  50 +-
 .../cassandra/service/QueryPagerTest.java       |   2 +-
 .../apache/cassandra/service/RelocateTest.java  |  16 +-
 .../cassandra/service/RowResolverTest.java      |   2 +-
 .../service/StorageServiceServerTest.java       |  24 +-
 .../streaming/StreamingTransferTest.java        |  30 +-
 .../cassandra/utils/EncodedStreamsTest.java     |   6 +-
 195 files changed, 4095 insertions(+), 4108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 59c9dab..af824bc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -66,6 +66,7 @@
  * Redesign repair messages (CASSANDRA-5426)
  * Fix ALTER RENAME post-5125 (CASSANDRA-5702)
  * Disallow renaming a 2ndary indexed column (CASSANDRA-5705)
+ * Rename Table to Keyspace (CASSANDRA-5613)
 
 
 1.2.7

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/auth/DataResource.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/auth/DataResource.java b/src/java/org/apache/cassandra/auth/DataResource.java
index 3ee40a7..9c6fd31 100644
--- a/src/java/org/apache/cassandra/auth/DataResource.java
+++ b/src/java/org/apache/cassandra/auth/DataResource.java
@@ -202,7 +202,7 @@ public class DataResource implements IResource
             case ROOT:
                 return true;
             case KEYSPACE:
-                return Schema.instance.getTables().contains(keyspace);
+                return Schema.instance.getKeyspaces().contains(keyspace);
             case COLUMN_FAMILY:
                 return Schema.instance.getCFMetaData(keyspace, columnFamily) != null;
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cache/AutoSavingCache.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cache/AutoSavingCache.java b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
index bcb1b7f..61ac3a5 100644
--- a/src/java/org/apache/cassandra/cache/AutoSavingCache.java
+++ b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
@@ -31,12 +31,12 @@ import org.slf4j.LoggerFactory;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.ColumnFamilyType;
-import org.apache.cassandra.db.Table;
 import org.apache.cassandra.db.compaction.CompactionInfo;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.compaction.OperationType;
 import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.io.FSWriteError;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.io.util.LengthAvailableInputStream;
@@ -105,7 +105,7 @@ public class AutoSavingCache<K extends CacheKey, V> extends InstrumentingCache<K
         long start = System.nanoTime();
 
         // old cache format that only saves keys
-        File path = getCachePath(cfs.table.getName(), cfs.name, null);
+        File path = getCachePath(cfs.keyspace.getName(), cfs.name, null);
         if (path.exists())
         {
             DataInputStream in = null;
@@ -133,7 +133,7 @@ public class AutoSavingCache<K extends CacheKey, V> extends InstrumentingCache<K
         }
 
         // modern format, allows both key and value (so key cache load can be purely sequential)
-        path = getCachePath(cfs.table.getName(), cfs.name, CURRENT_VERSION);
+        path = getCachePath(cfs.keyspace.getName(), cfs.name, CURRENT_VERSION);
         if (path.exists())
         {
             DataInputStream in = null;
@@ -199,7 +199,7 @@ public class AutoSavingCache<K extends CacheKey, V> extends InstrumentingCache<K
             else
                 type = OperationType.UNKNOWN;
 
-            info = new CompactionInfo(new CFMetaData(Table.SYSTEM_KS, cacheType.toString(), ColumnFamilyType.Standard, BytesType.instance, null),
+            info = new CompactionInfo(new CFMetaData(Keyspace.SYSTEM_KS, cacheType.toString(), ColumnFamilyType.Standard, BytesType.instance, null),
                                       type,
                                       0,
                                       keys.size(),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cli/CliClient.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliClient.java b/src/java/org/apache/cassandra/cli/CliClient.java
index 7d5212f..066c1cc 100644
--- a/src/java/org/apache/cassandra/cli/CliClient.java
+++ b/src/java/org/apache/cassandra/cli/CliClient.java
@@ -502,7 +502,7 @@ public class CliClient
             assert columnTree != null;
             assert subColumnTree != null;
 
-            // table.cf['key']['column']['column']
+            // keyspace.cf['key']['column']['column']
             superColumnName = (columnTree.getType() == CliParser.FUNCTION_CALL)
                                       ? convertValueByFunction(columnTree, null, null).array()
                                       : columnNameAsByteArray(CliCompiler.getColumn(columnFamilySpec, 0), cfDef);
@@ -679,13 +679,13 @@ public class CliClient
             }
         }
 
-        // table.cf['key'] -- row slice
+        // keyspace.cf['key'] -- row slice
         if (columnSpecCnt == 0)
         {
             doSlice(keySpace, key, columnFamily, superColumnName, limit);
             return;
         }
-        // table.cf['key']['column'] -- slice of a super, or get of a standard
+        // keyspace.cf['key']['column'] -- slice of a super, or get of a standard
         else if (columnSpecCnt == 1)
         {
             columnName = getColumnName(columnFamily, columnFamilySpec.getChild(2));
@@ -697,7 +697,7 @@ public class CliClient
                 return;
             }
         }
-        // table.cf['key']['column']['column'] -- get of a sub-column
+        // keyspace.cf['key']['column']['column'] -- get of a sub-column
         else if (columnSpecCnt == 2)
         {
             superColumnName = getColumnName(columnFamily, columnFamilySpec.getChild(2)).array();
@@ -916,13 +916,13 @@ public class CliClient
         byte[] superColumnName = null;
         ByteBuffer columnName;
 
-        // table.cf['key']
+        // keyspace.cf['key']
         if (columnSpecCnt == 0)
         {
             sessionState.err.println("No cell name specified, (type 'help;' or '?' for help on syntax).");
             return;
         }
-        // table.cf['key']['column'] = 'value'
+        // keyspace.cf['key']['column'] = 'value'
         else if (columnSpecCnt == 1)
         {
             // get the column name
@@ -933,7 +933,7 @@ public class CliClient
             }
             columnName = getColumnName(columnFamily, columnFamilySpec.getChild(2));
         }
-        // table.cf['key']['super_column']['column'] = 'value'
+        // keyspace.cf['key']['super_column']['column'] = 'value'
         else
         {
             assert (columnSpecCnt == 2) : "serious parsing error (this is a bug).";
@@ -1001,12 +1001,12 @@ public class CliClient
         byte[] superColumnName = null;
         ByteBuffer columnName;
 
-        // table.cf['key']['column'] -- incr standard
+        // keyspace.cf['key']['column'] -- incr standard
         if (columnSpecCnt == 1)
         {
             columnName = getColumnName(columnFamily, columnFamilySpec.getChild(2));
         }
-        // table.cf['key']['column']['column'] -- incr super
+        // keyspace.cf['key']['column']['column'] -- incr super
         else if (columnSpecCnt == 2)
         {
             superColumnName = getColumnName(columnFamily, columnFamilySpec.getChild(2)).array();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cli/CliCompiler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliCompiler.java b/src/java/org/apache/cassandra/cli/CliCompiler.java
index ad12821..6b84be1 100644
--- a/src/java/org/apache/cassandra/cli/CliCompiler.java
+++ b/src/java/org/apache/cassandra/cli/CliCompiler.java
@@ -158,14 +158,14 @@ public class CliCompiler
 
     public static int numColumnSpecifiers(Tree astNode)
     {
-        // Skip over table, column family and rowKey
+        // Skip over keyspace, column family and rowKey
         return astNode.getChildCount() - 2;
     }
 
     // Returns the pos'th (0-based index) column specifier in the astNode
     public static String getColumn(Tree astNode, int pos)
     {
-        // Skip over table, column family and rowKey
+        // Skip over keyspace, column family and rowKey
         return CliUtils.unescapeSQLString(astNode.getChild(pos + 2).getText());
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index 6594d75..38692b8 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -90,27 +90,27 @@ public final class CFMetaData
     // Note that this is the default only for user created tables
     public final static String DEFAULT_COMPRESSOR = LZ4Compressor.class.getCanonicalName();
 
-    public static final CFMetaData IndexCf = compile(5, "CREATE TABLE \"" + SystemTable.INDEX_CF + "\" ("
+    public static final CFMetaData IndexCf = compile(5, "CREATE TABLE \"" + SystemKeyspace.INDEX_CF + "\" ("
                                                         + "table_name text,"
                                                         + "index_name text,"
                                                         + "PRIMARY KEY (table_name, index_name)"
                                                         + ") WITH COMPACT STORAGE AND COMMENT='indexes that have been completed'");
 
-    public static final CFMetaData CounterIdCf = compile(6, "CREATE TABLE \"" + SystemTable.COUNTER_ID_CF + "\" ("
+    public static final CFMetaData CounterIdCf = compile(6, "CREATE TABLE \"" + SystemKeyspace.COUNTER_ID_CF + "\" ("
                                                             + "key text,"
                                                             + "id timeuuid,"
                                                             + "PRIMARY KEY (key, id)"
                                                             + ") WITH COMPACT STORAGE AND COMMENT='counter node IDs'");
 
     // new-style schema
-    public static final CFMetaData SchemaKeyspacesCf = compile(8, "CREATE TABLE " + SystemTable.SCHEMA_KEYSPACES_CF + "("
+    public static final CFMetaData SchemaKeyspacesCf = compile(8, "CREATE TABLE " + SystemKeyspace.SCHEMA_KEYSPACES_CF + "("
                                                                   + "keyspace_name text PRIMARY KEY,"
                                                                   + "durable_writes boolean,"
                                                                   + "strategy_class text,"
                                                                   + "strategy_options text"
                                                                   + ") WITH COMPACT STORAGE AND COMMENT='keyspace definitions' AND gc_grace_seconds=8640");
 
-    public static final CFMetaData SchemaColumnFamiliesCf = compile(9, "CREATE TABLE " + SystemTable.SCHEMA_COLUMNFAMILIES_CF + "("
+    public static final CFMetaData SchemaColumnFamiliesCf = compile(9, "CREATE TABLE " + SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF + "("
                                                                        + "keyspace_name text,"
                                                                        + "columnfamily_name text,"
                                                                        + "type text,"
@@ -145,7 +145,7 @@ public final class CFMetaData
                                                                        + "PRIMARY KEY (keyspace_name, columnfamily_name)"
                                                                        + ") WITH COMMENT='ColumnFamily definitions' AND gc_grace_seconds=8640");
 
-    public static final CFMetaData SchemaColumnsCf = compile(10, "CREATE TABLE " + SystemTable.SCHEMA_COLUMNS_CF + "("
+    public static final CFMetaData SchemaColumnsCf = compile(10, "CREATE TABLE " + SystemKeyspace.SCHEMA_COLUMNS_CF + "("
                                                                  + "keyspace_name text,"
                                                                  + "columnfamily_name text,"
                                                                  + "column_name text,"
@@ -158,7 +158,7 @@ public final class CFMetaData
                                                                  + "PRIMARY KEY(keyspace_name, columnfamily_name, column_name)"
                                                                  + ") WITH COMMENT='ColumnFamily column attributes' AND gc_grace_seconds=8640");
 
-    public static final CFMetaData SchemaTriggerCf = compile("CREATE TABLE \"" + SystemTable.SCHEMA_TRIGGERS_CF + "\" ("
+    public static final CFMetaData SchemaTriggerCf = compile("CREATE TABLE \"" + SystemKeyspace.SCHEMA_TRIGGERS_CF + "\" ("
                                                                 + "keyspace_name text,"
                                                                 + "column_family text,"
                                                                 + "trigger_name text,"
@@ -166,7 +166,7 @@ public final class CFMetaData
                                                                 + "PRIMARY KEY (keyspace_name, column_family, trigger_name)"
                                                                 + ") WITH COMMENT='triggers metadata table'");
 
-    public static final CFMetaData HintsCf = compile("CREATE TABLE " + SystemTable.HINTS_CF + " ("
+    public static final CFMetaData HintsCf = compile("CREATE TABLE " + SystemKeyspace.HINTS_CF + " ("
                                                      + "target_id uuid,"
                                                      + "hint_id timeuuid,"
                                                      + "message_version int,"
@@ -177,7 +177,7 @@ public final class CFMetaData
                                                      + "AND COMMENT='hints awaiting delivery'"
                                                      + "AND gc_grace_seconds=0");
 
-    public static final CFMetaData PeersCf = compile("CREATE TABLE " + SystemTable.PEERS_CF + " ("
+    public static final CFMetaData PeersCf = compile("CREATE TABLE " + SystemKeyspace.PEERS_CF + " ("
                                                      + "peer inet PRIMARY KEY,"
                                                      + "host_id uuid,"
                                                      + "tokens set<varchar>,"
@@ -188,12 +188,12 @@ public final class CFMetaData
                                                      + "rack text"
                                                      + ") WITH COMMENT='known peers in the cluster'");
 
-    public static final CFMetaData PeerEventsCf = compile("CREATE TABLE " + SystemTable.PEER_EVENTS_CF + " ("
+    public static final CFMetaData PeerEventsCf = compile("CREATE TABLE " + SystemKeyspace.PEER_EVENTS_CF + " ("
                                                           + "peer inet PRIMARY KEY,"
                                                           + "hints_dropped map<uuid, int>"
                                                           + ") WITH COMMENT='cf contains events related to peers'");
 
-    public static final CFMetaData LocalCf = compile("CREATE TABLE " + SystemTable.LOCAL_CF + " ("
+    public static final CFMetaData LocalCf = compile("CREATE TABLE " + SystemKeyspace.LOCAL_CF + " ("
                                                      + "key text PRIMARY KEY,"
                                                      + "tokens set<varchar>,"
                                                      + "cluster_name text,"
@@ -231,26 +231,26 @@ public final class CFMetaData
                                                            + ")",
                                                            Tracing.TRACE_KS);
 
-    public static final CFMetaData BatchlogCf = compile("CREATE TABLE " + SystemTable.BATCHLOG_CF + " ("
+    public static final CFMetaData BatchlogCf = compile("CREATE TABLE " + SystemKeyspace.BATCHLOG_CF + " ("
                                                         + "id uuid PRIMARY KEY,"
                                                         + "written_at timestamp,"
                                                         + "data blob"
                                                         + ") WITH COMMENT='uncommited batches' AND gc_grace_seconds=0 "
                                                         + "AND COMPACTION={'class' : 'SizeTieredCompactionStrategy', 'min_threshold' : 2}");
 
-    public static final CFMetaData RangeXfersCf = compile("CREATE TABLE " + SystemTable.RANGE_XFERS_CF + " ("
+    public static final CFMetaData RangeXfersCf = compile("CREATE TABLE " + SystemKeyspace.RANGE_XFERS_CF + " ("
                                                           + "token_bytes blob PRIMARY KEY,"
                                                           + "requested_at timestamp"
                                                           + ") WITH COMMENT='ranges requested for transfer here'");
 
-    public static final CFMetaData CompactionLogCf = compile("CREATE TABLE " + SystemTable.COMPACTION_LOG + " ("
+    public static final CFMetaData CompactionLogCf = compile("CREATE TABLE " + SystemKeyspace.COMPACTION_LOG + " ("
                                                              + "id uuid PRIMARY KEY,"
                                                              + "keyspace_name text,"
                                                              + "columnfamily_name text,"
                                                              + "inputs set<int>"
                                                              + ") WITH COMMENT='unfinished compactions'");
 
-    public static final CFMetaData PaxosCf = compile("CREATE TABLE " + SystemTable.PAXOS_CF + " ("
+    public static final CFMetaData PaxosCf = compile("CREATE TABLE " + SystemKeyspace.PAXOS_CF + " ("
                                                      + "row_key blob,"
                                                      + "cf_id UUID,"
                                                      + "in_progress_ballot timeuuid,"
@@ -472,12 +472,12 @@ public final class CFMetaData
 
     private static CFMetaData compile(String cql)
     {
-        return compile(null, cql, Table.SYSTEM_KS);
+        return compile(null, cql, Keyspace.SYSTEM_KS);
     }
 
     private static CFMetaData compile(int id, String cql)
     {
-        return compile(id, cql, Table.SYSTEM_KS);
+        return compile(id, cql, Keyspace.SYSTEM_KS);
     }
 
     private static AbstractType<?> makeComparator(ColumnFamilyType cftype, AbstractType<?> comp, AbstractType<?> subcc)
@@ -948,10 +948,10 @@ public final class CFMetaData
 
     public void reload()
     {
-        Row cfDefRow = SystemTable.readSchemaRow(ksName, cfName);
+        Row cfDefRow = SystemKeyspace.readSchemaRow(ksName, cfName);
 
         if (cfDefRow.cf == null || cfDefRow.cf.getColumnCount() == 0)
-            throw new RuntimeException(String.format("%s not found in the schema definitions table.", ksName + ":" + cfName));
+            throw new RuntimeException(String.format("%s not found in the schema definitions keyspace.", ksName + ":" + cfName));
 
         try
         {
@@ -1425,7 +1425,7 @@ public final class CFMetaData
      */
     public RowMutation toSchemaUpdate(CFMetaData newState, long modificationTimestamp, boolean fromThrift)
     {
-        RowMutation rm = new RowMutation(Table.SYSTEM_KS, SystemTable.getSchemaKSKey(ksName));
+        RowMutation rm = new RowMutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName));
 
         newState.toSchemaNoColumns(rm, modificationTimestamp);
 
@@ -1471,15 +1471,15 @@ public final class CFMetaData
      */
     public RowMutation dropFromSchema(long timestamp)
     {
-        RowMutation rm = new RowMutation(Table.SYSTEM_KS, SystemTable.getSchemaKSKey(ksName));
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_COLUMNFAMILIES_CF);
+        RowMutation rm = new RowMutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName));
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF);
         int ldt = (int) (System.currentTimeMillis() / 1000);
 
         ColumnNameBuilder builder = SchemaColumnFamiliesCf.getCfDef().getColumnNameBuilder();
         builder.add(ByteBufferUtil.bytes(cfName));
         cf.addAtom(new RangeTombstone(builder.build(), builder.buildAsEndOfRange(), timestamp, ldt));
 
-        ColumnFamily tcf = rm.addOrGet(SystemTable.SCHEMA_TRIGGERS_CF);
+        ColumnFamily tcf = rm.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_CF);
         ColumnNameBuilder tbuilder = SchemaTriggerCf.getCfDef().getColumnNameBuilder();
         tbuilder.add(ByteBufferUtil.bytes(cfName));
         tcf.addAtom(new RangeTombstone(tbuilder.build(), tbuilder.buildAsEndOfRange(), timestamp, ldt));
@@ -1502,7 +1502,7 @@ public final class CFMetaData
     {
         // For property that can be null (and can be changed), we insert tombstones, to make sure
         // we don't keep a property the user has removed
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_COLUMNFAMILIES_CF);
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF);
         int ldt = (int) (System.currentTimeMillis() / 1000);
 
         cf.addColumn(Column.create("", timestamp, cfName, ""));
@@ -1711,7 +1711,7 @@ public final class CFMetaData
      */
     public RowMutation toSchema(long timestamp) throws ConfigurationException
     {
-        RowMutation rm = new RowMutation(Table.SYSTEM_KS, SystemTable.getSchemaKSKey(ksName));
+        RowMutation rm = new RowMutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName));
         toSchema(rm, timestamp);
         return rm;
     }
@@ -1788,10 +1788,10 @@ public final class CFMetaData
     {
         ColumnDefinition def = column_metadata.get(from);
         if (def == null)
-            throw new InvalidRequestException(String.format("Cannot rename unknown column %s in table %s", strFrom, cfName));
+            throw new InvalidRequestException(String.format("Cannot rename unknown column %s in keyspace %s", strFrom, cfName));
 
         if (column_metadata.get(to) != null)
-            throw new InvalidRequestException(String.format("Cannot rename column %s to %s in table %s; another column of that name already exist", strFrom, strTo, cfName));
+            throw new InvalidRequestException(String.format("Cannot rename column %s to %s in keyspace %s; another column of that name already exist", strFrom, strTo, cfName));
 
         if (def.type == ColumnDefinition.Type.REGULAR)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/config/ColumnDefinition.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/ColumnDefinition.java b/src/java/org/apache/cassandra/config/ColumnDefinition.java
index d63e2ce..00a784f 100644
--- a/src/java/org/apache/cassandra/config/ColumnDefinition.java
+++ b/src/java/org/apache/cassandra/config/ColumnDefinition.java
@@ -197,7 +197,7 @@ public class ColumnDefinition
      */
     public void deleteFromSchema(RowMutation rm, String cfName, AbstractType<?> comparator, long timestamp)
     {
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_COLUMNS_CF);
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_COLUMNS_CF);
         int ldt = (int) (System.currentTimeMillis() / 1000);
 
         ColumnNameBuilder builder = CFMetaData.SchemaColumnsCf.getCfDef().getColumnNameBuilder();
@@ -207,7 +207,7 @@ public class ColumnDefinition
 
     public void toSchema(RowMutation rm, String cfName, AbstractType<?> comparator, long timestamp)
     {
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_COLUMNS_CF);
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_COLUMNS_CF);
         int ldt = (int) (System.currentTimeMillis() / 1000);
 
         cf.addColumn(Column.create("", timestamp, cfName, comparator.getString(name), ""));
@@ -300,11 +300,11 @@ public class ColumnDefinition
 
     public static Row readSchema(String ksName, String cfName)
     {
-        DecoratedKey key = StorageService.getPartitioner().decorateKey(SystemTable.getSchemaKSKey(ksName));
-        ColumnFamilyStore columnsStore = SystemTable.schemaCFS(SystemTable.SCHEMA_COLUMNS_CF);
+        DecoratedKey key = StorageService.getPartitioner().decorateKey(SystemKeyspace.getSchemaKSKey(ksName));
+        ColumnFamilyStore columnsStore = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_COLUMNS_CF);
         ColumnFamily cf = columnsStore.getColumnFamily(key,
-                                                       DefsTable.searchComposite(cfName, true),
-                                                       DefsTable.searchComposite(cfName, false),
+                                                       DefsTables.searchComposite(cfName, true),
+                                                       DefsTables.searchComposite(cfName, false),
                                                        false,
                                                        Integer.MAX_VALUE,
                                                        System.currentTimeMillis());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index a015774..b59fbf8 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -34,8 +34,8 @@ import org.apache.cassandra.config.Config.RequestSchedulerId;
 import org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions;
 import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions;
 import org.apache.cassandra.db.ColumnFamilyStore;
-import org.apache.cassandra.db.DefsTable;
-import org.apache.cassandra.db.SystemTable;
+import org.apache.cassandra.db.DefsTables;
+import org.apache.cassandra.db.SystemKeyspace;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.io.FSWriteError;
@@ -437,7 +437,7 @@ public class DatabaseDescriptor
             conf.server_encryption_options = conf.encryption_options;
         }
 
-        // Hardcoded system tables
+        // Hardcoded system keyspaces
         List<KSMetaData> systemKeyspaces = Arrays.asList(KSMetaData.systemKeyspace(), KSMetaData.traceKeyspace());
         assert systemKeyspaces.size() == Schema.systemKeyspaceNames.size();
         for (KSMetaData ksmd : systemKeyspaces)
@@ -445,7 +445,7 @@ public class DatabaseDescriptor
             // install the definition
             for (CFMetaData cfm : ksmd.cfMetaData().values())
                 Schema.instance.load(cfm);
-            Schema.instance.setTableDefinition(ksmd);
+            Schema.instance.setKeyspaceDefinition(ksmd);
         }
 
         /* Load the seeds for node contact points */
@@ -477,24 +477,24 @@ public class DatabaseDescriptor
         return conf.dynamic_snitch ? new DynamicEndpointSnitch(snitch) : snitch;
     }
 
-    /** load keyspace (table) definitions, but do not initialize the table instances. */
+    /** load keyspace (keyspace) definitions, but do not initialize the keyspace instances. */
     public static void loadSchemas()
     {
-        ColumnFamilyStore schemaCFS = SystemTable.schemaCFS(SystemTable.SCHEMA_KEYSPACES_CF);
+        ColumnFamilyStore schemaCFS = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_KEYSPACES_CF);
 
-        // if table with definitions is empty try loading the old way
+        // if keyspace with definitions is empty try loading the old way
         if (schemaCFS.estimateKeys() == 0)
         {
             logger.info("Couldn't detect any schema definitions in local storage.");
             // peek around the data directories to see if anything is there.
             if (hasExistingNoSystemTables())
-                logger.info("Found table data in data directories. Consider using cqlsh to define your schema.");
+                logger.info("Found keyspace data in data directories. Consider using cqlsh to define your schema.");
             else
-                logger.info("To create keyspaces and column families, see 'help create table' in cqlsh.");
+                logger.info("To create keyspaces and column families, see 'help create keyspace' in cqlsh.");
         }
         else
         {
-            Schema.instance.load(DefsTable.loadFromTable());
+            Schema.instance.load(DefsTables.loadFromKeyspace());
         }
 
         Schema.instance.updateVersion();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/config/KSMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/KSMetaData.java b/src/java/org/apache/cassandra/config/KSMetaData.java
index 1988a9f..798a688 100644
--- a/src/java/org/apache/cassandra/config/KSMetaData.java
+++ b/src/java/org/apache/cassandra/config/KSMetaData.java
@@ -91,7 +91,7 @@ public final class KSMetaData
                                                 CFMetaData.SchemaColumnsCf,
                                                 CFMetaData.CompactionLogCf,
                                                 CFMetaData.PaxosCf);
-        return new KSMetaData(Table.SYSTEM_KS, LocalStrategy.class, Collections.<String, String>emptyMap(), true, cfDefs);
+        return new KSMetaData(Keyspace.SYSTEM_KS, LocalStrategy.class, Collections.<String, String>emptyMap(), true, cfDefs);
     }
 
     public static KSMetaData traceKeyspace()
@@ -215,29 +215,29 @@ public final class KSMetaData
 
     public KSMetaData reloadAttributes()
     {
-        Row ksDefRow = SystemTable.readSchemaRow(name);
+        Row ksDefRow = SystemKeyspace.readSchemaRow(name);
 
         if (ksDefRow.cf == null)
-            throw new RuntimeException(String.format("%s not found in the schema definitions table (%s).", name, SystemTable.SCHEMA_KEYSPACES_CF));
+            throw new RuntimeException(String.format("%s not found in the schema definitions keyspaceName (%s).", name, SystemKeyspace.SCHEMA_KEYSPACES_CF));
 
         return fromSchema(ksDefRow, Collections.<CFMetaData>emptyList());
     }
 
     public RowMutation dropFromSchema(long timestamp)
     {
-        RowMutation rm = new RowMutation(Table.SYSTEM_KS, SystemTable.getSchemaKSKey(name));
-        rm.delete(SystemTable.SCHEMA_KEYSPACES_CF, timestamp);
-        rm.delete(SystemTable.SCHEMA_COLUMNFAMILIES_CF, timestamp);
-        rm.delete(SystemTable.SCHEMA_COLUMNS_CF, timestamp);
-        rm.delete(SystemTable.SCHEMA_TRIGGERS_CF, timestamp);
+        RowMutation rm = new RowMutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(name));
+        rm.delete(SystemKeyspace.SCHEMA_KEYSPACES_CF, timestamp);
+        rm.delete(SystemKeyspace.SCHEMA_COLUMNFAMILIES_CF, timestamp);
+        rm.delete(SystemKeyspace.SCHEMA_COLUMNS_CF, timestamp);
+        rm.delete(SystemKeyspace.SCHEMA_TRIGGERS_CF, timestamp);
 
         return rm;
     }
 
     public RowMutation toSchema(long timestamp)
     {
-        RowMutation rm = new RowMutation(Table.SYSTEM_KS, SystemTable.getSchemaKSKey(name));
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_KEYSPACES_CF);
+        RowMutation rm = new RowMutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(name));
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_KEYSPACES_CF);
 
         cf.addColumn(Column.create(durableWrites, timestamp, "durable_writes"));
         cf.addColumn(Column.create(strategyClass.getName(), timestamp, "strategy_class"));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/config/Schema.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Schema.java b/src/java/org/apache/cassandra/config/Schema.java
index ae31269..2a9a731 100644
--- a/src/java/org/apache/cassandra/config/Schema.java
+++ b/src/java/org/apache/cassandra/config/Schema.java
@@ -28,7 +28,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.Table;
+import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.io.sstable.Descriptor;
 import org.apache.cassandra.service.MigrationManager;
@@ -51,11 +51,11 @@ public class Schema
      */
     public static final int NAME_LENGTH = 48;
 
-    /* metadata map for faster table lookup */
-    private final Map<String, KSMetaData> tables = new NonBlockingHashMap<String, KSMetaData>();
+    /* metadata map for faster keyspace lookup */
+    private final Map<String, KSMetaData> keyspaces = new NonBlockingHashMap<String, KSMetaData>();
 
-    /* Table objects, one per keyspace. Only one instance should ever exist for any given keyspace. */
-    private final Map<String, Table> tableInstances = new NonBlockingHashMap<String, Table>();
+    /* Keyspace objects, one per keyspace. Only one instance should ever exist for any given keyspace. */
+    private final Map<String, Keyspace> keyspaceInstances = new NonBlockingHashMap<String, Keyspace>();
 
     /* metadata map for faster ColumnFamily lookup */
     private final BiMap<Pair<String, String>, UUID> cfIdMap = HashBiMap.create();
@@ -64,7 +64,7 @@ public class Schema
 
     // 59adb24e-f3cd-3e02-97f0-5b395827453f
     public static final UUID emptyVersion;
-    public static final ImmutableSet<String> systemKeyspaceNames = ImmutableSet.of(Table.SYSTEM_KS, Tracing.TRACE_KS);
+    public static final ImmutableSet<String> systemKeyspaceNames = ImmutableSet.of(Keyspace.SYSTEM_KS, Tracing.TRACE_KS);
 
     static
     {
@@ -85,15 +85,15 @@ public class Schema
     {}
 
     /**
-     * Load up non-system tables
+     * Load up non-system keyspaces
      *
-     * @param tableDefs The non-system table definitions
+     * @param keyspaceDefs The non-system keyspace definitions
      *
      * @return self to support chaining calls
      */
-    public Schema load(Collection<KSMetaData> tableDefs)
+    public Schema load(Collection<KSMetaData> keyspaceDefs)
     {
-        for (KSMetaData def : tableDefs)
+        for (KSMetaData def : keyspaceDefs)
             load(def);
 
         return this;
@@ -111,74 +111,74 @@ public class Schema
         for (CFMetaData cfm : keyspaceDef.cfMetaData().values())
             load(cfm);
 
-        setTableDefinition(keyspaceDef);
+        setKeyspaceDefinition(keyspaceDef);
 
         return this;
     }
 
     /**
-     * Get table instance by name
+     * Get keyspace instance by name
      *
-     * @param tableName The name of the table
+     * @param keyspaceName The name of the keyspace
      *
-     * @return Table object or null if table was not found
+     * @return Keyspace object or null if keyspace was not found
      */
-    public Table getTableInstance(String tableName)
+    public Keyspace getKeyspaceInstance(String keyspaceName)
     {
-        return tableInstances.get(tableName);
+        return keyspaceInstances.get(keyspaceName);
     }
 
     /**
-     * Store given Table instance to the schema
+     * Store given Keyspace instance to the schema
      *
-     * @param table The Table instance to store
+     * @param keyspace The Keyspace instance to store
      *
-     * @throws IllegalArgumentException if Table is already stored
+     * @throws IllegalArgumentException if Keyspace is already stored
      */
-    public void storeTableInstance(Table table)
+    public void storeKeyspaceInstance(Keyspace keyspace)
     {
-        if (tableInstances.containsKey(table.getName()))
-            throw new IllegalArgumentException(String.format("Table %s was already initialized.", table.getName()));
+        if (keyspaceInstances.containsKey(keyspace.getName()))
+            throw new IllegalArgumentException(String.format("Keyspace %s was already initialized.", keyspace.getName()));
 
-        tableInstances.put(table.getName(), table);
+        keyspaceInstances.put(keyspace.getName(), keyspace);
     }
 
     /**
-     * Remove table from schema
+     * Remove keyspace from schema
      *
-     * @param tableName The name of the table to remove
+     * @param keyspaceName The name of the keyspace to remove
      *
-     * @return removed table instance or null if it wasn't found
+     * @return removed keyspace instance or null if it wasn't found
      */
-    public Table removeTableInstance(String tableName)
+    public Keyspace removeKeyspaceInstance(String keyspaceName)
     {
-        return tableInstances.remove(tableName);
+        return keyspaceInstances.remove(keyspaceName);
     }
 
     /**
-     * Remove table definition from system
+     * Remove keyspace definition from system
      *
-     * @param ksm The table definition to remove
+     * @param ksm The keyspace definition to remove
      */
-    public void clearTableDefinition(KSMetaData ksm)
+    public void clearKeyspaceDefinition(KSMetaData ksm)
     {
-        tables.remove(ksm.name);
+        keyspaces.remove(ksm.name);
     }
 
     /**
-     * Given a table name & column family name, get the column family
-     * meta data. If the table name or column family name is not valid
+     * Given a keyspace name & column family name, get the column family
+     * meta data. If the keyspace name or column family name is not valid
      * this function returns null.
      *
-     * @param tableName The table name
+     * @param keyspaceName The keyspace name
      * @param cfName The ColumnFamily name
      *
      * @return ColumnFamily Metadata object or null if it wasn't found
      */
-    public CFMetaData getCFMetaData(String tableName, String cfName)
+    public CFMetaData getCFMetaData(String keyspaceName, String cfName)
     {
-        assert tableName != null;
-        KSMetaData ksm = tables.get(tableName);
+        assert keyspaceName != null;
+        KSMetaData ksm = keyspaces.get(keyspaceName);
         return (ksm == null) ? null : ksm.cfMetaData().get(cfName);
     }
 
@@ -247,66 +247,66 @@ public class Schema
     }
 
     /**
-     * Get metadata about table by its name
+     * Get metadata about keyspace by its name
      *
-     * @param table The name of the table
+     * @param keyspaceName The name of the keyspace
      *
-     * @return The table metadata or null if it wasn't found
+     * @return The keyspace metadata or null if it wasn't found
      */
-    public KSMetaData getKSMetaData(String table)
+    public KSMetaData getKSMetaData(String keyspaceName)
     {
-        assert table != null;
-        return tables.get(table);
+        assert keyspaceName != null;
+        return keyspaces.get(keyspaceName);
     }
 
     /**
-     * @return collection of the non-system tables
+     * @return collection of the non-system keyspaces
      */
-    public List<String> getNonSystemTables()
+    public List<String> getNonSystemKeyspaces()
     {
-        return ImmutableList.copyOf(Sets.difference(tables.keySet(), systemKeyspaceNames));
+        return ImmutableList.copyOf(Sets.difference(keyspaces.keySet(), systemKeyspaceNames));
     }
 
     /**
-     * Get metadata about table inner ColumnFamilies
+     * Get metadata about keyspace inner ColumnFamilies
      *
-     * @param tableName The name of the table
+     * @param keyspaceName The name of the keyspace
      *
-     * @return metadata about ColumnFamilies the belong to the given table
+     * @return metadata about ColumnFamilies the belong to the given keyspace
      */
-    public Map<String, CFMetaData> getTableMetaData(String tableName)
+    public Map<String, CFMetaData> getKeyspaceMetaData(String keyspaceName)
     {
-        assert tableName != null;
-        KSMetaData ksm = tables.get(tableName);
+        assert keyspaceName != null;
+        KSMetaData ksm = keyspaces.get(keyspaceName);
         assert ksm != null;
         return ksm.cfMetaData();
     }
 
     /**
-     * @return collection of the all table names registered in the system (system and non-system)
+     * @return collection of the all keyspace names registered in the system (system and non-system)
      */
-    public Set<String> getTables()
+    public Set<String> getKeyspaces()
     {
-        return tables.keySet();
+        return keyspaces.keySet();
     }
 
     /**
-     * @return collection of the metadata about all tables registered in the system (system and non-system)
+     * @return collection of the metadata about all keyspaces registered in the system (system and non-system)
      */
-    public Collection<KSMetaData> getTableDefinitions()
+    public Collection<KSMetaData> getKeyspaceDefinitions()
     {
-        return tables.values();
+        return keyspaces.values();
     }
 
     /**
-     * Update (or insert) new table definition
+     * Update (or insert) new keyspace definition
      *
-     * @param ksm The metadata about table
+     * @param ksm The metadata about keyspace
      */
-    public void setTableDefinition(KSMetaData ksm)
+    public void setKeyspaceDefinition(KSMetaData ksm)
     {
         assert ksm != null;
-        tables.put(ksm.name, ksm);
+        keyspaces.put(ksm.name, ksm);
     }
 
     /* ColumnFamily query/control methods */
@@ -371,7 +371,7 @@ public class Schema
     }
 
     /**
-     * Read schema from system table and calculate MD5 digest of every row, resulting digest
+     * Read schema from system keyspace and calculate MD5 digest of every row, resulting digest
      * will be converted into UUID which would act as content-based version of the schema.
      */
     public void updateVersion()
@@ -380,7 +380,7 @@ public class Schema
         {
             MessageDigest versionDigest = MessageDigest.getInstance("MD5");
 
-            for (Row row : SystemTable.serializedSchema())
+            for (Row row : SystemKeyspace.serializedSchema())
             {
                 if (invalidSchemaRow(row) || ignoredSchemaRow(row))
                     continue;
@@ -389,7 +389,7 @@ public class Schema
             }
 
             version = UUID.nameUUIDFromBytes(versionDigest.digest());
-            SystemTable.updateSchemaVersion(version);
+            SystemKeyspace.updateSchemaVersion(version);
         }
         catch (Exception e)
         {
@@ -411,12 +411,12 @@ public class Schema
      */
     public synchronized void clear()
     {
-        for (String table : getNonSystemTables())
+        for (String keyspaceName : getNonSystemKeyspaces())
         {
-            KSMetaData ksm = getKSMetaData(table);
+            KSMetaData ksm = getKSMetaData(keyspaceName);
             for (CFMetaData cfm : ksm.cfMetaData().values())
                 purge(cfm);
-            clearTableDefinition(ksm);
+            clearKeyspaceDefinition(ksm);
         }
 
         updateVersionAndAnnounce();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/config/TriggerOptions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/TriggerOptions.java b/src/java/org/apache/cassandra/config/TriggerOptions.java
index 3ab5f86..3423bf3 100644
--- a/src/java/org/apache/cassandra/config/TriggerOptions.java
+++ b/src/java/org/apache/cassandra/config/TriggerOptions.java
@@ -15,7 +15,7 @@ import org.apache.cassandra.cql3.UntypedResultSet.Row;
 import org.apache.cassandra.db.ColumnFamily;
 import org.apache.cassandra.db.RangeTombstone;
 import org.apache.cassandra.db.RowMutation;
-import org.apache.cassandra.db.SystemTable;
+import org.apache.cassandra.db.SystemKeyspace;
 import org.apache.cassandra.db.marshal.UTF8Type;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -27,7 +27,7 @@ public class TriggerOptions
     public static Map<String, Map<String, String>> getAllTriggers(String ksName, String cfName)
     {
         String req = "SELECT * FROM system.%s WHERE keyspace_name='%s' AND column_family='%s'";
-        UntypedResultSet result = processInternal(String.format(req, SystemTable.SCHEMA_TRIGGERS_CF, ksName, cfName));
+        UntypedResultSet result = processInternal(String.format(req, SystemKeyspace.SCHEMA_TRIGGERS_CF, ksName, cfName));
         Map<String, Map<String, String>> triggers = new HashMap<>();
         if (result.isEmpty())
             return triggers;
@@ -38,7 +38,7 @@ public class TriggerOptions
 
     public static void addColumns(RowMutation rm, String cfName, Entry<String, Map<String, String>> tentry, long modificationTimestamp)
     {
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_TRIGGERS_CF);
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_CF);
         assert tentry.getValue().get(CLASS_KEY) != null;
         ColumnNameBuilder builder = CFMetaData.SchemaTriggerCf.getCfDef().getColumnNameBuilder();
         builder.add(ByteBufferUtil.bytes(cfName)).add(ByteBufferUtil.bytes(tentry.getKey())).add(ByteBufferUtil.bytes(OPTIONS_KEY));
@@ -52,7 +52,7 @@ public class TriggerOptions
 
     public static void deleteColumns(RowMutation rm, String cfName, Entry<String, Map<String, String>> tentry, long modificationTimestamp)
     {
-        ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_TRIGGERS_CF);
+        ColumnFamily cf = rm.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_CF);
         int ldt = (int) (System.currentTimeMillis() / 1000);
         ColumnNameBuilder builder = CFMetaData.SchemaTriggerCf.getCfDef().getColumnNameBuilder();
         builder.add(ByteBufferUtil.bytes(cfName)).add(ByteBufferUtil.bytes(tentry.getKey()));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/QueryProcessor.java b/src/java/org/apache/cassandra/cql/QueryProcessor.java
index ea179b4..9e437b1 100644
--- a/src/java/org/apache/cassandra/cql/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql/QueryProcessor.java
@@ -241,7 +241,7 @@ public class QueryProcessor
         if (select.getColumnRelations().size() > 0)
         {
             AbstractType<?> comparator = select.getComparator(keyspace);
-            SecondaryIndexManager idxManager = Table.open(keyspace).getColumnFamilyStore(select.getColumnFamily()).indexManager;
+            SecondaryIndexManager idxManager = Keyspace.open(keyspace).getColumnFamilyStore(select.getColumnFamily()).indexManager;
             for (Relation relation : select.getColumnRelations())
             {
                 ByteBuffer name = relation.getEntity().getByteBuffer(comparator, variables);
@@ -361,7 +361,7 @@ public class QueryProcessor
                 if (select.isSetKeyspace())
                 {
                     keyspace = CliUtils.unescapeSQLString(select.getKeyspace());
-                    ThriftValidation.validateTable(keyspace);
+                    ThriftValidation.validateKeyspace(keyspace);
                 }
                 else if (oldKeyspace == null)
                     throw new InvalidRequestException("no keyspace has been specified");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/QueryProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index 1de985b..b2da29d 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -160,7 +160,7 @@ public class QueryProcessor
         {
             ClientState state = new ClientState(true);
             QueryState qState = new QueryState(state);
-            state.setKeyspace(Table.SYSTEM_KS);
+            state.setKeyspace(Keyspace.SYSTEM_KS);
             CQLStatement statement = getStatement(query, state).statement;
             statement.validate(state);
             ResultMessage result = statement.executeInternal(qState);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/functions/Function.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/Function.java b/src/java/org/apache/cassandra/cql3/functions/Function.java
index 7adc7ca..ba5ae20 100644
--- a/src/java/org/apache/cassandra/cql3/functions/Function.java
+++ b/src/java/org/apache/cassandra/cql3/functions/Function.java
@@ -36,7 +36,7 @@ public interface Function
 
     public interface Factory
     {
-        // We allow the function to be parametered by the table it is part of because the
+        // We allow the function to be parametered by the keyspace it is part of because the
         // "token" function needs it (the argument depends on the keyValidator). However,
         // for most function, the factory will just always the same function object (see
         // AbstractFunction).

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java
index 48b2f99..2fc0ce6 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterKeyspaceStatement.java
@@ -22,7 +22,7 @@ import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.KSMetaData;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.cql3.KSPropDefs;
-import org.apache.cassandra.db.Table;
+import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.exceptions.*;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.ClientState;
@@ -61,7 +61,7 @@ public class AlterKeyspaceStatement extends SchemaAlteringStatement
         KSMetaData ksm = Schema.instance.getKSMetaData(name);
         if (ksm == null)
             throw new InvalidRequestException("Unknown keyspace " + name);
-        if (ksm.name.equalsIgnoreCase(Table.SYSTEM_KS))
+        if (ksm.name.equalsIgnoreCase(Keyspace.SYSTEM_KS))
             throw new InvalidRequestException("Cannot alter system keyspace");
 
         attrs.validate();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
index 80835a6..945d202 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.config.CFMetaData;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index 6fbab72..dd15270 100644
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@ -119,7 +119,7 @@ public class BatchStatement implements CQLStatement
         // Group mutation together, otherwise they won't get applied atomically
         for (IMutation m : statement.getMutations(variables, local, cl, attrs.getTimestamp(now, variables), true))
         {
-            Pair<String, ByteBuffer> key = Pair.create(m.getTable(), m.key());
+            Pair<String, ByteBuffer> key = Pair.create(m.getKeyspaceName(), m.key());
             IMutation existing = mutations.get(key);
 
             if (existing == null)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
index d5855be..996f221 100644
--- a/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
@@ -300,7 +300,7 @@ public class CreateColumnFamilyStatement extends SchemaAlteringStatement
                     stmt.defaultValidator = BytesType.instance;
                     // We need to distinguish between
                     //   * I'm upgrading from thrift so the valueAlias is null
-                    //   * I've define my table with only a PK (and the column value will be empty)
+                    //   * I've defined my table with only a PK (and the column value will be empty)
                     // So, we use an empty valueAlias (rather than null) for the second case
                     stmt.valueAlias = ByteBufferUtil.EMPTY_BYTE_BUFFER;
                 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index f481879..b323a33 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -214,12 +214,12 @@ public class SelectStatement implements CQLStatement
         return new ResultMessage.Rows(rset);
     }
 
-    static List<Row> readLocally(String keyspace, List<ReadCommand> cmds)
+    static List<Row> readLocally(String keyspaceName, List<ReadCommand> cmds)
     {
-        Table table = Table.open(keyspace);
+        Keyspace keyspace = Keyspace.open(keyspaceName);
         List<Row> rows = new ArrayList<Row>(cmds.size());
         for (ReadCommand cmd : cmds)
-            rows.add(cmd.getRow(table));
+            rows.add(cmd.getRow(keyspace));
         return rows;
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/db/BatchlogManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/BatchlogManager.java b/src/java/org/apache/cassandra/db/BatchlogManager.java
index 2e1b1a7..558a498 100644
--- a/src/java/org/apache/cassandra/db/BatchlogManager.java
+++ b/src/java/org/apache/cassandra/db/BatchlogManager.java
@@ -94,7 +94,7 @@ public class BatchlogManager implements BatchlogManagerMBean
 
     public int countAllBatches()
     {
-        return (int) process("SELECT count(*) FROM %s.%s", Table.SYSTEM_KS, SystemTable.BATCHLOG_CF).one().getLong("count");
+        return (int) process("SELECT count(*) FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.BATCHLOG_CF).one().getLong("count");
     }
 
     public long getTotalBatchesReplayed()
@@ -125,7 +125,7 @@ public class BatchlogManager implements BatchlogManagerMBean
         cf.addColumn(new Column(columnName("data"), data, timestamp));
         cf.addColumn(new Column(columnName("written_at"), writtenAt, timestamp));
 
-        return new RowMutation(Table.SYSTEM_KS, UUIDType.instance.decompose(uuid), cf);
+        return new RowMutation(Keyspace.SYSTEM_KS, UUIDType.instance.decompose(uuid), cf);
     }
 
     private static ByteBuffer serializeRowMutations(Collection<RowMutation> mutations)
@@ -156,7 +156,7 @@ public class BatchlogManager implements BatchlogManagerMBean
 
         try
         {
-            for (UntypedResultSet.Row row : process("SELECT id, written_at FROM %s.%s", Table.SYSTEM_KS, SystemTable.BATCHLOG_CF))
+            for (UntypedResultSet.Row row : process("SELECT id, written_at FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.BATCHLOG_CF))
                 if (System.currentTimeMillis() > row.getLong("written_at") + TIMEOUT)
                     replayBatch(row.getUUID("id"));
             cleanup();
@@ -173,7 +173,7 @@ public class BatchlogManager implements BatchlogManagerMBean
     {
         logger.debug("Replaying batch {}", id);
 
-        UntypedResultSet result = process("SELECT written_at, data FROM %s.%s WHERE id = %s", Table.SYSTEM_KS, SystemTable.BATCHLOG_CF, id);
+        UntypedResultSet result = process("SELECT written_at, data FROM %s.%s WHERE id = %s", Keyspace.SYSTEM_KS, SystemKeyspace.BATCHLOG_CF, id);
         if (result.isEmpty())
             return;
 
@@ -187,7 +187,7 @@ public class BatchlogManager implements BatchlogManagerMBean
             logger.warn("Skipped batch replay of {} due to {}", id, e);
         }
 
-        process("DELETE FROM %s.%s WHERE id = %s", Table.SYSTEM_KS, SystemTable.BATCHLOG_CF, id);
+        process("DELETE FROM %s.%s WHERE id = %s", Keyspace.SYSTEM_KS, SystemKeyspace.BATCHLOG_CF, id);
 
         totalBatchesReplayed.incrementAndGet();
     }
@@ -211,7 +211,7 @@ public class BatchlogManager implements BatchlogManagerMBean
             return; // the mutation isn't safe to replay.
 
         Set<InetAddress> liveEndpoints = new HashSet<InetAddress>();
-        String ks = mutation.getTable();
+        String ks = mutation.getKeyspaceName();
         Token<?> tk = StorageService.getPartitioner().getToken(mutation.key());
         for (InetAddress endpoint : Iterables.concat(StorageService.instance.getNaturalEndpoints(ks, tk),
                                                      StorageService.instance.getTokenMetadata().pendingEndpointsFor(tk, ks)))
@@ -283,7 +283,7 @@ public class BatchlogManager implements BatchlogManagerMBean
     // force flush + compaction to reclaim space from the replayed batches
     private void cleanup() throws ExecutionException, InterruptedException
     {
-        ColumnFamilyStore cfs = Table.open(Table.SYSTEM_KS).getColumnFamilyStore(SystemTable.BATCHLOG_CF);
+        ColumnFamilyStore cfs = Keyspace.open(Keyspace.SYSTEM_KS).getColumnFamilyStore(SystemKeyspace.BATCHLOG_CF);
         cfs.forceBlockingFlush();
         Collection<Descriptor> descriptors = new ArrayList<Descriptor>();
         for (SSTableReader sstr : cfs.getSSTables())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e96e585/src/java/org/apache/cassandra/db/CollationController.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/CollationController.java b/src/java/org/apache/cassandra/db/CollationController.java
index d0d22c5..4ae27a2 100644
--- a/src/java/org/apache/cassandra/db/CollationController.java
+++ b/src/java/org/apache/cassandra/db/CollationController.java
@@ -170,9 +170,9 @@ public class CollationController
                 && cfs.getCompactionStrategy() instanceof SizeTieredCompactionStrategy)
             {
                 Tracing.trace("Defragmenting requested data");
-                RowMutation rm = new RowMutation(cfs.table.getName(), filter.key.key, returnCF.cloneMe());
+                RowMutation rm = new RowMutation(cfs.keyspace.getName(), filter.key.key, returnCF.cloneMe());
                 // skipping commitlog and index updates is fine since we're just de-fragmenting existing data
-                Table.open(rm.getTable()).apply(rm, false, false);
+                Keyspace.open(rm.getKeyspaceName()).apply(rm, false, false);
             }
 
             // Caller is responsible for final removeDeletedCF.  This is important for cacheRow to work correctly:


Mime
View raw message