cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: remove dead and deprecated use of code
Date Sun, 29 Jan 2017 00:48:48 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 03662bb36 -> 619178bc8


remove dead and deprecated use of code


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

Branch: refs/heads/trunk
Commit: 619178bc866f8908123631553270ae6393090d43
Parents: 03662bb
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sat Jan 28 19:48:30 2017 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Sat Jan 28 19:48:30 2017 -0500

----------------------------------------------------------------------
 .../db/compaction/CompactionManager.java        |  2 +-
 .../compaction/LeveledCompactionStrategy.java   | 14 +++++------
 .../cassandra/service/StorageService.java       |  2 +-
 .../cassandra/streaming/StreamReader.java       | 26 +++-----------------
 .../compress/CompressedStreamReader.java        |  5 ++--
 .../org/apache/cassandra/tools/NodeProbe.java   |  6 ++---
 .../apache/cassandra/tools/nodetool/Info.java   |  2 +-
 .../apache/cassandra/db/SystemKeyspaceTest.java |  2 +-
 .../apache/cassandra/repair/ValidatorTest.java  |  2 +-
 .../org/apache/cassandra/schema/MockSchema.java |  2 +-
 .../streaming/StreamingTransferTest.java        |  4 +--
 11 files changed, 23 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/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 91263a7..0feb236 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -1557,7 +1557,7 @@ public class CompactionManager implements CompactionManagerMBean
             logger.trace("Repaired {} keys out of {} for {}/{} in {}", repairedKeyCount,
                                                                        repairedKeyCount +
unrepairedKeyCount,
                                                                        cfs.keyspace.getName(),
-                                                                       cfs.getColumnFamilyName(),
+                                                                       cfs.getTableName(),
                                                                        anticompactionGroup);
             return anticompactedSSTables.size();
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
index b3395d0..9495582 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
@@ -62,18 +62,18 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
         int configuredLevelFanoutSize = DEFAULT_LEVEL_FANOUT_SIZE;
         SizeTieredCompactionStrategyOptions localOptions = new SizeTieredCompactionStrategyOptions(options);
         if (options != null)
-        {             
-            if (options.containsKey(SSTABLE_SIZE_OPTION))             
-            {                 
-                configuredMaxSSTableSize = Integer.parseInt(options.get(SSTABLE_SIZE_OPTION));
                
+        {
+            if (options.containsKey(SSTABLE_SIZE_OPTION))
+            {
+                configuredMaxSSTableSize = Integer.parseInt(options.get(SSTABLE_SIZE_OPTION));
                 if (!tolerateSstableSize)
-                {                     
+                {
                     if (configuredMaxSSTableSize >= 1000)
                         logger.warn("Max sstable size of {}MB is configured for {}.{}; having
a unit of compaction this large is probably a bad idea",
-                                configuredMaxSSTableSize, cfs.name, cfs.getColumnFamilyName());
+                                configuredMaxSSTableSize, cfs.name, cfs.getTableName());
                     if (configuredMaxSSTableSize < 50)
                         logger.warn("Max sstable size of {}MB is configured for {}.{}.  Testing
done for CASSANDRA-5727 indicates that performance improves up to 160MB",
-                                configuredMaxSSTableSize, cfs.name, cfs.getColumnFamilyName());
+                                configuredMaxSSTableSize, cfs.name, cfs.getTableName());
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/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 62f4871..16fbfbd 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3196,7 +3196,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
                         snapshotMap.put(snapshotDetail.getKey(), data);
                     }
 
-                    SnapshotDetailsTabularData.from(snapshotDetail.getKey(), keyspace.getName(),
cfStore.getColumnFamilyName(), snapshotDetail, data);
+                    SnapshotDetailsTabularData.from(snapshotDetail.getKey(), keyspace.getName(),
cfStore.getTableName(), snapshotDetail, data);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/src/java/org/apache/cassandra/streaming/StreamReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamReader.java b/src/java/org/apache/cassandra/streaming/StreamReader.java
index 0eee6f0..baf5ec9 100644
--- a/src/java/org/apache/cassandra/streaming/StreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/StreamReader.java
@@ -21,7 +21,6 @@ import java.io.*;
 import java.nio.channels.Channels;
 import java.nio.channels.ReadableByteChannel;
 import java.util.Collection;
-import java.util.UUID;
 
 import com.google.common.base.Throwables;
 import com.google.common.collect.UnmodifiableIterator;
@@ -98,11 +97,10 @@ public class StreamReader
 
         logger.debug("[Stream #{}] Start receiving file #{} from {}, repairedAt = {}, size
= {}, ks = '{}', table = '{}'.",
                      session.planId(), fileSeqNum, session.peer, repairedAt, totalSize, cfs.keyspace.getName(),
-                     cfs.getColumnFamilyName());
+                     cfs.getTableName());
 
         TrackedInputStream in = new TrackedInputStream(new LZFInputStream(Channels.newInputStream(channel)));
-        StreamDeserializer deserializer = new StreamDeserializer(cfs.metadata(), in, inputVersion,
getHeader(cfs.metadata()),
-                                                                 totalSize, session.planId());
+        StreamDeserializer deserializer = new StreamDeserializer(cfs.metadata(), in, inputVersion,
getHeader(cfs.metadata()));
         SSTableMultiWriter writer = null;
         try
         {
@@ -185,8 +183,7 @@ public class StreamReader
         private Row staticRow;
         private IOException exception;
 
-        public StreamDeserializer(TableMetadata metadata, InputStream in, Version version,
SerializationHeader header,
-                                  long totalSize, UUID sessionId) throws IOException
+        public StreamDeserializer(TableMetadata metadata, InputStream in, Version version,
SerializationHeader header) throws IOException
         {
             this.metadata = metadata;
             this.in = new DataInputPlus.DataInputStreamPlus(in);
@@ -300,22 +297,5 @@ public class StreamReader
                 }
             }
         }
-
-        private static File getTempBufferFile(TableMetadata metadata, long totalSize, UUID
sessionId) throws IOException
-        {
-            ColumnFamilyStore cfs = Keyspace.open(metadata.keyspace).getColumnFamilyStore(metadata.name);
-            if (cfs == null)
-            {
-                // schema was dropped during streaming
-                throw new RuntimeException(String.format("Table %s was dropped during streaming",
metadata.toString()));
-            }
-
-            long maxSize = Math.min(MAX_SPILL_FILE_SIZE, totalSize);
-            File tmpDir = cfs.getDirectories().getTemporaryWriteableDirectoryAsFile(maxSize);
-            if (tmpDir == null)
-                throw new IOException(String.format("No sufficient disk space to stream legacy
sstable from {}.{}. " +
-                                                         "Required disk space: %s.", FBUtilities.prettyPrintMemory(maxSize)));
-            return new File(tmpDir, String.format("%s-%s.%s", BUFFER_FILE_PREFIX, sessionId,
BUFFER_FILE_SUFFIX));
-        }
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
b/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
index 6ac607f..a15d2ff 100644
--- a/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
@@ -74,14 +74,13 @@ public class CompressedStreamReader extends StreamReader
 
         logger.debug("[Stream #{}] Start receiving file #{} from {}, repairedAt = {}, size
= {}, ks = '{}', table = '{}'.",
                      session.planId(), fileSeqNum, session.peer, repairedAt, totalSize, cfs.keyspace.getName(),
-                     cfs.getColumnFamilyName());
+                     cfs.getTableName());
 
         CompressedInputStream cis = new CompressedInputStream(Channels.newInputStream(channel),
compressionInfo,
                                                               ChecksumType.CRC32, cfs::getCrcCheckChance);
         TrackedInputStream in = new TrackedInputStream(cis);
 
-        StreamDeserializer deserializer = new StreamDeserializer(cfs.metadata(), in, inputVersion,
getHeader(cfs.metadata()),
-                                                                 totalSize, session.planId());
+        StreamDeserializer deserializer = new StreamDeserializer(cfs.metadata(), in, inputVersion,
getHeader(cfs.metadata()));
         SSTableMultiWriter writer = null;
         try
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/src/java/org/apache/cassandra/tools/NodeProbe.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 6272997..9e45d6a 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -1027,7 +1027,7 @@ public class NodeProbe implements AutoCloseable
             case "truncate":
                 return ssProxy.getTruncateRpcTimeout();
             case "streamingsocket":
-                return (long) ssProxy.getStreamingSocketTimeout();
+                return ssProxy.getStreamingSocketTimeout();
             default:
                 throw new RuntimeException("Timeout type requires one of (" + GetTimeout.TIMEOUT_TYPES
+ ")");
         }
@@ -1535,8 +1535,8 @@ class ColumnFamilyStoreMBeanIterator implements Iterator<Map.Entry<String,
Colum
                     return keyspaceNameCmp;
 
                 // get CF name and split it for index name
-                String e1CF[] = e1.getValue().getColumnFamilyName().split("\\.");
-                String e2CF[] = e2.getValue().getColumnFamilyName().split("\\.");
+                String e1CF[] = e1.getValue().getTableName().split("\\.");
+                String e2CF[] = e2.getValue().getTableName().split("\\.");
                 assert e1CF.length <= 2 && e2CF.length <= 2 : "unexpected split
count for table name";
 
                 //if neither are indexes, just compare CF names

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/src/java/org/apache/cassandra/tools/nodetool/Info.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/Info.java b/src/java/org/apache/cassandra/tools/nodetool/Info.java
index bddd124..1aa113d 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/Info.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/Info.java
@@ -173,7 +173,7 @@ public class Info extends NodeToolCmd
         {
             Entry<String, ColumnFamilyStoreMBean> entry = cfamilies.next();
             String keyspaceName = entry.getKey();
-            String cfName = entry.getValue().getColumnFamilyName();
+            String cfName = entry.getValue().getTableName();
 
             offHeapMemUsedInBytes += (Long) probe.getColumnFamilyMetric(keyspaceName, cfName,
"MemtableOffHeapSize");
             offHeapMemUsedInBytes += (Long) probe.getColumnFamilyMetric(keyspaceName, cfName,
"BloomFilterOffHeapMemoryUsed");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/test/unit/org/apache/cassandra/db/SystemKeyspaceTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/SystemKeyspaceTest.java b/test/unit/org/apache/cassandra/db/SystemKeyspaceTest.java
index feac1e9..72db2a4 100644
--- a/test/unit/org/apache/cassandra/db/SystemKeyspaceTest.java
+++ b/test/unit/org/apache/cassandra/db/SystemKeyspaceTest.java
@@ -167,7 +167,7 @@ public class SystemKeyspaceTest
         for (ColumnFamilyStore cfs : Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME).getColumnFamilyStores())
         {
             if (!cfs.getSnapshotDetails().isEmpty())
-                snapshottedTableNames.add(cfs.getColumnFamilyName());
+                snapshottedTableNames.add(cfs.getTableName());
         }
         return snapshottedTableNames;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/test/unit/org/apache/cassandra/repair/ValidatorTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/repair/ValidatorTest.java b/test/unit/org/apache/cassandra/repair/ValidatorTest.java
index c514d7c..e2fb2c4 100644
--- a/test/unit/org/apache/cassandra/repair/ValidatorTest.java
+++ b/test/unit/org/apache/cassandra/repair/ValidatorTest.java
@@ -185,7 +185,7 @@ public class ValidatorTest
         SSTableReader sstable = cfs.getLiveSSTables().iterator().next();
         UUID repairSessionId = UUIDGen.getTimeUUID();
         final RepairJobDesc desc = new RepairJobDesc(repairSessionId, UUIDGen.getTimeUUID(),
cfs.keyspace.getName(),
-                                               cfs.getColumnFamilyName(), Collections.singletonList(new
Range<>(sstable.first.getToken(),
+                                               cfs.getTableName(), Collections.singletonList(new
Range<>(sstable.first.getToken(),
                                                                                         
                       sstable.last.getToken())));
 
         ActiveRepairService.instance.registerParentRepairSession(repairSessionId, FBUtilities.getBroadcastAddress(),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/test/unit/org/apache/cassandra/schema/MockSchema.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/schema/MockSchema.java b/test/unit/org/apache/cassandra/schema/MockSchema.java
index 023015b..b94b49c 100644
--- a/test/unit/org/apache/cassandra/schema/MockSchema.java
+++ b/test/unit/org/apache/cassandra/schema/MockSchema.java
@@ -87,7 +87,7 @@ public class MockSchema
     {
         Descriptor descriptor = new Descriptor(cfs.getDirectories().getDirectoryForNewSSTables(),
                                                cfs.keyspace.getName(),
-                                               cfs.getColumnFamilyName(),
+                                               cfs.getTableName(),
                                                generation, SSTableFormat.Type.BIG);
         Set<Component> components = ImmutableSet.of(Component.DATA, Component.PRIMARY_INDEX,
Component.FILTER, Component.TOC);
         for (Component component : components)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/619178bc/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 9219e18..1fa71f5 100644
--- a/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
+++ b/test/unit/org/apache/cassandra/streaming/StreamingTransferTest.java
@@ -238,14 +238,14 @@ public class StreamingTransferTest
         List<Range<Token>> ranges = new ArrayList<>();
         // wrapped range
         ranges.add(new Range<Token>(p.getToken(ByteBufferUtil.bytes("key1")), p.getToken(ByteBufferUtil.bytes("key0"))));
-        StreamPlan streamPlan = new StreamPlan("StreamingTransferTest").transferRanges(LOCAL,
cfs.keyspace.getName(), ranges, cfs.getColumnFamilyName());
+        StreamPlan streamPlan = new StreamPlan("StreamingTransferTest").transferRanges(LOCAL,
cfs.keyspace.getName(), ranges, cfs.getTableName());
         streamPlan.execute().get();
         verifyConnectionsAreClosed();
 
         //cannot add ranges after stream session is finished
         try
         {
-            streamPlan.transferRanges(LOCAL, cfs.keyspace.getName(), ranges, cfs.getColumnFamilyName());
+            streamPlan.transferRanges(LOCAL, cfs.keyspace.getName(), ranges, cfs.getTableName());
             fail("Should have thrown exception");
         }
         catch (RuntimeException e)


Mime
View raw message