Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 14469 invoked from network); 15 Jun 2010 18:03:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Jun 2010 18:03:41 -0000 Received: (qmail 63133 invoked by uid 500); 15 Jun 2010 18:03:41 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 62986 invoked by uid 500); 15 Jun 2010 18:03:41 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 62977 invoked by uid 99); 15 Jun 2010 18:03:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jun 2010 18:03:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jun 2010 18:03:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E258523888E4; Tue, 15 Jun 2010 18:02:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r954987 - in /cassandra/trunk/src/java/org/apache/cassandra: db/ColumnFamilyStore.java db/commitlog/CommitLogSegment.java utils/FBUtilities.java Date: Tue, 15 Jun 2010 18:02:50 -0000 To: commits@cassandra.apache.org From: jbellis@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100615180250.E258523888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jbellis Date: Tue Jun 15 18:02:50 2010 New Revision: 954987 URL: http://svn.apache.org/viewvc?rev=954987&view=rev Log: r/m unused code. patch by jbellis Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=954987&r1=954986&r2=954987&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Tue Jun 15 18:02:50 2010 @@ -1087,11 +1087,6 @@ public class ColumnFamilyStore implement ssTables_.getRowCache().clear(); } - public int getRowCacheSize() - { - return ssTables_.getRowCache().getCapacity(); - } - public int getKeyCacheSize() { return ssTables_.getKeyCache().getCapacity(); Modified: cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java?rev=954987&r1=954986&r2=954987&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java Tue Jun 15 18:02:50 2010 @@ -103,7 +103,6 @@ public class CommitLogSegment { currentPosition = logWriter.getFilePointer(); CommitLogSegment.CommitLogContext cLogCtx = new CommitLogSegment.CommitLogContext(currentPosition); - Table table = Table.open(rowMutation.getTable()); // update header for (ColumnFamily columnFamily : rowMutation.getColumnFamilies()) Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=954987&r1=954986&r2=954987&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Tue Jun 15 18:02:50 2010 @@ -18,7 +18,10 @@ package org.apache.cassandra.utils; -import java.io.*; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.File; +import java.io.IOException; import java.math.BigInteger; import java.net.InetAddress; import java.net.URL; @@ -26,27 +29,26 @@ import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.security.MessageDigest; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.zip.DataFormatException; -import java.util.zip.Deflater; -import java.util.zip.Inflater; -import org.apache.cassandra.config.ConfigurationException; -import org.apache.cassandra.locator.PropertyFileSnitch; +import org.apache.commons.collections.iterators.CollatingIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.commons.collections.iterators.CollatingIterator; - +import org.apache.cassandra.config.ConfigurationException; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.db.DecoratedKey; import org.apache.cassandra.db.IClock; import org.apache.cassandra.db.IClock.ClockRelationship; import org.apache.cassandra.dht.Range; import org.apache.cassandra.dht.Token; +import org.apache.cassandra.locator.PropertyFileSnitch; import org.apache.thrift.TBase; import org.apache.thrift.TDeserializer; import org.apache.thrift.TException; @@ -75,17 +77,6 @@ public class FBUtilities } } - public static String[] strip(String string, String token) - { - StringTokenizer st = new StringTokenizer(string, token); - List result = new ArrayList(); - while ( st.hasMoreTokens() ) - { - result.add( (String)st.nextElement() ); - } - return result.toArray( new String[0] ); - } - /** * Parses a string representing either a fraction, absolute value or percentage. */ @@ -251,7 +242,7 @@ public class FBUtilities public static byte[] hash(String type, byte[]... data) { - byte[] result = null; + byte[] result; try { MessageDigest messageDigest = MessageDigest.getInstance(type); @@ -266,49 +257,6 @@ public class FBUtilities return result; } - // The given byte array is compressed onto the specified stream. - // The method does not close the stream. The caller will have to do it. - public static void compressToStream(byte[] input, ByteArrayOutputStream bos) throws IOException - { - // Create the compressor with highest level of compression - Deflater compressor = new Deflater(); - compressor.setLevel(Deflater.BEST_COMPRESSION); - - // Give the compressor the data to compress - compressor.setInput(input); - compressor.finish(); - - // Write the compressed data to the stream - byte[] buf = new byte[1024]; - while (!compressor.finished()) - { - int count = compressor.deflate(buf); - bos.write(buf, 0, count); - } - } - - public static byte[] decompress(byte[] compressedData, int off, int len) throws IOException, DataFormatException - { - // Create the decompressor and give it the data to compress - Inflater decompressor = new Inflater(); - decompressor.setInput(compressedData, off, len); - - // Create an expandable byte array to hold the decompressed data - ByteArrayOutputStream bos = new ByteArrayOutputStream(compressedData.length); - - // Decompress the data - byte[] buf = new byte[1024]; - while (!decompressor.finished()) - { - int count = decompressor.inflate(buf); - bos.write(buf, 0, count); - } - bos.close(); - - // Get the decompressed data - return bos.toByteArray(); - } - public static void writeByteArray(byte[] bytes, DataOutput out) throws IOException { out.writeInt(bytes.length);