cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/3] git commit: keep reference to KSMetaData in Table
Date Thu, 29 Nov 2012 13:01:45 GMT
keep reference to KSMetaData in Table


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

Branch: refs/heads/trunk
Commit: e4d5d3393767efa2777122254ff2b8c7d7f8ceab
Parents: 9e14e19
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Nov 29 21:41:57 2012 +0900
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Nov 29 22:01:30 2012 +0900

----------------------------------------------------------------------
 .../apache/cassandra/cache/AutoSavingCache.java    |    4 +-
 src/java/org/apache/cassandra/config/Schema.java   |    6 ++--
 .../apache/cassandra/db/CollationController.java   |    3 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   28 +++++++-------
 src/java/org/apache/cassandra/db/DataTracker.java  |    4 +-
 src/java/org/apache/cassandra/db/Memtable.java     |    2 +-
 src/java/org/apache/cassandra/db/RowMutation.java  |    4 +-
 src/java/org/apache/cassandra/db/Table.java        |   26 ++++++++------
 .../db/compaction/CompactionController.java        |    4 +-
 .../cassandra/db/compaction/CompactionManager.java |   10 +++---
 .../cassandra/db/compaction/LeveledManifest.java   |    2 +-
 .../apache/cassandra/db/index/SecondaryIndex.java  |    8 ++--
 .../cassandra/metrics/ColumnFamilyMetrics.java     |    2 +-
 .../apache/cassandra/service/StorageService.java   |    2 +-
 .../org/apache/cassandra/streaming/StreamOut.java  |    2 +-
 .../org/apache/cassandra/utils/StatusLogger.java   |    2 +-
 .../apache/cassandra/db/MeteredFlusherTest.java    |    2 +-
 .../apache/cassandra/db/ColumnFamilyStoreTest.java |   12 +++---
 .../cassandra/streaming/SerializationsTest.java    |    2 +-
 .../cassandra/streaming/StreamingTransferTest.java |   10 +++---
 20 files changed, 69 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/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 ece95d0..4e35d34 100644
--- a/src/java/org/apache/cassandra/cache/AutoSavingCache.java
+++ b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
@@ -102,7 +102,7 @@ public class AutoSavingCache<K extends CacheKey, V> extends InstrumentingCache<K
         long start = System.currentTimeMillis();
 
         // old cache format that only saves keys
-        File path = getCachePath(cfs.table.name, cfs.name, null);
+        File path = getCachePath(cfs.table.getName(), cfs.name, null);
         if (path.exists())
         {
             DataInputStream in = null;
@@ -130,7 +130,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.name, cfs.name, CURRENT_VERSION);
+        path = getCachePath(cfs.table.getName(), cfs.name, CURRENT_VERSION);
         if (path.exists())
         {
             DataInputStream in = null;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/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 041b29a..f0491de 100644
--- a/src/java/org/apache/cassandra/config/Schema.java
+++ b/src/java/org/apache/cassandra/config/Schema.java
@@ -139,10 +139,10 @@ public class Schema
      */
     public void storeTableInstance(Table table)
     {
-        if (tableInstances.containsKey(table.name))
-            throw new IllegalArgumentException(String.format("Table %s was already initialized.",
table.name));
+        if (tableInstances.containsKey(table.getName()))
+            throw new IllegalArgumentException(String.format("Table %s was already initialized.",
table.getName()));
 
-        tableInstances.put(table.name, table);
+        tableInstances.put(table.getName(), table);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/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 7160b62..58b6ba2 100644
--- a/src/java/org/apache/cassandra/db/CollationController.java
+++ b/src/java/org/apache/cassandra/db/CollationController.java
@@ -25,7 +25,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.db.columniterator.OnDiskAtomIterator;
-import org.apache.cassandra.db.columniterator.ISSTableColumnIterator;
 import org.apache.cassandra.db.columniterator.SimpleAbstractColumnIterator;
 import org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy;
 import org.apache.cassandra.db.filter.NamesQueryFilter;
@@ -176,7 +175,7 @@ public class CollationController
                 && cfs.getCompactionStrategy() instanceof SizeTieredCompactionStrategy)
             {
                 Tracing.trace("Defragmenting requested data");
-                RowMutation rm = new RowMutation(cfs.table.name, new Row(filter.key, returnCF.cloneMe()));
+                RowMutation rm = new RowMutation(cfs.table.getName(), new Row(filter.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);
             }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index f93cf8c..1e011ee 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -329,7 +329,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
         // register the mbean
         String type = this.partitioner instanceof LocalPartitioner ? "IndexColumnFamilies"
: "ColumnFamilies";
-        mbeanName = "org.apache.cassandra.db:type=" + type + ",keyspace=" + this.table.name
+ ",columnfamily=" + name;
+        mbeanName = "org.apache.cassandra.db:type=" + type + ",keyspace=" + this.table.getName()
+ ",columnfamily=" + name;
         try
         {
             MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
@@ -402,7 +402,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public static ColumnFamilyStore createColumnFamilyStore(Table table, String columnFamily,
boolean loadSSTables)
     {
-        return createColumnFamilyStore(table, columnFamily, StorageService.getPartitioner(),
Schema.instance.getCFMetaData(table.name, columnFamily), loadSSTables);
+        return createColumnFamilyStore(table, columnFamily, StorageService.getPartitioner(),
Schema.instance.getCFMetaData(table.getName(), columnFamily), loadSSTables);
     }
 
     public static ColumnFamilyStore createColumnFamilyStore(Table table, String columnFamily,
IPartitioner partitioner, CFMetaData metadata)
@@ -417,7 +417,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
                                                                          boolean loadSSTables)
     {
         // get the max generation number, to prevent generation conflicts
-        Directories directories = Directories.create(table.name, columnFamily);
+        Directories directories = Directories.create(table.getName(), columnFamily);
         Directories.SSTableLister lister = directories.sstableLister().includeBackups(true);
         List<Integer> generations = new ArrayList<Integer>();
         for (Map.Entry<Descriptor, Set<Component>> entry : lister.list().entrySet())
@@ -501,7 +501,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
             logger.info(String.format("completed loading (%d ms; %d keys) row cache for %s.%s",
                         System.currentTimeMillis() - start,
                         cachedRowsRead,
-                        table.name,
+                        table.getName(),
                         name));
     }
 
@@ -523,7 +523,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
      */
     public synchronized void loadNewSSTables()
     {
-        logger.info("Loading new SSTables for " + table.name + "/" + name + "...");
+        logger.info("Loading new SSTables for " + table.getName() + "/" + name + "...");
 
         Set<Descriptor> currentDescriptors = new HashSet<Descriptor>();
         for (SSTableReader sstable : data.getView().sstables)
@@ -569,11 +569,11 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
         if (newSSTables.isEmpty())
         {
-            logger.info("No new SSTables were found for " + table.name + "/" + name);
+            logger.info("No new SSTables were found for " + table.getName() + "/" + name);
             return;
         }
 
-        logger.info("Loading new SSTables and building secondary indexes for " + table.name
+ "/" + name + ": " + newSSTables);
+        logger.info("Loading new SSTables and building secondary indexes for " + table.getName()
+ "/" + name + ": " + newSSTables);
         SSTableReader.acquireReferences(newSSTables);
         data.addSSTables(newSSTables);
         try
@@ -585,7 +585,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
             SSTableReader.releaseReferences(newSSTables);
         }
 
-        logger.info("Done loading load new SSTables for " + table.name + "/" + name);
+        logger.info("Done loading load new SSTables for " + table.getName() + "/" + name);
     }
 
     public static void rebuildSecondaryIndex(String ksName, String cfName, String... idxNames)
@@ -623,7 +623,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
     {
         Descriptor desc = new Descriptor(version,
                                          directory,
-                                         table.name,
+                                         table.getName(),
                                          name,
                                          fileIndexGenerator.incrementAndGet(),
                                          true);
@@ -979,7 +979,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
         // cleanup size estimation only counts bytes for keys local to this node
         long expectedFileSize = 0;
-        Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(table.name);
+        Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(table.getName());
         for (SSTableReader sstable : sstables)
         {
             List<Pair<Long, Long>> positions = sstable.getPositionsForRanges(ranges);
@@ -1246,10 +1246,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         {
             if (isRowCacheEnabled())
             {
-                UUID cfId = Schema.instance.getId(table.name, name);
+                UUID cfId = Schema.instance.getId(table.getName(), name);
                 if (cfId == null)
                 {
-                    logger.trace("no id found for {}.{}", table.name, name);
+                    logger.trace("no id found for {}.{}", table.getName(), name);
                     return null;
                 }
 
@@ -1700,7 +1700,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public void invalidateCachedRow(DecoratedKey key)
     {
-        UUID cfId = Schema.instance.getId(table.name, this.name);
+        UUID cfId = Schema.instance.getId(table.getName(), this.name);
         if (cfId == null)
             return; // secondary index
 
@@ -1851,7 +1851,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
     public String toString()
     {
         return "CFS(" +
-               "Keyspace='" + table.name + '\'' +
+               "Keyspace='" + table.getName() + '\'' +
                ", ColumnFamily='" + name + '\'' +
                ')';
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/DataTracker.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DataTracker.java b/src/java/org/apache/cassandra/db/DataTracker.java
index 75620e5..77e7a5e 100644
--- a/src/java/org/apache/cassandra/db/DataTracker.java
+++ b/src/java/org/apache/cassandra/db/DataTracker.java
@@ -337,7 +337,7 @@ public class DataTracker
             assert sstable.getKeySamples() != null;
             if (logger.isDebugEnabled())
                 logger.debug(String.format("adding %s to list of files tracked for %s.%s",
-                            sstable.descriptor, cfstore.table.name, cfstore.name));
+                            sstable.descriptor, cfstore.table.getName(), cfstore.name));
             long size = sstable.bytesOnDisk();
             StorageMetrics.load.inc(size);
             cfstore.metric.liveDiskSpaceUsed.inc(size);
@@ -352,7 +352,7 @@ public class DataTracker
         {
             if (logger.isDebugEnabled())
                 logger.debug(String.format("removing %s from list of files tracked for %s.%s",
-                            sstable.descriptor, cfstore.table.name, cfstore.name));
+                            sstable.descriptor, cfstore.table.getName(), cfstore.name));
             long size = sstable.bytesOnDisk();
             StorageMetrics.load.dec(size);
             cfstore.metric.liveDiskSpaceUsed.dec(size);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/Memtable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Memtable.java b/src/java/org/apache/cassandra/db/Memtable.java
index 7455cdf..8cf73db 100644
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@ -462,7 +462,7 @@ public class Memtable
                         // and BL data is strictly local, so we don't need to preserve tombstones
for repair.
                         // If we have a data row + row level tombstone, then writing it is
effectively an expensive no-op so we skip it.
                         // See CASSANDRA-4667.
-                        if (cfs.name.equals(SystemTable.BATCHLOG_CF) && cfs.table.name.equals(Table.SYSTEM_KS)
&& !cf.isEmpty())
+                        if (cfs.name.equals(SystemTable.BATCHLOG_CF) && cfs.table.getName().equals(Table.SYSTEM_KS)
&& !cf.isEmpty())
                             continue;
 
                         // Pedantically, you could purge column level tombstones that are
past GcGRace when writing to the SSTable.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/RowMutation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowMutation.java b/src/java/org/apache/cassandra/db/RowMutation.java
index fdeb75e..912faf5 100644
--- a/src/java/org/apache/cassandra/db/RowMutation.java
+++ b/src/java/org/apache/cassandra/db/RowMutation.java
@@ -258,8 +258,8 @@ public class RowMutation implements IMutation
      */
     public void apply()
     {
-        KSMetaData ksm = Schema.instance.getKSMetaData(getTable());
-        Table.open(table).apply(this, ksm.durableWrites);
+        Table ks = Table.open(table);
+        ks.apply(this, ks.metadata.durableWrites);
     }
 
     public void applyUnsafe()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/Table.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Table.java b/src/java/org/apache/cassandra/db/Table.java
index c5df634..e979975 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -69,8 +69,8 @@ public class Table
             DatabaseDescriptor.createAllDirectories();
     }
 
-    /* Table name. */
-    public final String name;
+    public final KSMetaData metadata;
+
     /* ColumnFamilyStore per column family */
     private final ConcurrentMap<UUID, ColumnFamilyStore> columnFamilyStores = new ConcurrentHashMap<UUID,
ColumnFamilyStore>();
     private final Object[] indexLocks;
@@ -154,9 +154,9 @@ public class Table
 
     public ColumnFamilyStore getColumnFamilyStore(String cfName)
     {
-        UUID id = Schema.instance.getId(name, cfName);
+        UUID id = Schema.instance.getId(getName(), cfName);
         if (id == null)
-            throw new IllegalArgumentException(String.format("Unknown table/cf pair (%s.%s)",
name, cfName));
+            throw new IllegalArgumentException(String.format("Unknown table/cf pair (%s.%s)",
getName(), cfName));
         return getColumnFamilyStore(id);
     }
 
@@ -251,12 +251,11 @@ public class Table
 
     private Table(String table, boolean loadSSTables)
     {
-        name = table;
-        KSMetaData ksm = Schema.instance.getKSMetaData(table);
-        assert ksm != null : "Unknown keyspace " + table;
+        metadata = Schema.instance.getKSMetaData(table);
+        assert metadata != null : "Unknown keyspace " + table;
         try
         {
-            createReplicationStrategy(ksm);
+            createReplicationStrategy(metadata);
         }
         catch (ConfigurationException e)
         {
@@ -267,9 +266,9 @@ public class Table
         for (int i = 0; i < indexLocks.length; i++)
             indexLocks[i] = new Object();
 
-        for (CFMetaData cfm : new ArrayList<CFMetaData>(Schema.instance.getKSMetaData(table).cfMetaData().values()))
+        for (CFMetaData cfm : new ArrayList<CFMetaData>(metadata.cfMetaData().values()))
         {
-            logger.debug("Initializing {}.{}", name, cfm.cfName);
+            logger.debug("Initializing {}.{}", getName(), cfm.cfName);
             initCf(cfm.cfId, cfm.cfName, loadSSTables);
         }
     }
@@ -473,6 +472,11 @@ public class Table
     @Override
     public String toString()
     {
-        return getClass().getSimpleName() + "(name='" + name + "')";
+        return getClass().getSimpleName() + "(name='" + getName() + "')";
+    }
+
+    public String getName()
+    {
+        return metadata.name;
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/compaction/CompactionController.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionController.java b/src/java/org/apache/cassandra/db/compaction/CompactionController.java
index 7783d28..3bd9018 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionController.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionController.java
@@ -97,7 +97,7 @@ public class CompactionController
 
     public String getKeyspace()
     {
-        return cfs.table.name;
+        return cfs.table.getName();
     }
 
     public String getColumnFamily()
@@ -156,7 +156,7 @@ public class CompactionController
         {
             String keyString = cfs.metadata.getKeyValidator().getString(rows.get(0).getKey().key);
             logger.info(String.format("Compacting large row %s/%s:%s (%d bytes) incrementally",
-                                      cfs.table.name, cfs.name, keyString, rowSize));
+                                      cfs.table.getName(), cfs.name, keyString, rowSize));
             return new LazilyCompactedRow(this, rows);
         }
         return new PrecompactedRow(this, rows);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 7f1b72e..198fa01 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -129,12 +129,12 @@ public class CompactionManager implements CompactionManagerMBean
         if (count > 0 && executor.getActiveCount() >= executor.getMaximumPoolSize())
         {
             logger.debug("Background compaction is still running for {}.{} ({} remaining).
Skipping",
-                         new Object[] {cfs.table.name, cfs.name, count});
+                         new Object[] { cfs.table.getName(), cfs.name, count});
             return Collections.emptyList();
         }
 
         logger.debug("Scheduling a background task check for {}.{} with {}",
-                     new Object[] {cfs.table.name,
+                     new Object[] { cfs.table.getName(),
                                    cfs.name,
                                    cfs.getCompactionStrategy().getClass().getSimpleName()});
         List<Future<?>> futures = new ArrayList<Future<?>>();
@@ -163,7 +163,7 @@ public class CompactionManager implements CompactionManagerMBean
             compactionLock.readLock().lock();
             try
             {
-                logger.debug("Checking {}.{}", cfs.table.name, cfs.name); // log after we
get the lock so we can see delays from that if any
+                logger.debug("Checking {}.{}", cfs.table.getName(), cfs.name); // log after
we get the lock so we can see delays from that if any
                 if (!cfs.isValid())
                 {
                     logger.debug("Aborting compaction for dropped CF");
@@ -552,7 +552,7 @@ public class CompactionManager implements CompactionManagerMBean
     {
         assert !cfs.isIndex();
         Table table = cfs.table;
-        Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(table.name);
+        Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(table.getName());
         if (ranges.isEmpty())
         {
             logger.info("Cleanup cannot run before a node has joined the ring");
@@ -735,7 +735,7 @@ public class CompactionManager implements CompactionManagerMBean
             // flush first so everyone is validating data that is as similar as possible
             try
             {
-                StorageService.instance.forceTableFlush(cfs.table.name, cfs.name);
+                StorageService.instance.forceTableFlush(cfs.table.getName(), cfs.name);
             }
             catch (ExecutionException e)
             {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
index 8f103ff..b771e44 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -641,7 +641,7 @@ public class LeveledManifest
         }
 
         logger.debug("Estimating {} compactions to do for {}.{}",
-                     new Object[] {Arrays.toString(estimated), cfs.table.name, cfs.name });
+                     new Object[] {Arrays.toString(estimated), cfs.table.getName(), cfs.name
});
         return Ints.checkedCast(tasks);
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndex.java b/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
index 315ee77..c7af4f1 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
@@ -108,19 +108,19 @@ public abstract class SecondaryIndex
      */
     public boolean isIndexBuilt(ByteBuffer columnName)
     {
-        return SystemTable.isIndexBuilt(baseCfs.table.name, getNameForSystemTable(columnName));
+        return SystemTable.isIndexBuilt(baseCfs.table.getName(), getNameForSystemTable(columnName));
     }
 
     public void setIndexBuilt()
     {
         for (ColumnDefinition columnDef : columnDefs)
-            SystemTable.setIndexBuilt(baseCfs.table.name, getNameForSystemTable(columnDef.name));
+            SystemTable.setIndexBuilt(baseCfs.table.getName(), getNameForSystemTable(columnDef.name));
     }
 
     public void setIndexRemoved()
     {
         for (ColumnDefinition columnDef : columnDefs)
-            SystemTable.setIndexRemoved(baseCfs.table.name, getNameForSystemTable(columnDef.name));
+            SystemTable.setIndexRemoved(baseCfs.table.getName(), getNameForSystemTable(columnDef.name));
     }
 
     /**
@@ -215,7 +215,7 @@ public abstract class SecondaryIndex
         boolean allAreBuilt = true;
         for (ColumnDefinition cdef : columnDefs)
         {
-            if (!SystemTable.isIndexBuilt(baseCfs.table.name, getNameForSystemTable(cdef.name)))
+            if (!SystemTable.isIndexBuilt(baseCfs.table.getName(), getNameForSystemTable(cdef.name)))
             {
                 allAreBuilt = false;
                 break;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java b/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
index 727a79e..a42f74d 100644
--- a/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
@@ -319,7 +319,7 @@ public class ColumnFamilyMetrics
 
         ColumnFamilyMetricNameFactory(ColumnFamilyStore cfs)
         {
-            this.keyspaceName = cfs.table.name;
+            this.keyspaceName = cfs.table.getName();
             this.columnFamilyName = cfs.name;
             isIndex = cfs.isIndex();
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 01ac31a..a760d5e 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -472,7 +472,7 @@ public class StorageService implements IEndpointStateChangeSubscriber,
StorageSe
                 List<Future<?>> flushes = new ArrayList<Future<?>>();
                 for (Table table : Table.all())
                 {
-                    KSMetaData ksm = Schema.instance.getKSMetaData(table.name);
+                    KSMetaData ksm = Schema.instance.getKSMetaData(table.getName());
                     if (!ksm.durableWrites)
                     {
                         for (ColumnFamilyStore cfs : table.getColumnFamilyStores())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/streaming/StreamOut.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamOut.java b/src/java/org/apache/cassandra/streaming/StreamOut.java
index 2ade0c6..f29c61f 100644
--- a/src/java/org/apache/cassandra/streaming/StreamOut.java
+++ b/src/java/org/apache/cassandra/streaming/StreamOut.java
@@ -80,7 +80,7 @@ public class StreamOut
     */
     public static void transferRanges(InetAddress target, Table table, Collection<Range<Token>>
ranges, IStreamCallback callback, OperationType type)
     {
-        StreamOutSession session = StreamOutSession.create(table.name, target, callback);
+        StreamOutSession session = StreamOutSession.create(table.getName(), target, callback);
         transferRanges(session, table.getColumnFamilyStores(), ranges, type);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/src/java/org/apache/cassandra/utils/StatusLogger.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/StatusLogger.java b/src/java/org/apache/cassandra/utils/StatusLogger.java
index ba5e0ed..b7266cb 100644
--- a/src/java/org/apache/cassandra/utils/StatusLogger.java
+++ b/src/java/org/apache/cassandra/utils/StatusLogger.java
@@ -110,7 +110,7 @@ public class StatusLogger
         for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
         {
             logger.info(String.format("%-25s%20s",
-                                      cfs.table.name + "." + cfs.name,
+                                      cfs.table.getName() + "." + cfs.name,
                                       cfs.getMemtableColumnsCount() + "," + cfs.getMemtableDataSize()));
         }
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/test/long/org/apache/cassandra/db/MeteredFlusherTest.java
----------------------------------------------------------------------
diff --git a/test/long/org/apache/cassandra/db/MeteredFlusherTest.java b/test/long/org/apache/cassandra/db/MeteredFlusherTest.java
index e77ce69..150282f 100644
--- a/test/long/org/apache/cassandra/db/MeteredFlusherTest.java
+++ b/test/long/org/apache/cassandra/db/MeteredFlusherTest.java
@@ -41,7 +41,7 @@ public class MeteredFlusherTest extends SchemaLoader
         Table table = Table.open("Keyspace1");
         for (int i = 0; i < 100; i++)
         {
-            CFMetaData metadata = new CFMetaData(table.name, "_CF" + i, ColumnFamilyType.Standard,
UTF8Type.instance, null);
+            CFMetaData metadata = new CFMetaData(table.getName(), "_CF" + i, ColumnFamilyType.Standard,
UTF8Type.instance, null);
             MigrationManager.announceNewColumnFamily(metadata);
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
index 63d1500..b6f9817 100644
--- a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
+++ b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
@@ -693,7 +693,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         assertRowAndColCount(1, 6, scfName, false, cfs.getRangeSlice(scfName, Util.range("f",
"g"), 100, ThriftValidation.asIFilter(sp, cfs.getComparator()), null));
 
         // deeleet.
-        RowMutation rm = new RowMutation(table.name, key.key);
+        RowMutation rm = new RowMutation(table.getName(), key.key);
         rm.delete(new QueryPath(cfName, scfName), 2);
         rm.apply();
 
@@ -747,8 +747,8 @@ public class ColumnFamilyStoreTest extends SchemaLoader
 
     private static void putColsSuper(ColumnFamilyStore cfs, DecoratedKey key, ByteBuffer
scfName, Column... cols) throws Throwable
     {
-        RowMutation rm = new RowMutation(cfs.table.name, key.key);
-        ColumnFamily cf = ColumnFamily.create(cfs.table.name, cfs.name);
+        RowMutation rm = new RowMutation(cfs.table.getName(), key.key);
+        ColumnFamily cf = ColumnFamily.create(cfs.table.getName(), cfs.name);
         SuperColumn sc = new SuperColumn(scfName, cfs.metadata.subcolumnComparator);
         for (Column col : cols)
             sc.addColumn(col);
@@ -759,8 +759,8 @@ public class ColumnFamilyStoreTest extends SchemaLoader
 
     private static void putColsStandard(ColumnFamilyStore cfs, DecoratedKey key, Column...
cols) throws Throwable
     {
-        RowMutation rm = new RowMutation(cfs.table.name, key.key);
-        ColumnFamily cf = ColumnFamily.create(cfs.table.name, cfs.name);
+        RowMutation rm = new RowMutation(cfs.table.getName(), key.key);
+        ColumnFamily cf = ColumnFamily.create(cfs.table.getName(), cfs.name);
         for (Column col : cols)
             cf.addColumn(col);
         rm.add(cf);
@@ -795,7 +795,7 @@ public class ColumnFamilyStoreTest extends SchemaLoader
         assertRowAndColCount(1, 4, null, false, cfs.getRangeSlice(null, Util.range("f", "g"),
100, ThriftValidation.asIFilter(sp, cfs.getComparator()), null));
 
         // delete (from sstable and memtable)
-        RowMutation rm = new RowMutation(table.name, key.key);
+        RowMutation rm = new RowMutation(table.getName(), key.key);
         rm.delete(new QueryPath(cfs.name, null, null), 2);
         rm.apply();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/test/unit/org/apache/cassandra/streaming/SerializationsTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/streaming/SerializationsTest.java b/test/unit/org/apache/cassandra/streaming/SerializationsTest.java
index 47990ab..540b10e 100644
--- a/test/unit/org/apache/cassandra/streaming/SerializationsTest.java
+++ b/test/unit/org/apache/cassandra/streaming/SerializationsTest.java
@@ -204,7 +204,7 @@ public class SerializationsTest extends AbstractSerializationsTester
         Table t = Table.open("Keyspace1");
         for (int i = 0; i < 100; i++)
         {
-            RowMutation rm = new RowMutation(t.name, ByteBufferUtil.bytes(Long.toString(System.nanoTime())));
+            RowMutation rm = new RowMutation(t.getName(), ByteBufferUtil.bytes(Long.toString(System.nanoTime())));
             rm.add(new QueryPath("Standard1", null, ByteBufferUtil.bytes("cola")), ByteBufferUtil.bytes("value"),
0);
             rm.apply();
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e4d5d339/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java b/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
index ffbeb65..86469e1 100644
--- a/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
+++ b/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
@@ -118,7 +118,7 @@ public class StreamingTransferTest extends SchemaLoader
         List<Range<Token>> ranges = new ArrayList<Range<Token>>();
         ranges.add(new Range<Token>(p.getMinimumToken(), p.getToken(ByteBufferUtil.bytes("key1"))));
         ranges.add(new Range<Token>(p.getToken(ByteBufferUtil.bytes("key2")), p.getMinimumToken()));
-        StreamOutSession session = StreamOutSession.create(table.name, LOCAL, (IStreamCallback)null);
+        StreamOutSession session = StreamOutSession.create(table.getName(), LOCAL, (IStreamCallback)null);
         StreamOut.transferSSTables(session, Arrays.asList(sstable), ranges, OperationType.BOOTSTRAP);
         session.await();
     }
@@ -135,7 +135,7 @@ public class StreamingTransferTest extends SchemaLoader
             {
                 long val = key.hashCode();
                 RowMutation rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes(key));
-                ColumnFamily cf = ColumnFamily.create(table.name, cfs.name);
+                ColumnFamily cf = ColumnFamily.create(table.getName(), cfs.name);
                 cf.addColumn(column(col, "v", timestamp));
                 cf.addColumn(new Column(ByteBufferUtil.bytes("birthdate"), ByteBufferUtil.bytes(val),
timestamp));
                 rm.add(cf);
@@ -171,7 +171,7 @@ public class StreamingTransferTest extends SchemaLoader
         {
             public void mutate(String key, String col, long timestamp) throws Exception
             {
-                RowMutation rm = new RowMutation(table.name, ByteBufferUtil.bytes(key));
+                RowMutation rm = new RowMutation(table.getName(), ByteBufferUtil.bytes(key));
                 addMutation(rm, cfs.name, col, 1, "val1", timestamp);
                 rm.apply();
             }
@@ -210,7 +210,7 @@ public class StreamingTransferTest extends SchemaLoader
                 entries.put(key, cf);
                 cleanedEntries.put(key, cfCleaned);
                 cfs.addSSTable(SSTableUtils.prepare()
-                    .ks(table.name)
+                    .ks(table.getName())
                     .cf(cfs.name)
                     .generation(0)
                     .write(entries));
@@ -220,7 +220,7 @@ public class StreamingTransferTest extends SchemaLoader
         // filter pre-cleaned entries locally, and ensure that the end result is equal
         cleanedEntries.keySet().retainAll(keys);
         SSTableReader cleaned = SSTableUtils.prepare()
-            .ks(table.name)
+            .ks(table.getName())
             .cf(cfs.name)
             .generation(0)
             .write(cleanedEntries);


Mime
View raw message