cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
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 GMT
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<String> result = new ArrayList<String>();
-        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);



Mime
View raw message