cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r987733 - in /cassandra/trunk: src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/filter/ src/java/org/apache/cassandra/db/migration/ src/java/org/apache/cassandra/utils/ test/unit/org/apache/cassandra/db/
Date Sat, 21 Aug 2010 11:55:31 GMT
Author: jbellis
Date: Sat Aug 21 11:55:30 2010
New Revision: 987733

URL: http://svn.apache.org/viewvc?rev=987733&view=rev
Log:
finish removing bitmasks from internals (see CASSANDRA-1312).  patch by jbellis

Removed:
    cassandra/trunk/src/java/org/apache/cassandra/utils/ByteArrayListSerializer.java
Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
    cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java
    cassandra/trunk/src/java/org/apache/cassandra/db/migration/Migration.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.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=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Sat Aug 21 11:55:30
2010
@@ -880,14 +880,9 @@ public class ColumnFamilyStore implement
         return writeStats.getRecentLatencyHistogramMicros();
     }
 
-    public ColumnFamily getColumnFamily(DecoratedKey key, QueryPath path, byte[] start, byte[]
finish, List<byte[]> bitmasks, boolean reversed, int limit)
-    {
-        return getColumnFamily(QueryFilter.getSliceFilter(key, path, start, finish, bitmasks,
reversed, limit));
-    }
-
     public ColumnFamily getColumnFamily(DecoratedKey key, QueryPath path, byte[] start, byte[]
finish, boolean reversed, int limit)
     {
-        return getColumnFamily(QueryFilter.getSliceFilter(key, path, start, finish, null,
reversed, limit));
+        return getColumnFamily(QueryFilter.getSliceFilter(key, path, start, finish, reversed,
limit));
     }
 
     /**
@@ -1214,7 +1209,6 @@ public class ColumnFamilyStore implement
                                                                  new QueryPath(indexCFS.getColumnFamilyName()),
                                                                  startKey,
                                                                  ArrayUtils.EMPTY_BYTE_ARRAY,
-                                                                 null,
                                                                  false,
                                                                  clause.count);
             ColumnFamily indexRow = indexCFS.getColumnFamily(indexFilter);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java Sat Aug 21 11:55:30
2010
@@ -65,7 +65,7 @@ public class ColumnSerializer implements
     {
         byte[] name = FBUtilities.readShortByteArray(dis);
         int b = dis.readUnsignedByte();
-        if (FBUtilities.testBitUsingBitMask(b, EXPIRATION_MASK))
+        if ((b & EXPIRATION_MASK) != 0)
         {
             int ttl = dis.readInt();
             int expiration = dis.readInt();
@@ -86,10 +86,10 @@ public class ColumnSerializer implements
         }
         else
         {
-            boolean delete = FBUtilities.testBitUsingBitMask(b, DELETION_MASK);
+            boolean delete = (b & DELETION_MASK) != 0;
             IClock clock = clockType.serializer().deserialize(dis);
             byte[] value = FBUtilities.readByteArray(dis);
-            if (FBUtilities.testBitUsingBitMask(b, DELETION_MASK)) {
+            if ((b & DELETION_MASK) != 0) {
                 return new DeletedColumn(name, value, clock);
             } else {
                 return new Column(name, value, clock);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Sat Aug 21
11:55:30 2010
@@ -25,7 +25,6 @@ import java.util.Collection;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeoutException;
 
-import org.apache.cassandra.db.IClock;
 import org.apache.commons.lang.ArrayUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -115,7 +114,7 @@ public class HintedHandOffManager
         byte[] startColumn = ArrayUtils.EMPTY_BYTE_ARRAY;
         while (true)
         {
-            QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(cfs.getColumnFamilyName()),
startColumn, ArrayUtils.EMPTY_BYTE_ARRAY, null, false, PAGE_SIZE);
+            QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(cfs.getColumnFamilyName()),
startColumn, ArrayUtils.EMPTY_BYTE_ARRAY, false, PAGE_SIZE);
             ColumnFamily cf = cfs.getColumnFamily(filter);
             if (pagingFinished(cf, startColumn))
                 break;
@@ -204,7 +203,7 @@ public class HintedHandOffManager
         delivery:
             while (true)
             {
-                QueryFilter filter = QueryFilter.getSliceFilter(epkey, new QueryPath(HINTS_CF),
startColumn, ArrayUtils.EMPTY_BYTE_ARRAY, null, false, PAGE_SIZE);
+                QueryFilter filter = QueryFilter.getSliceFilter(epkey, new QueryPath(HINTS_CF),
startColumn, ArrayUtils.EMPTY_BYTE_ARRAY, false, PAGE_SIZE);
                 ColumnFamily hintColumnFamily = ColumnFamilyStore.removeDeleted(hintStore.getColumnFamily(filter),
Integer.MAX_VALUE);
                 if (pagingFinished(hintColumnFamily, startColumn))
                     break;
@@ -260,7 +259,7 @@ public class HintedHandOffManager
         long now = System.currentTimeMillis();
         while (true)
         {
-            QueryFilter filter = QueryFilter.getSliceFilter(oldTableKey, new QueryPath(HINTS_CF),
startCol, ArrayUtils.EMPTY_BYTE_ARRAY, null, false, PAGE_SIZE);
+            QueryFilter filter = QueryFilter.getSliceFilter(oldTableKey, new QueryPath(HINTS_CF),
startCol, ArrayUtils.EMPTY_BYTE_ARRAY, false, PAGE_SIZE);
             ColumnFamily cf = ColumnFamilyStore.removeDeleted(hintStore.getColumnFamily(filter),
Integer.MAX_VALUE);
             if (pagingFinished(cf, startCol))
                 break;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java Sat Aug 21
11:55:30 2010
@@ -26,7 +26,6 @@ import org.apache.cassandra.db.filter.Qu
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.thrift.ColumnParent;
-import org.apache.cassandra.utils.ByteArrayListSerializer;
 import org.apache.cassandra.utils.FBUtilities;
 
 public class SliceFromReadCommand extends ReadCommand
@@ -34,32 +33,25 @@ public class SliceFromReadCommand extend
     public final byte[] start, finish;
     public final boolean reversed;
     public final int count;
-    public final List<byte[]> bitmasks;
 
     public SliceFromReadCommand(String table, byte[] key, ColumnParent column_parent, byte[]
start, byte[] finish, boolean reversed, int count)
     {
-        this(table, key, new QueryPath(column_parent), start, finish, null, reversed, count);
+        this(table, key, new QueryPath(column_parent), start, finish, reversed, count);
     }
 
     public SliceFromReadCommand(String table, byte[] key, QueryPath path, byte[] start, byte[]
finish, boolean reversed, int count)
     {
-        this(table, key, path, start, finish, null, reversed, count);
-    }
-
-    public SliceFromReadCommand(String table, byte[] key, QueryPath path, byte[] start, byte[]
finish, List<byte[]> bitmasks, boolean reversed, int count)
-    {
         super(table, key, path, CMD_TYPE_GET_SLICE);
         this.start = start;
         this.finish = finish;
         this.reversed = reversed;
         this.count = count;
-        this.bitmasks = bitmasks;
     }
 
     @Override
     public ReadCommand copy()
     {
-        ReadCommand readCommand = new SliceFromReadCommand(table, key, queryPath, start,
finish, bitmasks, reversed, count);
+        ReadCommand readCommand = new SliceFromReadCommand(table, key, queryPath, start,
finish, reversed, count);
         readCommand.setDigestQuery(isDigestQuery());
         return readCommand;
     }
@@ -68,45 +60,22 @@ public class SliceFromReadCommand extend
     public Row getRow(Table table) throws IOException
     {
         DecoratedKey dk = StorageService.getPartitioner().decorateKey(key);
-        return table.getRow(QueryFilter.getSliceFilter(dk, queryPath, start, finish, bitmasks,
reversed, count));
+        return table.getRow(QueryFilter.getSliceFilter(dk, queryPath, start, finish, reversed,
count));
     }
 
     @Override
     public String toString()
     {
-        String bitmaskString = getBitmaskDescription(bitmasks);
-
         return "SliceFromReadCommand(" +
                "table='" + table + '\'' +
                ", key='" + FBUtilities.bytesToHex(key) + '\'' +
                ", column_parent='" + queryPath + '\'' +
                ", start='" + getComparator().getString(start) + '\'' +
                ", finish='" + getComparator().getString(finish) + '\'' +
-               ", bitmasks=" + bitmaskString +
                ", reversed=" + reversed +
                ", count=" + count +
                ')';
     }
-
-    public static String getBitmaskDescription(List<byte[]> masks)
-    {
-        StringBuffer bitmaskBuf = new StringBuffer("[");
-
-        if (masks != null)
-        {
-            bitmaskBuf.append(masks.size()).append(" bitmasks: ");
-            for (byte[] bitmask: masks)
-            {
-                for (byte b: bitmask)
-                {
-                    bitmaskBuf.append(String.format("0x%02x ", b));
-                }
-                bitmaskBuf.append("; ");
-            }
-        }
-        bitmaskBuf.append("]");
-        return bitmaskBuf.toString();
-    }
 }
 
 class SliceFromReadCommandSerializer extends ReadCommandSerializer
@@ -121,7 +90,6 @@ class SliceFromReadCommandSerializer ext
         realRM.queryPath.serialize(dos);
         FBUtilities.writeShortByteArray(realRM.start, dos);
         FBUtilities.writeShortByteArray(realRM.finish, dos);
-        ByteArrayListSerializer.serialize(realRM.bitmasks, dos);
         dos.writeBoolean(realRM.reversed);
         dos.writeInt(realRM.count);
     }
@@ -135,8 +103,7 @@ class SliceFromReadCommandSerializer ext
                                                            QueryPath.deserialize(dis),
                                                            FBUtilities.readShortByteArray(dis),
                                                            FBUtilities.readShortByteArray(dis),
-                                                           ByteArrayListSerializer.deserialize(dis),
-                                                           dis.readBoolean(), 
+                                                           dis.readBoolean(),
                                                            dis.readInt());
         rm.setDigestQuery(isDigest);
         return rm;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java Sat Aug 21 11:55:30
2010
@@ -340,7 +340,7 @@ public class SystemTable
     public static ColumnFamily getDroppedCFs() throws IOException
     {
         ColumnFamilyStore cfs = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(SystemTable.STATUS_CF);
-        return cfs.getColumnFamily(QueryFilter.getSliceFilter(decorate(GRAVEYARD_KEY), new
QueryPath(STATUS_CF), "".getBytes(), "".getBytes(), null, false, 100));
+        return cfs.getColumnFamily(QueryFilter.getSliceFilter(decorate(GRAVEYARD_KEY), new
QueryPath(STATUS_CF), "".getBytes(), "".getBytes(), false, 100));
     }
     
     public static void deleteDroppedCfMarkers(Collection<IColumn> cols) throws IOException

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java Sat Aug 21 11:55:30
2010
@@ -152,16 +152,14 @@ public class QueryFilter
     }
 
     /**
-     * @return a QueryFilter object to satisfy the given slice criteria:
-     * @param key the row to slice
+     * @return a QueryFilter object to satisfy the given slice criteria:  @param key the
row to slice
      * @param path path to the level to slice at (CF or SuperColumn)
      * @param start column to start slice at, inclusive; empty for "the first column"
      * @param finish column to stop slice at, inclusive; empty for "the last column"
-     * @param bitmasks we should probably remove this
      * @param reversed true to start with the largest column (as determined by configured
sort order) instead of smallest
      * @param limit maximum number of non-deleted columns to return
      */
-    public static QueryFilter getSliceFilter(DecoratedKey key, QueryPath path, byte[] start,
byte[] finish, List<byte[]> bitmasks, boolean reversed, int limit)
+    public static QueryFilter getSliceFilter(DecoratedKey key, QueryPath path, byte[] start,
byte[] finish, boolean reversed, int limit)
     {
         return new QueryFilter(key, path, new SliceQueryFilter(start, finish, reversed, limit));
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/migration/Migration.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/migration/Migration.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/migration/Migration.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/migration/Migration.java Sat Aug 21 11:55:30
2010
@@ -318,7 +318,7 @@ public abstract class Migration
         DecoratedKey dkey = StorageService.getPartitioner().decorateKey(MIGRATIONS_KEY);
         Table defs = Table.open(Table.SYSTEM_TABLE);
         ColumnFamilyStore cfStore = defs.getColumnFamilyStore(Migration.MIGRATIONS_CF);
-        QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(MIGRATIONS_CF),
UUIDGen.decompose(start), UUIDGen.decompose(end), null, false, 1000);
+        QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(MIGRATIONS_CF),
UUIDGen.decompose(start), UUIDGen.decompose(end), false, 1000);
         ColumnFamily cf = cfStore.getColumnFamily(filter);
         return cf.getSortedColumns();
     }

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=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Sat Aug 21 11:55:30
2010
@@ -482,19 +482,6 @@ public class FBUtilities
         return Charsets.UTF_8.newDecoder().decode(ByteBuffer.wrap(bytes)).toString();
     }
 
-    /**
-     * Test if a particular bit is set using a bit mask.
-     *
-     * @param v the value in which a bit must be tested
-     * @param mask the bit mask use to select a bit of <code>v</code>
-     * @return true if the bit of <code>v</code> selected by <code>mask<code>
-     * is set, false otherwise.
-     */
-    public static boolean testBitUsingBitMask(int v, int mask)
-    {
-        return (v & mask) != 0;
-    }
-
     public static byte[] toByteArray(long n)
     {
         byte[] bytes = new byte[8];

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java Sat Aug 21
11:55:30 2010
@@ -33,7 +33,6 @@ import org.apache.cassandra.CleanupHelpe
 import org.apache.cassandra.Util;
 import org.apache.cassandra.db.columniterator.IdentityQueryFilter;
 import org.apache.cassandra.db.filter.*;
-import org.apache.cassandra.dht.AbstractBounds;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.thrift.IndexClause;
 import org.apache.cassandra.thrift.IndexExpression;
@@ -94,7 +93,7 @@ public class ColumnFamilyStoreTest exten
         {
             public void runMayThrow() throws IOException
             {
-                QueryFilter sliceFilter = QueryFilter.getSliceFilter(Util.dk("key1"), new
QueryPath("Standard2", null, null), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY,
null, false, 1);
+                QueryFilter sliceFilter = QueryFilter.getSliceFilter(Util.dk("key1"), new
QueryPath("Standard2", null, null), ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY,
false, 1);
                 ColumnFamily cf = store.getColumnFamily(sliceFilter);
                 assert cf.isMarkedForDelete();
                 assert cf.getColumnsMap().isEmpty();

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java Sat Aug 21 11:55:30 2010
@@ -253,7 +253,7 @@ public class DefsTest extends CleanupHel
         // do some reads.
         store = Table.open(oldCfm.tableName).getColumnFamilyStore(cfName);
         assert store != null;
-        ColumnFamily cfam = store.getColumnFamily(QueryFilter.getSliceFilter(dk, new QueryPath(cfName),
"".getBytes(), "".getBytes(), null, false, 1000));
+        ColumnFamily cfam = store.getColumnFamily(QueryFilter.getSliceFilter(dk, new QueryPath(cfName),
"".getBytes(), "".getBytes(), false, 1000));
         assert cfam.getSortedColumns().size() == 100; // should be good enough?
         
         // do some writes

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java Sat Aug 21 11:55:30
2010
@@ -51,38 +51,21 @@ public class ReadMessageTest extends Sch
         rm2 = serializeAndDeserializeReadMessage(rm);
         assert rm2.toString().equals(rm.toString());
 
-        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), ArrayUtils.EMPTY_BYTE_ARRAY,
ArrayUtils.EMPTY_BYTE_ARRAY, new ArrayList<byte[]>(0), true, 2);
+        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), ArrayUtils.EMPTY_BYTE_ARRAY,
ArrayUtils.EMPTY_BYTE_ARRAY, true, 2);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assert rm2.toString().equals(rm.toString());
         
-        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), "a".getBytes(),
"z".getBytes(), new ArrayList<byte[]>(0), true, 5);
+        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), "a".getBytes(),
"z".getBytes(), true, 5);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assertEquals(rm2.toString(), rm.toString());
 
-        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), ArrayUtils.EMPTY_BYTE_ARRAY,
ArrayUtils.EMPTY_BYTE_ARRAY, null, true, 2);
+        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), ArrayUtils.EMPTY_BYTE_ARRAY,
ArrayUtils.EMPTY_BYTE_ARRAY, true, 2);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assert rm2.toString().equals(rm.toString());
 
-        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), "a".getBytes(),
"z".getBytes(), null, true, 5);
+        rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"), "a".getBytes(),
"z".getBytes(), true, 5);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assertEquals(rm2.toString(), rm.toString());
-
-        for (String[] bitmaskTests: new String[][] { {}, {"test one", "test two" }, { new
String(new byte[] { 0, 1, 0x20, (byte) 0xff }) } })
-        {
-            ArrayList<byte[]> bitmasks = new ArrayList<byte[]>(bitmaskTests.length);
-            for (String bitmaskTest : bitmaskTests)
-            {
-                bitmasks.add(bitmaskTest.getBytes("UTF-8"));
-            }
-
-            rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"),
ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, bitmasks, true, 2);
-            rm2 = serializeAndDeserializeReadMessage(rm);
-            assert rm2.toString().equals(rm.toString());
-
-            rm = new SliceFromReadCommand("Keyspace1", dk.key, new QueryPath("Standard1"),
"a".getBytes(), "z".getBytes(), bitmasks, true, 5);
-            rm2 = serializeAndDeserializeReadMessage(rm);
-            assertEquals(rm2.toString(), rm.toString());
-        }
     }
 
     private ReadCommand serializeAndDeserializeReadMessage(ReadCommand rm) throws IOException

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java?rev=987733&r1=987732&r2=987733&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/TableTest.java Sat Aug 21 11:55:30 2010
@@ -22,12 +22,9 @@ import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.*;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.PredicateUtils;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.ArrayUtils;
 import org.junit.Test;
@@ -40,7 +37,6 @@ import static org.apache.cassandra.Util.
 import static org.apache.cassandra.Util.getBytes;
 import org.apache.cassandra.Util;
 import org.apache.cassandra.db.filter.QueryPath;
-import org.apache.cassandra.db.filter.SliceQueryFilter;
 import org.apache.cassandra.db.marshal.LongType;
 import org.apache.cassandra.io.sstable.IndexHelper;
 import org.apache.cassandra.io.sstable.SSTableReader;
@@ -81,7 +77,7 @@ public class TableTest extends CleanupHe
                 cf = cfStore.getColumnFamily(QueryFilter.getNamesFilter(TEST_KEY, new QueryPath("Standard3"),
new TreeSet<byte[]>()));
                 assertColumns(cf);
 
-                cf = cfStore.getColumnFamily(QueryFilter.getSliceFilter(TEST_KEY, new QueryPath("Standard3"),
ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, null, false, 0));
+                cf = cfStore.getColumnFamily(QueryFilter.getSliceFilter(TEST_KEY, new QueryPath("Standard3"),
ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, false, 0));
                 assertColumns(cf);
 
                 cf = cfStore.getColumnFamily(QueryFilter.getNamesFilter(TEST_KEY, new QueryPath("Standard3"),
"col99".getBytes()));
@@ -473,12 +469,10 @@ public class TableTest extends CleanupHe
         }
 
         assert Arrays.equals(la, columnNames1)
-                : String.format("Columns [%s(as string: %s)])] is not expected [%s] (bitmasks
%s)",
+                : String.format("Columns [%s(as string: %s)])] is not expected [%s]",
                                 ((cf == null) ? "" : cf.getComparator().getColumnsString(columns)),
                                 lasb.toString(),
-                                StringUtils.join(columnNames1, ","),
-                                SliceFromReadCommand.getBitmaskDescription(null));
-
+                                StringUtils.join(columnNames1, ","));
     }
 
 }



Mime
View raw message