cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r794429 [4/5] - in /incubator/cassandra/trunk: ./ interface/ interface/gen-java/org/apache/cassandra/service/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/cql/common/ src/java/org/ap...
Date Wed, 15 Jul 2009 22:04:45 GMT
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java Wed Jul 15 22:04:43 2009
@@ -38,6 +38,7 @@
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.io.ICompactSerializer;
+import org.apache.cassandra.db.filter.QueryPath;
 
 /**
  * Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )
@@ -109,8 +110,6 @@
         return new ColumnFamily(cfName, columnType, comparator);
     }
 
-    private transient AbstractColumnFactory columnFactory_;
-
     private String name_;
 
     private transient ICompactSerializer<IColumn> columnSerializer_;
@@ -123,8 +122,7 @@
     {
         name_ = cfName;
         type_ = columnType;
-        columnFactory_ = AbstractColumnFactory.getColumnFactory(columnType);
-        columnSerializer_ = columnFactory_.createColumnSerializer();
+        columnSerializer_ = columnType.equals("Standard") ? Column.serializer() : SuperColumn.serializer();
         if(columns_ == null)
             columns_ = new EfficientBidiMap(comparator);
     }
@@ -171,11 +169,6 @@
     	return columnSerializer_;
     }
 
-    public void addColumn(String name)
-    {
-    	addColumn(columnFactory_.createColumn(name));
-    }
-
     int getColumnCount()
     {
     	int count = 0;
@@ -203,19 +196,25 @@
         return type_.equals("Super");
     }
 
-    public void addColumn(String name, byte[] value)
-    {
-    	addColumn(name, value, 0);
-    }
-
-    public void addColumn(String name, byte[] value, long timestamp)
+    public void addColumn(QueryPath path, byte[] value, long timestamp)
     {
-        addColumn(name, value, timestamp, false);
+        addColumn(path, value, timestamp, false);
     }
 
-    public void addColumn(String name, byte[] value, long timestamp, boolean deleted)
+    /** In most places the CF must be part of a QueryPath but here it is ignored. */
+    public void addColumn(QueryPath path, byte[] value, long timestamp, boolean deleted)
 	{
-		IColumn column = columnFactory_.createColumn(name, value, timestamp, deleted);
+        assert path.columnName != null : path;
+		IColumn column;
+        if (path.superColumnName == null)
+        {
+            column = new Column(path.columnName, value, timestamp, deleted);
+        }
+        else
+        {
+            column = new SuperColumn(path.superColumnName);
+            column.addColumn(new Column(path.columnName, value, timestamp, deleted));
+        }
 		addColumn(column);
     }
 
@@ -296,10 +295,6 @@
         return markedForDeleteAt > Long.MIN_VALUE;
     }
 
-    public String getTable() {
-        return table_;
-    }
-
     /*
      * This function will calculate the difference between 2 column families.
      * The external input is assumed to be a superset of internal.

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Wed Jul 15 22:04:43 2009
@@ -39,9 +39,7 @@
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.*;
 import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor;
-import org.apache.cassandra.db.filter.QueryFilter;
-import org.apache.cassandra.db.filter.ColumnIterator;
-import org.apache.cassandra.db.filter.NamesQueryFilter;
+import org.apache.cassandra.db.filter.*;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.collections.IteratorUtils;
@@ -1422,7 +1420,17 @@
     public double getWriteLatency() {
         return writeStats_.mean();
     }
-    
+
+    public ColumnFamily getColumnFamily(String key, QueryPath path, String start, String finish, boolean isAscending, int offset, int limit) throws IOException
+    {
+        return getColumnFamily(new SliceQueryFilter(key, path, start, finish, isAscending, offset, limit));
+    }
+
+    public ColumnFamily getColumnFamily(String key, QueryPath columnParent, long since) throws IOException
+    {
+        return getColumnFamily(new TimeQueryFilter(key, columnParent, since));    
+    }
+
     /**
      * get a list of columns starting from a given column, in a specified order.
      * only the latest version of a column is returned.
@@ -1430,12 +1438,10 @@
      */
     public ColumnFamily getColumnFamily(QueryFilter filter) throws IOException
     {
-        String[] values = RowMutation.getColumnAndColumnFamily(filter.columnFamilyColumn);
-
         // if we are querying subcolumns of a supercolumn, fetch the supercolumn with NQF, then filter in-memory.
-        if (values.length > 1)
+        if (filter.path.superColumnName != null)
         {
-            QueryFilter nameFilter = new NamesQueryFilter(filter.key, values[0], values[1]);
+            QueryFilter nameFilter = new NamesQueryFilter(filter.key, new QueryPath(filter.path.columnFamilyName), filter.path.superColumnName);
             ColumnFamily cf = getColumnFamily(nameFilter);
             if (cf != null)
             {

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnsSinceReadCommand.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnsSinceReadCommand.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnsSinceReadCommand.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnsSinceReadCommand.java Wed Jul 15 22:04:43 2009
@@ -21,28 +21,38 @@
 import java.io.DataOutputStream;
 import java.io.IOException;
 
+import org.apache.cassandra.service.ColumnParent;
+import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.db.filter.QueryFilter;
+import org.apache.cassandra.db.filter.TimeQueryFilter;
+
 public class ColumnsSinceReadCommand extends ReadCommand
 {
-    public final String columnFamily;
+    public final QueryPath columnParent;
     public final long sinceTimestamp;
 
-    public ColumnsSinceReadCommand(String table, String key, String columnFamily, long sinceTimestamp)
+    public ColumnsSinceReadCommand(String table, String key, ColumnParent column_parent, long sinceTimestamp)
+    {
+        this(table, key, new QueryPath(column_parent), sinceTimestamp);
+    }
+
+    public ColumnsSinceReadCommand(String table, String key, QueryPath columnParent, long sinceTimestamp)
     {
         super(table, key, CMD_TYPE_GET_COLUMNS_SINCE);
-        this.columnFamily = columnFamily;
+        this.columnParent = columnParent;
         this.sinceTimestamp = sinceTimestamp;
     }
 
     @Override
     public String getColumnFamilyName()
     {
-        return RowMutation.getColumnAndColumnFamily(columnFamily)[0];
+        return columnParent.columnFamilyName;
     }
 
     @Override
     public ReadCommand copy()
     {
-        ReadCommand readCommand= new ColumnsSinceReadCommand(table, key, columnFamily, sinceTimestamp);
+        ReadCommand readCommand = new ColumnsSinceReadCommand(table, key, columnParent, sinceTimestamp);
         readCommand.setDigestQuery(isDigestQuery());
         return readCommand;
     }
@@ -50,7 +60,7 @@
     @Override
     public Row getRow(Table table) throws IOException
     {        
-        return table.getRow(key, columnFamily, sinceTimestamp);
+        return table.getRow(new TimeQueryFilter(key, columnParent, sinceTimestamp));
     }
 
     @Override
@@ -59,11 +69,10 @@
         return "ColumnsSinceReadCommand(" +
                "table='" + table + '\'' +
                ", key='" + key + '\'' +
-               ", columnFamily='" + columnFamily + '\'' +
+               ", columnParent='" + columnParent + '\'' +
                ", sinceTimestamp='" + sinceTimestamp + '\'' +
                ')';
     }
-
 }
 
 class ColumnsSinceReadCommandSerializer extends ReadCommandSerializer
@@ -75,7 +84,7 @@
         dos.writeBoolean(realRM.isDigestQuery());
         dos.writeUTF(realRM.table);
         dos.writeUTF(realRM.key);
-        dos.writeUTF(realRM.columnFamily);
+        realRM.columnParent.serialize(dos);
         dos.writeLong(realRM.sinceTimestamp);
     }
 
@@ -85,10 +94,10 @@
         boolean isDigest = dis.readBoolean();
         String table = dis.readUTF();
         String key = dis.readUTF();
-        String columnFamily = dis.readUTF();
+        QueryPath columnParent = QueryPath.deserialize(dis);
         long sinceTimestamp = dis.readLong();
 
-        ColumnsSinceReadCommand rm = new ColumnsSinceReadCommand(table, key, columnFamily, sinceTimestamp);
+        ColumnsSinceReadCommand rm = new ColumnsSinceReadCommand(table, key, columnParent, sinceTimestamp);
         rm.setDigestQuery(isDigest);
         return rm;
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Wed Jul 15 22:04:43 2009
@@ -38,6 +38,7 @@
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.service.*;
 import org.apache.cassandra.db.filter.IdentityQueryFilter;
+import org.apache.cassandra.db.filter.QueryPath;
 
 
 /**
@@ -103,7 +104,7 @@
     private static void deleteEndPoint(String endpointAddress, String tableName, String key, long timestamp) throws IOException
     {
         RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, tableName);
-        rm.delete(HINTS_CF + ":" + key + ":" + endpointAddress, timestamp);
+        rm.delete(new QueryPath(HINTS_CF, key, endpointAddress), timestamp);
         rm.apply();
     }
 
@@ -140,7 +141,7 @@
                         maxTS = Math.max(maxTS, subCol.timestamp());
                 }
             }
-            rm.delete(cf.name(), maxTS);
+            rm.delete(new QueryPath(cf.name()), maxTS);
         }
         rm.apply();
     }
@@ -160,7 +161,7 @@
         // 7. I guess we are done
         for (String tableName : DatabaseDescriptor.getTables())
         {
-            ColumnFamily hintColumnFamily = ColumnFamilyStore.removeDeleted(hintStore.getColumnFamily(new IdentityQueryFilter(tableName, HINTS_CF)), Integer.MAX_VALUE);
+            ColumnFamily hintColumnFamily = ColumnFamilyStore.removeDeleted(hintStore.getColumnFamily(new IdentityQueryFilter(tableName, new QueryPath(HINTS_CF))), Integer.MAX_VALUE);
             if (hintColumnFamily == null)
             {
                 continue;

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ReadCommand.java Wed Jul 15 22:04:43 2009
@@ -33,10 +33,9 @@
 public abstract class ReadCommand
 {
     public static final String DO_REPAIR = "READ-REPAIR";
-    public static final byte CMD_TYPE_GET_COLUMN=1;
-    public static final byte CMD_TYPE_GET_SLICE_BY_NAMES=2;
-    public static final byte CMD_TYPE_GET_COLUMNS_SINCE=3;
-    public static final byte CMD_TYPE_GET_SLICE =4;
+    public static final byte CMD_TYPE_GET_SLICE_BY_NAMES = 1;
+    public static final byte CMD_TYPE_GET_COLUMNS_SINCE = 2;
+    public static final byte CMD_TYPE_GET_SLICE = 3;
 
     public static final String EMPTY_CF = "";
     
@@ -89,7 +88,6 @@
     private static final Map<Byte, ReadCommandSerializer> CMD_SERIALIZER_MAP = new HashMap<Byte, ReadCommandSerializer>(); 
     static 
     {
-        CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_COLUMN, new ColumnReadCommandSerializer());
         CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_SLICE_BY_NAMES, new SliceByNamesReadCommandSerializer());
         CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_COLUMNS_SINCE, new ColumnsSinceReadCommandSerializer());
         CMD_SERIALIZER_MAP.put(ReadCommand.CMD_TYPE_GET_SLICE, new SliceFromReadCommandSerializer());

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Wed Jul 15 22:04:43 2009
@@ -38,11 +38,10 @@
 import org.apache.cassandra.net.EndPoint;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.service.batch_mutation_super_t;
-import org.apache.cassandra.service.batch_mutation_t;
-import org.apache.cassandra.service.column_t;
-import org.apache.cassandra.service.superColumn_t;
+import org.apache.cassandra.service.BatchMutationSuper;
+import org.apache.cassandra.service.BatchMutation;
 import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.db.filter.QueryPath;
 
 
 /**
@@ -120,8 +119,8 @@
 
     void addHints(String hint) throws IOException
     {
-        String cfName = HintedHandOffManager.HINTS_CF + ":" + hint;
-        add(cfName, ArrayUtils.EMPTY_BYTE_ARRAY, System.currentTimeMillis());
+        QueryPath path = new QueryPath(HintedHandOffManager.HINTS_CF, null, hint);
+        add(path, ArrayUtils.EMPTY_BYTE_ARRAY, System.currentTimeMillis());
     }
 
     /*
@@ -151,76 +150,50 @@
      * param @ value - value associated with the column
      * param @ timestamp - timestamp associated with this data.
     */
-    public void add(String cf, byte[] value, long timestamp)
+    public void add(QueryPath path, byte[] value, long timestamp)
     {
-        String[] values = RowMutation.getColumnAndColumnFamily(cf);
-
-        if ( values.length == 0 || values.length == 1 || values.length > 3 )
-            throw new IllegalArgumentException("Column Family " + cf + " in invalid format. Must be in <column family>:<column> format.");
-
-        ColumnFamily columnFamily = modifications_.get(values[0]);
-        if( values.length == 2 )
+        ColumnFamily columnFamily = modifications_.get(path.columnFamilyName);
+        if (columnFamily == null)
         {
-            if ( columnFamily == null )
-            {
-            	columnFamily = ColumnFamily.create(table_, values[0]);
-            }
-        	columnFamily.addColumn(values[1], value, timestamp);
+            columnFamily = ColumnFamily.create(table_, path.columnFamilyName);
         }
-        if( values.length == 3 )
-        {
-            if ( columnFamily == null )
-            {
-            	columnFamily = ColumnFamily.create(table_, values[0]);
-            }
-        	columnFamily.addColumn(values[1]+ ":" + values[2], value, timestamp);
-        }
-        modifications_.put(values[0], columnFamily);
+        columnFamily.addColumn(path, value, timestamp);
+        modifications_.put(path.columnFamilyName, columnFamily);
     }
 
-    public void delete(String columnFamilyColumn, long timestamp)
+    public void delete(QueryPath path, long timestamp)
     {
-        String[] values = RowMutation.getColumnAndColumnFamily(columnFamilyColumn);
-        String cfName = values[0];
+        assert path.columnFamilyName != null;
+        String cfName = path.columnFamilyName;
 
         if (modifications_.containsKey(cfName))
         {
             throw new IllegalArgumentException("ColumnFamily " + cfName + " is already being modified");
         }
-        if (values.length == 0 || values.length > 3)
-            throw new IllegalArgumentException("Column Family " + columnFamilyColumn + " in invalid format. Must be in <column family>:<column> format.");
 
         int localDeleteTime = (int) (System.currentTimeMillis() / 1000);
 
         ColumnFamily columnFamily = modifications_.get(cfName);
         if (columnFamily == null)
             columnFamily = ColumnFamily.create(table_, cfName);
-        if (values.length == 2)
+
+        if (path.superColumnName == null && path.columnName == null)
         {
-            if (columnFamily.isSuper())
-            {
-                SuperColumn sc = new SuperColumn(values[1]);
-                sc.markForDeleteAt(localDeleteTime, timestamp);
-                columnFamily.addColumn(sc);
-            }
-            else
-            {
-                ByteBuffer bytes = ByteBuffer.allocate(4);
-                bytes.putInt(localDeleteTime);
-                columnFamily.addColumn(values[1], bytes.array(), timestamp, true);
-            }
+            columnFamily.delete(localDeleteTime, timestamp);
         }
-        else if (values.length == 3)
+        else if (path.columnName == null)
         {
-            ByteBuffer bytes = ByteBuffer.allocate(4);
-            bytes.putInt(localDeleteTime);
-            columnFamily.addColumn(values[1] + ":" + values[2], bytes.array(), timestamp, true);
+            SuperColumn sc = new SuperColumn(path.superColumnName);
+            sc.markForDeleteAt(localDeleteTime, timestamp);
+            columnFamily.addColumn(sc);
         }
         else
         {
-            assert values.length == 1;
-            columnFamily.delete(localDeleteTime, timestamp);
+            ByteBuffer bytes = ByteBuffer.allocate(4);
+            bytes.putInt(localDeleteTime);
+            columnFamily.addColumn(path, bytes.array(), timestamp, true);
         }
+
         modifications_.put(cfName, columnFamily);
     }
 
@@ -281,46 +254,30 @@
         return new Message(from, StorageService.mutationStage_, verbHandlerName, bos.toByteArray());
     }
 
-    public static RowMutation getRowMutation(batch_mutation_t batchMutation)
+    public static RowMutation getRowMutation(String table, BatchMutation batchMutation)
     {
-        RowMutation rm = new RowMutation(batchMutation.table,
-                                         batchMutation.key.trim());
+        RowMutation rm = new RowMutation(table, batchMutation.key.trim());
         for (String cfname : batchMutation.cfmap.keySet())
         {
-            List<column_t> list = batchMutation.cfmap.get(cfname);
-            for (column_t columnData : list)
+            List<org.apache.cassandra.service.Column> list = batchMutation.cfmap.get(cfname);
+            for (org.apache.cassandra.service.Column columnData : list)
             {
-                rm.add(cfname + ":" + columnData.columnName,
-                       columnData.value, columnData.timestamp);
-
+                rm.add(new QueryPath(cfname, null, columnData.column_name), columnData.value, columnData.timestamp);
             }
         }
         return rm;
     }
 
-    public static RowMutation getRowMutation(batch_mutation_super_t batchMutationSuper)
+    public static RowMutation getRowMutation(String table, BatchMutationSuper batchMutationSuper)
     {
-        RowMutation rm = new RowMutation(batchMutationSuper.table,
-                                         batchMutationSuper.key.trim());
-        Set keys = batchMutationSuper.cfmap.keySet();
-        Iterator keyIter = keys.iterator();
-        while (keyIter.hasNext())
-        {
-            Object key = keyIter.next(); // Get the next key.
-            List<superColumn_t> list = batchMutationSuper.cfmap.get(key);
-            for (superColumn_t superColumnData : list)
+        RowMutation rm = new RowMutation(table, batchMutationSuper.key.trim());
+        for (String cfName : batchMutationSuper.cfmap.keySet())
+        {
+            for (org.apache.cassandra.service.SuperColumn super_column : batchMutationSuper.cfmap.get(cfName))
             {
-                if (superColumnData.columns.size() != 0)
-                {
-                    for (column_t columnData : superColumnData.columns)
-                    {
-                        rm.add(key.toString() + ":" + superColumnData.name + ":" + columnData.columnName,
-                               columnData.value, columnData.timestamp);
-                    }
-                }
-                else
+                for (org.apache.cassandra.service.Column column : super_column.columns)
                 {
-                    rm.add(key.toString() + ":" + superColumnData.name, ArrayUtils.EMPTY_BYTE_ARRAY, 0);
+                    rm.add(new QueryPath(cfName, super_column.name, column.column_name), column.value, column.timestamp);
                 }
             }
         }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceByNamesReadCommand.java Wed Jul 15 22:04:43 2009
@@ -24,28 +24,37 @@
 
 import org.apache.commons.lang.StringUtils;
 
+import org.apache.cassandra.service.ColumnParent;
+import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.db.filter.NamesQueryFilter;
+
 public class SliceByNamesReadCommand extends ReadCommand
 {
-    public final String columnFamily;
+    public final QueryPath columnParent;
     public final SortedSet<String> columnNames;
 
-    public SliceByNamesReadCommand(String table, String key, String columnFamily, Collection<String> columnNames)
+    public SliceByNamesReadCommand(String table, String key, ColumnParent column_parent, Collection<String> columnNames)
+    {
+        this(table, key, new QueryPath(column_parent), columnNames);
+    }
+
+    public SliceByNamesReadCommand(String table, String key, QueryPath path, Collection<String> columnNames)
     {
         super(table, key, CMD_TYPE_GET_SLICE_BY_NAMES);
-        this.columnFamily = columnFamily;
+        this.columnParent = path;
         this.columnNames = new TreeSet<String>(columnNames);
     }
 
     @Override
     public String getColumnFamilyName()
     {
-        return RowMutation.getColumnAndColumnFamily(columnFamily)[0];
+        return columnParent.columnFamilyName;
     }
 
     @Override
     public ReadCommand copy()
     {
-        ReadCommand readCommand= new SliceByNamesReadCommand(table, key, columnFamily, columnNames);
+        ReadCommand readCommand= new SliceByNamesReadCommand(table, key, columnParent, columnNames);
         readCommand.setDigestQuery(isDigestQuery());
         return readCommand;
     }
@@ -53,7 +62,7 @@
     @Override
     public Row getRow(Table table) throws IOException
     {        
-        return table.getRow(key, columnFamily, columnNames);
+        return table.getRow(new NamesQueryFilter(key, columnParent, columnNames));
     }
 
     @Override
@@ -62,7 +71,7 @@
         return "SliceByNamesReadCommand(" +
                "table='" + table + '\'' +
                ", key='" + key + '\'' +
-               ", columnFamily='" + columnFamily + '\'' +
+               ", columnParent='" + columnParent + '\'' +
                ", columns=[" + StringUtils.join(columnNames, ", ") + "]" +
                ')';
     }
@@ -78,7 +87,7 @@
         dos.writeBoolean(realRM.isDigestQuery());
         dos.writeUTF(realRM.table);
         dos.writeUTF(realRM.key);
-        dos.writeUTF(realRM.columnFamily);
+        realRM.columnParent.serialize(dos);
         dos.writeInt(realRM.columnNames.size());
         if (realRM.columnNames.size() > 0)
         {
@@ -96,7 +105,7 @@
         boolean isDigest = dis.readBoolean();
         String table = dis.readUTF();
         String key = dis.readUTF();
-        String columnFamily = dis.readUTF();
+        QueryPath columnParent = QueryPath.deserialize(dis);
 
         int size = dis.readInt();
         List<String> columns = new ArrayList<String>();
@@ -106,7 +115,7 @@
             dis.readFully(bytes);
             columns.add(new String(bytes));
         }
-        SliceByNamesReadCommand rm = new SliceByNamesReadCommand(table, key, columnFamily, columns);
+        SliceByNamesReadCommand rm = new SliceByNamesReadCommand(table, key, columnParent, columns);
         rm.setDigestQuery(isDigest);
         return rm;
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SliceFromReadCommand.java Wed Jul 15 22:04:43 2009
@@ -21,18 +21,27 @@
 import java.io.DataOutputStream;
 import java.io.IOException;
 
+import org.apache.cassandra.db.filter.QueryPath;
+import org.apache.cassandra.db.filter.SliceQueryFilter;
+import org.apache.cassandra.service.ColumnParent;
+
 public class SliceFromReadCommand extends ReadCommand
 {
-    public final String columnFamilyColumn;
+    public final QueryPath column_parent;
     public final String start, finish;
     public final boolean isAscending;
     public final int offset;
     public final int count;
 
-    public SliceFromReadCommand(String table, String key, String columnFamilyColumn, String start, String finish, boolean isAscending, int offset, int count)
+    public SliceFromReadCommand(String table, String key, ColumnParent column_parent, String start, String finish, boolean isAscending, int offset, int count)
+    {
+        this(table, key, new QueryPath(column_parent), start, finish, isAscending, offset, count);
+    }
+
+    public SliceFromReadCommand(String table, String key, QueryPath columnParent, String start, String finish, boolean isAscending, int offset, int count)
     {
         super(table, key, CMD_TYPE_GET_SLICE);
-        this.columnFamilyColumn = columnFamilyColumn;
+        this.column_parent = columnParent;
         this.start = start;
         this.finish = finish;
         this.isAscending = isAscending;
@@ -43,13 +52,13 @@
     @Override
     public String getColumnFamilyName()
     {
-        return RowMutation.getColumnAndColumnFamily(columnFamilyColumn)[0];
+        return column_parent.columnFamilyName;
     }
 
     @Override
     public ReadCommand copy()
     {
-        ReadCommand readCommand = new SliceFromReadCommand(table, key, columnFamilyColumn, start, finish, isAscending, offset, count);
+        ReadCommand readCommand = new SliceFromReadCommand(table, key, column_parent, start, finish, isAscending, offset, count);
         readCommand.setDigestQuery(isDigestQuery());
         return readCommand;
     }
@@ -57,7 +66,7 @@
     @Override
     public Row getRow(Table table) throws IOException
     {
-        return table.getRow(key, columnFamilyColumn, start, finish, isAscending, offset, count);
+        return table.getRow(new SliceQueryFilter(key, column_parent, start, finish, isAscending, offset, count));
     }
 
     @Override
@@ -66,7 +75,7 @@
         return "SliceFromReadCommand(" +
                "table='" + table + '\'' +
                ", key='" + key + '\'' +
-               ", columnFamily='" + columnFamilyColumn + '\'' +
+               ", column_parent='" + column_parent + '\'' +
                ", start='" + start + '\'' +
                ", finish='" + finish + '\'' +
                ", isAscending=" + isAscending +
@@ -85,7 +94,7 @@
         dos.writeBoolean(realRM.isDigestQuery());
         dos.writeUTF(realRM.table);
         dos.writeUTF(realRM.key);
-        dos.writeUTF(realRM.columnFamilyColumn);
+        realRM.column_parent.serialize(dos);
         dos.writeUTF(realRM.start);
         dos.writeUTF(realRM.finish);
         dos.writeBoolean(realRM.isAscending);
@@ -97,7 +106,7 @@
     public ReadCommand deserialize(DataInputStream dis) throws IOException
     {
         boolean isDigest = dis.readBoolean();
-        SliceFromReadCommand rm = new SliceFromReadCommand(dis.readUTF(), dis.readUTF(), dis.readUTF(), dis.readUTF(), dis.readUTF(), dis.readBoolean(), dis.readInt(), dis.readInt());
+        SliceFromReadCommand rm = new SliceFromReadCommand(dis.readUTF(), dis.readUTF(), QueryPath.deserialize(dis), dis.readUTF(), dis.readUTF(), dis.readBoolean(), dis.readInt(), dis.readInt());
         rm.setDigestQuery(isDigest);
         return rm;
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/SystemTable.java Wed Jul 15 22:04:43 2009
@@ -28,6 +28,7 @@
 import org.apache.cassandra.utils.BasicUtilities;
 import org.apache.cassandra.db.filter.IdentityQueryFilter;
 import org.apache.cassandra.db.filter.NamesQueryFilter;
+import org.apache.cassandra.db.filter.QueryPath;
 
 /**
  * Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )
@@ -49,7 +50,7 @@
         IPartitioner p = StorageService.getPartitioner();
         Table table = Table.open(Table.SYSTEM_TABLE);
         /* Retrieve the "LocationInfo" column family */
-        ColumnFamily cf = table.getColumnFamilyStore(LOCATION_CF).getColumnFamily(new NamesQueryFilter(LOCATION_KEY, LOCATION_KEY, TOKEN));
+        ColumnFamily cf = table.getColumnFamilyStore(LOCATION_CF).getColumnFamily(new NamesQueryFilter(LOCATION_KEY, new QueryPath(LOCATION_KEY), TOKEN));
         long oldTokenColumnTimestamp = cf.getColumn(SystemTable.TOKEN).timestamp();
         /* create the "Token" whose value is the new token. */
         IColumn tokenColumn = new Column(SystemTable.TOKEN, p.getTokenFactory().toByteArray(token), oldTokenColumnTimestamp + 1);
@@ -73,7 +74,7 @@
     {
         /* Read the system table to retrieve the storage ID and the generation */
         Table table = Table.open(Table.SYSTEM_TABLE);
-        ColumnFamily cf = table.getColumnFamilyStore(LOCATION_CF).getColumnFamily(new NamesQueryFilter(LOCATION_KEY, LOCATION_KEY, GENERATION));
+        ColumnFamily cf = table.getColumnFamilyStore(LOCATION_CF).getColumnFamily(new NamesQueryFilter(LOCATION_KEY, new QueryPath(LOCATION_KEY), GENERATION));
 
         IPartitioner p = StorageService.getPartitioner();
         if (cf == null)

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Wed Jul 15 22:04:43 2009
@@ -523,12 +523,13 @@
         String[] values = RowMutation.getColumnAndColumnFamily(cfName);
         ColumnFamilyStore cfStore = columnFamilyStores_.get(values[0]);
         assert cfStore != null : "Column family " + cfName + " has not been defined";
-        return cfStore.getColumnFamily(new IdentityQueryFilter(key, cfName));
+        return cfStore.getColumnFamily(new IdentityQueryFilter(key, new QueryPath(cfName)));
     }
 
     /**
      * Selects only the specified column family for the specified key.
     */
+    @Deprecated
     public Row getRow(String key, String cfName) throws IOException
     {
         Row row = new Row(table_, key);
@@ -538,40 +539,10 @@
         return row;
     }
     
-    public Row getRow(String key, String columnFamilyColumn, long sinceTimeStamp) throws IOException
-    {
-        QueryFilter filter = new TimeQueryFilter(key, columnFamilyColumn, sinceTimeStamp);
-        return getRow(key, filter);
-    }
-
-    /**
-     * This method returns the specified columns for the specified
-     * column family.
-     * 
-     *  param @ key - key for which data is requested.
-     *  param @ cf - column family we are interested in.
-     *  param @ columns - columns that are part of the above column family.
-    */
-    public Row getRow(String key, String columnFamilyColumn, SortedSet<String> columns) throws IOException
-    {
-        // TODO for large CFs we will want a specialized iterator
-        QueryFilter filter = new NamesQueryFilter(key, columnFamilyColumn, columns);
-        return getRow(key, filter);
-    }
-
-    /**
-     * Selects a list of columns in a column family from a given column for the specified key.
-    */
-    public Row getRow(String key, String cfName, String start, String finish, boolean isAscending, int offset, int count) throws IOException
-    {
-        QueryFilter filter = new SliceQueryFilter(key, cfName, start, finish, isAscending, offset, count);
-        return getRow(key, filter);
-    }
-
-    public Row getRow(String key, QueryFilter filter) throws IOException
+    public Row getRow(QueryFilter filter) throws IOException
     {
         ColumnFamilyStore cfStore = columnFamilyStores_.get(filter.getColumnFamilyName());
-        Row row = new Row(table_, key);
+        Row row = new Row(table_, filter.key);
         ColumnFamily columnFamily = cfStore.getColumnFamily(filter);
         if (columnFamily != null)
             row.addColumnFamily(columnFamily);
@@ -675,7 +646,7 @@
         }
     }
 
-    private List<String> getKeyRangeUnsafe(final String columnFamily, final String startWith, final String stopAt, int maxResults) throws IOException, ExecutionException, InterruptedException
+    private List<String> getKeyRangeUnsafe(final String cfName, final String startWith, final String stopAt, int maxResults) throws IOException, ExecutionException, InterruptedException
     {
         // (OPP key decoration is a no-op so using the "decorated" comparator against raw keys is fine)
         final Comparator<String> comparator = StorageService.getPartitioner().getDecoratedKeyComparator();
@@ -683,7 +654,7 @@
         // create a CollatedIterator that will return unique keys from different sources
         // (current memtable, historical memtables, and SSTables) in the correct order.
         List<Iterator<String>> iterators = new ArrayList<Iterator<String>>();
-        ColumnFamilyStore cfs = getColumnFamilyStore(columnFamily);
+        ColumnFamilyStore cfs = getColumnFamilyStore(cfName);
 
         // we iterate through memtables with a priority queue to avoid more sorting than necessary.
         // this predicate throws out the keys before the start of our range.
@@ -699,7 +670,7 @@
         // current memtable keys.  have to go through the CFS api for locking.
         iterators.add(IteratorUtils.filteredIterator(cfs.memtableKeyIterator(), p));
         // historical memtables
-        for (Memtable memtable : ColumnFamilyStore.getUnflushedMemtables(columnFamily))
+        for (Memtable memtable : ColumnFamilyStore.getUnflushedMemtables(cfName))
         {
             iterators.add(IteratorUtils.filteredIterator(Memtable.getKeyIterator(memtable.getKeys()), p));
         }
@@ -740,7 +711,7 @@
                 }
                 // make sure there is actually non-tombstone content associated w/ this key
                 // TODO record the key source(s) somehow and only check that source (e.g., memtable or sstable)
-                if (cfs.getColumnFamily(new SliceQueryFilter(current, columnFamily, "", "", true, 0, 1)) != null)
+                if (cfs.getColumnFamily(new SliceQueryFilter(current, new QueryPath(cfName), "", "", true, 0, 1)) != null)
                 {
                     keys.add(current);
                 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/IdentityQueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/IdentityQueryFilter.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/IdentityQueryFilter.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/IdentityQueryFilter.java Wed Jul 15 22:04:43 2009
@@ -7,9 +7,9 @@
     /**
      * Only for use in testing; will read entire CF into memory.
      */
-    public IdentityQueryFilter(String key, String columnFamilyColumn)
+    public IdentityQueryFilter(String key, QueryPath path)
     {
-        super(key, columnFamilyColumn, "", "", true, 0, Integer.MAX_VALUE);
+        super(key, path, "", "", true, 0, Integer.MAX_VALUE);
     }
 
     @Override

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java Wed Jul 15 22:04:43 2009
@@ -17,15 +17,15 @@
 {
     public final SortedSet<String> columns;
 
-    public NamesQueryFilter(String key, String columnFamilyColumn, SortedSet<String> columns)
+    public NamesQueryFilter(String key, QueryPath columnParent, SortedSet<String> columns)
     {
-        super(key, columnFamilyColumn);
+        super(key, columnParent);
         this.columns = columns;
     }
 
-    public NamesQueryFilter(String key, String columnFamilyColumn, String column)
+    public NamesQueryFilter(String key, QueryPath columnParent, String column)
     {
-        this(key, columnFamilyColumn, new TreeSet<String>(Arrays.asList(column)));
+        this(key, columnParent, new TreeSet<String>(Arrays.asList(column)));
     }
 
     public ColumnIterator getMemColumnIterator(Memtable memtable)

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryFilter.java Wed Jul 15 22:04:43 2009
@@ -11,12 +11,12 @@
 public abstract class QueryFilter
 {
     public final String key;
-    public final String columnFamilyColumn;
+    public final QueryPath path;
 
-    protected QueryFilter(String key, String columnFamilyColumn)
+    protected QueryFilter(String key, QueryPath path)
     {
         this.key = key;
-        this.columnFamilyColumn = columnFamilyColumn;
+        this.path = path;
     }
 
     /**
@@ -86,6 +86,6 @@
 
     public String getColumnFamilyName()
     {
-        return RowMutation.getColumnAndColumnFamily(columnFamilyColumn)[0];
+        return path.columnFamilyName;
     }
 }

Added: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java?rev=794429&view=auto
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java (added)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/QueryPath.java Wed Jul 15 22:04:43 2009
@@ -0,0 +1,86 @@
+package org.apache.cassandra.db.filter;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.DataInputStream;
+
+import org.apache.cassandra.service.ColumnParent;
+import org.apache.cassandra.service.ColumnPath;
+import org.apache.cassandra.service.ColumnPathOrParent;
+
+public class QueryPath
+{
+    public final String columnFamilyName;
+    public final String superColumnName;
+    public final String columnName;
+
+    public QueryPath(String columnFamilyName, String superColumnName, String columnName)
+    {
+        // TODO remove these when we're sure the last vestiges of the old api are gone
+        assert columnFamilyName == null || !columnFamilyName.contains(":");
+        assert superColumnName == null || !superColumnName.contains(":");
+        assert columnName == null || !columnName.contains(":");
+
+        this.columnFamilyName = columnFamilyName;
+        this.superColumnName = superColumnName;
+        this.columnName = columnName;
+    }
+
+    public QueryPath(ColumnParent columnParent)
+    {
+        this(columnParent.column_family, columnParent.super_column, null);
+    }
+
+    public QueryPath(String columnFamilyName, String superColumnName)
+    {
+        this(columnFamilyName, superColumnName, null);
+    }
+
+    public QueryPath(String columnFamilyName)
+    {
+        this(columnFamilyName, null);
+    }
+
+    public QueryPath(ColumnPath column_path)
+    {
+        this(column_path.column_family, column_path.super_column, column_path.column);
+    }
+
+    public QueryPath(ColumnPathOrParent column_path_or_parent)
+    {
+        this(column_path_or_parent.column_family, column_path_or_parent.super_column, column_path_or_parent.column);
+    }
+
+    public static QueryPath column(String columnName)
+    {
+        return new QueryPath(null, null, columnName);
+    }
+
+    @Override
+    public String toString()
+    {
+        return "QueryPath(" +
+               "columnFamilyName='" + columnFamilyName + '\'' +
+               ", superColumnName='" + superColumnName + '\'' +
+               ", columnName='" + columnName + '\'' +
+               ')';
+    }
+
+    public void serialize(DataOutputStream dos) throws IOException
+    {
+        assert !"".equals(columnFamilyName);
+        assert !"".equals(superColumnName);
+        assert !"".equals(columnName);
+        dos.writeUTF(columnFamilyName == null ? "" : columnFamilyName);
+        dos.writeUTF(superColumnName == null ? "" : superColumnName);
+        dos.writeUTF(columnName == null ? "" : columnName);
+    }
+
+    public static QueryPath deserialize(DataInputStream din) throws IOException
+    {
+        String cfName = din.readUTF();
+        String scName = din.readUTF();
+        String cName = din.readUTF();
+        return new QueryPath(cfName.isEmpty() ? null : cfName, scName.isEmpty() ? null : scName, cName.isEmpty() ? null : cName);
+    }
+}

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java Wed Jul 15 22:04:43 2009
@@ -15,9 +15,9 @@
     public final boolean isAscending;
     public final int offset, count;
 
-    public SliceQueryFilter(String key, String columnFamilyColumn, String start, String finish, boolean ascending, int offset, int count)
+    public SliceQueryFilter(String key, QueryPath columnParent, String start, String finish, boolean ascending, int offset, int count)
     {
-        super(key, columnFamilyColumn);
+        super(key, columnParent);
         this.start = start;
         this.finish = finish;
         isAscending = ascending;

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/TimeQueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/TimeQueryFilter.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/TimeQueryFilter.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/filter/TimeQueryFilter.java Wed Jul 15 22:04:43 2009
@@ -11,9 +11,9 @@
 {
     public final long since;
 
-    public TimeQueryFilter(String key, String columnFamilyColumn, long since)
+    public TimeQueryFilter(String key, QueryPath columnParent, long since)
     {
-        super(key, columnFamilyColumn);
+        super(key, columnParent);
         this.since = since;
     }
 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java Wed Jul 15 22:04:43 2009
@@ -31,6 +31,7 @@
 import org.apache.cassandra.cql.common.CqlResult;
 import org.apache.cassandra.cql.driver.CqlDriver;
 import org.apache.cassandra.db.*;
+import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.utils.LogUtil;
 import org.apache.cassandra.dht.OrderPreservingPartitioner;
 import org.apache.thrift.TException;
@@ -43,8 +44,8 @@
 {
 	private static Logger logger = Logger.getLogger(CassandraServer.class);
 
-    private final static List<column_t> EMPTY_COLUMNS = Collections.emptyList();
-    private final static List<superColumn_t> EMPTY_SUPERCOLUMNS = Collections.emptyList();
+    private final static List<Column> EMPTY_COLUMNS = Collections.emptyList();
+    private final static List<SuperColumn> EMPTY_SUPERCOLUMNS = Collections.emptyList();
 
     /*
       * Handle to the storage service to interact with the other machines in the
@@ -95,115 +96,97 @@
         return row.getColumnFamily(cfName);
 	}
 
-    public List<column_t> thriftifyColumns(Collection<IColumn> columns)
+    public List<Column> thriftifyColumns(Collection<IColumn> columns)
     {
         if (columns == null || columns.isEmpty())
         {
             return EMPTY_COLUMNS;
         }
 
-        ArrayList<column_t> thriftColumns = new ArrayList<column_t>(columns.size());
+        ArrayList<Column> thriftColumns = new ArrayList<Column>(columns.size());
         for (IColumn column : columns)
         {
             if (column.isMarkedForDelete())
             {
                 continue;
             }
-            column_t thrift_column = new column_t(column.name(), column.value(), column.timestamp());
+            Column thrift_column = new Column(column.name(), column.value(), column.timestamp());
             thriftColumns.add(thrift_column);
         }
 
         return thriftColumns;
     }
 
-    public List<column_t> get_columns_since(String tablename, String key, String columnParent, long timeStamp) throws InvalidRequestException
+    /** for resultsets of standard columns */
+    private List<Column> getSlice(ReadCommand command) throws InvalidRequestException
     {
-        logger.debug("get_columns_since");
-        String[] values = ThriftValidation.validateColumnParent(tablename, columnParent);
-
-        ColumnFamily cfamily = readColumnFamily(new ColumnsSinceReadCommand(tablename, key, columnParent, timeStamp));
-        if (cfamily == null)
+        ColumnFamily cfamily = readColumnFamily(command);
+        if (cfamily == null || cfamily.getColumns().size() == 0)
         {
             return EMPTY_COLUMNS;
         }
-        Collection<IColumn> columns = null;
-        if( values.length > 1 )
+        if (cfamily.isSuper())
         {
-            // this is the super column case
-            IColumn column = cfamily.getColumn(values[1]);
-            if(column != null)
-                columns = column.getSubColumns();
+            IColumn column = cfamily.getColumns().values().iterator().next();
+            return thriftifyColumns(column.getSubColumns());
         }
-        else
-        {
-            columns = cfamily.getAllColumns();
-        }
-        return thriftifyColumns(columns);
-	}
-	
+        return thriftifyColumns(cfamily.getAllColumns());
+    }
 
-    public List<column_t> get_slice_by_names(String tablename, String key, String columnParent, List<String> columnNames) throws InvalidRequestException
+    public List<Column> get_columns_since(String table, String key, ColumnParent column_parent, long timeStamp)
+    throws InvalidRequestException, NotFoundException
     {
-        logger.debug("get_slice_by_names");
-        String[] values = ThriftValidation.validateColumnParent(tablename, columnParent);
+        logger.debug("get_columns_since");
+        ThriftValidation.validateColumnParent(table, column_parent);
+        return getSlice(new ColumnsSinceReadCommand(table, key, column_parent, timeStamp));
+    }
 
-        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(tablename, key, columnParent, columnNames));
-        if (cfamily == null)
-        {
-            return EMPTY_COLUMNS;
-        }
-        if (DatabaseDescriptor.getColumnFamilyType(tablename, values[0]).equals("Standard"))
-        {
-            return thriftifyColumns(cfamily.getAllColumns());
-        }
-        else
-        {
-            IColumn superColumn = cfamily.getColumn(values[1]);
-            if (superColumn == null)
-            {
-                return EMPTY_COLUMNS;
-            }
-            return thriftifyColumns(superColumn.getSubColumns());
-        }
+
+    public List<Column> get_slice_by_names(String table, String key, ColumnParent column_parent, List<String> column_names)
+    throws InvalidRequestException, NotFoundException
+    {
+        logger.debug("get_slice_by_names");
+        ThriftValidation.validateColumnParent(table, column_parent);
+        return getSlice(new SliceByNamesReadCommand(table, key, column_parent, column_names));
     }
 
-    public List<column_t> get_slice(String tablename, String key, String columnParent, String start, String finish, boolean isAscending, int offset, int count) throws InvalidRequestException, NotFoundException, TException
+    public List<Column> get_slice(String table, String key, ColumnParent column_parent, String start, String finish, boolean is_ascending, int offset, int count)
+    throws InvalidRequestException, NotFoundException
     {
         logger.debug("get_slice_from");
-        String[] values = RowMutation.getColumnAndColumnFamily(columnParent);
-        if (values.length != 1 || !DatabaseDescriptor.getColumnFamilyType(tablename, values[0]).equals("Standard"))
-            throw new InvalidRequestException("get_slice_from requires a standard CF name and a starting column name");
+        ThriftValidation.validateColumnParent(table, column_parent);
+        // TODO support get_slice on super CFs
+        if (column_parent.super_column != null || !DatabaseDescriptor.getColumnFamilyType(table, column_parent.column_family).equals("Standard"))
+            throw new InvalidRequestException("get_slice does not yet support super columns (we need to fix this)");
         if (count <= 0)
-            throw new InvalidRequestException("get_slice_from requires positive count");
-        if ("Name".compareTo(DatabaseDescriptor.getCFMetaData(tablename, values[0]).indexProperty_) != 0)
-            throw new InvalidRequestException("get_slice_from requires CF indexed by name");
+            throw new InvalidRequestException("get_slice requires positive count");
+        if (!"Name".equals(DatabaseDescriptor.getCFMetaData(table, column_parent.column_family).indexProperty_))
+            throw new InvalidRequestException("get_slice requires CF indexed by name");
 
-        ColumnFamily cfamily = readColumnFamily(new SliceFromReadCommand(tablename, key, columnParent, start, finish, isAscending, offset, count));
-        if (cfamily == null)
-        {
-            return EMPTY_COLUMNS;
-        }
-        Collection<IColumn> columns = cfamily.getAllColumns();
-        return thriftifyColumns(columns);
+        return getSlice(new SliceFromReadCommand(table, key, column_parent, start, finish, is_ascending, offset, count));
     }
 
-    public column_t get_column(String tablename, String key, String columnPath) throws NotFoundException, InvalidRequestException
+    public Column get_column(String table, String key, ColumnPath column_path)
+    throws InvalidRequestException, NotFoundException
     {
         logger.debug("get_column");
-        String[] values = ThriftValidation.validateColumnPath(tablename, columnPath);
+        ThriftValidation.validateColumnPath(table, column_path);
 
-        ColumnFamily cfamily = readColumnFamily(new ColumnReadCommand(tablename, key, columnPath));
+        QueryPath path = new QueryPath(column_path.column_family, column_path.super_column);
+        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(table, key, path, Arrays.asList(column_path.column)));
+        // TODO can we leverage getSlice here and just check that it returns one column?
         if (cfamily == null)
         {
             throw new NotFoundException();
         }
         Collection<IColumn> columns = null;
-        if( values.length > 2 )
+        if (column_path.super_column != null)
         {
-            // this is the super column case
-            IColumn column = cfamily.getColumn(values[1]);
-            if(column != null)
+            IColumn column = cfamily.getColumn(column_path.super_column);
+            if (column != null)
+            {
                 columns = column.getSubColumns();
+            }
         }
         else
         {
@@ -221,34 +204,36 @@
             throw new NotFoundException();
         }
 
-        return new column_t(column.name(), column.value(), column.timestamp());
+        return new Column(column.name(), column.value(), column.timestamp());
     }
 
-    public int get_column_count(String tablename, String key, String columnParent) throws InvalidRequestException
+    public int get_column_count(String table, String key, ColumnParent column_parent)
+    throws InvalidRequestException
     {
         logger.debug("get_column_count");
-        String[] values = ThriftValidation.validateColumnParent(tablename, columnParent);
+        ThriftValidation.validateColumnParent(table, column_parent);
 
         ColumnFamily cfamily;
-        if (DatabaseDescriptor.isNameSortingEnabled(tablename, values[0]))
+        if (DatabaseDescriptor.isNameSortingEnabled(table, column_parent.column_family))
         {
-            cfamily = readColumnFamily(new SliceFromReadCommand(tablename, key, columnParent, "", "", true, 0, Integer.MAX_VALUE));
+            cfamily = readColumnFamily(new SliceFromReadCommand(table, key, column_parent, "", "", true, 0, Integer.MAX_VALUE));
         }
         else
         {
-            cfamily = readColumnFamily(new ColumnsSinceReadCommand(tablename, key, columnParent, Long.MIN_VALUE));
+            cfamily = readColumnFamily(new ColumnsSinceReadCommand(table, key, column_parent, Long.MIN_VALUE));
         }
         if (cfamily == null)
         {
             return 0;
         }
         Collection<IColumn> columns = null;
-        if( values.length > 1 )
+        if (column_parent.super_column != null)
         {
-            // this is the super column case
-            IColumn column = cfamily.getColumn(values[1]);
-            if(column != null)
+            IColumn column = cfamily.getColumn(column_parent.super_column);
+            if (column != null)
+            {
                 columns = column.getSubColumns();
+            }
         }
         else
         {
@@ -261,38 +246,39 @@
         return columns.size();
 	}
 
-    public void insert(String tablename, String key, String columnPath, byte[] cellData, long timestamp, int block)
+    public void insert(String table, String key, ColumnPath column_path, byte[] value, long timestamp, int block_for)
     throws InvalidRequestException, UnavailableException
     {
         logger.debug("insert");
         ThriftValidation.validateKey(key);
-        ThriftValidation.validateColumnPath(tablename, columnPath);
+        ThriftValidation.validateColumnPath(table, column_path);
 
-        RowMutation rm = new RowMutation(tablename, key.trim());
-        rm.add(columnPath, cellData, timestamp);
-        doInsert(block, rm);
+        RowMutation rm = new RowMutation(table, key.trim());
+        rm.add(new QueryPath(column_path), value, timestamp);
+        doInsert(block_for, rm);
     }
 
-    public void batch_insert(batch_mutation_t batchMutation, int block) throws InvalidRequestException, UnavailableException
+    public void batch_insert(String table, BatchMutation batch_mutation, int block_for)
+    throws InvalidRequestException, UnavailableException
     {
         logger.debug("batch_insert");
-        RowMutation rm = RowMutation.getRowMutation(batchMutation);
+        RowMutation rm = RowMutation.getRowMutation(table, batch_mutation);
         Set<String> cfNames = rm.columnFamilyNames();
         ThriftValidation.validateKeyCommand(rm.key(), rm.table(), cfNames.toArray(new String[cfNames.size()]));
 
-        doInsert(block, rm);
+        doInsert(block_for, rm);
     }
 
-    public void remove(String tablename, String key, String columnPathOrParent, long timestamp, int block)
+    public void remove(String table, String key, ColumnPathOrParent column_path_or_parent, long timestamp, int block_for)
     throws InvalidRequestException, UnavailableException
     {
         logger.debug("remove");
-        ThriftValidation.validateColumnPathOrParent(tablename, columnPathOrParent);
+        ThriftValidation.validateColumnPathOrParent(table, column_path_or_parent);
         
-        RowMutation rm = new RowMutation(tablename, key.trim());
-        rm.delete(columnPathOrParent, timestamp);
+        RowMutation rm = new RowMutation(table, key.trim());
+        rm.delete(new QueryPath(column_path_or_parent), timestamp);
 
-        doInsert(block, rm);
+        doInsert(block_for, rm);
 	}
 
     private void doInsert(int block, RowMutation rm) throws UnavailableException
@@ -307,12 +293,13 @@
         }
     }
 
-    public List<superColumn_t> get_slice_super_by_names(String tablename, String key, String columnFamily, List<String> superColumnNames) throws InvalidRequestException
+    public List<SuperColumn> get_slice_super_by_names(String table, String key, String column_family, List<String> super_column_names)
+    throws InvalidRequestException
     {
         logger.debug("get_slice_super_by_names");
-        ThriftValidation.validateColumnFamily(tablename, columnFamily);
+        ThriftValidation.validateColumnFamily(table, column_family);
 
-        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(tablename, key, columnFamily, superColumnNames));
+        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(table, key, new QueryPath(column_family), super_column_names));
         if (cfamily == null)
         {
             return EMPTY_SUPERCOLUMNS;
@@ -320,37 +307,37 @@
         return thriftifySuperColumns(cfamily.getAllColumns());
     }
 
-    private List<superColumn_t> thriftifySuperColumns(Collection<IColumn> columns)
+    private List<SuperColumn> thriftifySuperColumns(Collection<IColumn> columns)
     {
         if (columns == null || columns.isEmpty())
         {
             return EMPTY_SUPERCOLUMNS;
         }
 
-        ArrayList<superColumn_t> thriftSuperColumns = new ArrayList<superColumn_t>(columns.size());
+        ArrayList<SuperColumn> thriftSuperColumns = new ArrayList<SuperColumn>(columns.size());
         for (IColumn column : columns)
         {
-            List<column_t> subcolumns = thriftifyColumns(column.getSubColumns());
+            List<Column> subcolumns = thriftifyColumns(column.getSubColumns());
             if (subcolumns.isEmpty())
             {
                 continue;
             }
-            thriftSuperColumns.add(new superColumn_t(column.name(), subcolumns));
+            thriftSuperColumns.add(new SuperColumn(column.name(), subcolumns));
         }
 
         return thriftSuperColumns;
     }
 
-    public List<superColumn_t> get_slice_super(String tablename, String key, String columnFamily, String start, String finish, boolean isAscending, int offset, int count) throws InvalidRequestException, TException
+    public List<SuperColumn> get_slice_super(String table, String key, String column_family, String start, String finish, boolean is_ascending, int offset, int count)
+    throws InvalidRequestException
     {
         logger.debug("get_slice_super");
-        String[] values = RowMutation.getColumnAndColumnFamily(columnFamily);
-        if (values.length != 1 || !DatabaseDescriptor.getColumnFamilyType(tablename, values[0]).equals("Super"))
+        if (!DatabaseDescriptor.getColumnFamilyType(table, column_family).equals("Super"))
             throw new InvalidRequestException("get_slice_super requires a super CF name");
         if (count <= 0)
             throw new InvalidRequestException("get_slice_super requires positive count");
 
-        ColumnFamily cfamily = readColumnFamily(new SliceFromReadCommand(tablename, key, columnFamily, start, finish, isAscending, offset, count));
+        ColumnFamily cfamily = readColumnFamily(new SliceFromReadCommand(table, key, new QueryPath(column_family), start, finish, is_ascending, offset, count));
         if (cfamily == null)
         {
             return EMPTY_SUPERCOLUMNS;
@@ -358,13 +345,15 @@
         Collection<IColumn> columns = cfamily.getAllColumns();
         return thriftifySuperColumns(columns);
     }
-    
-    public superColumn_t get_superColumn(String tablename, String key, String superColumnPath) throws InvalidRequestException, NotFoundException
+
+
+    public SuperColumn get_super_column(String table, String key, SuperColumnPath super_column_path)
+    throws InvalidRequestException, NotFoundException
     {
         logger.debug("get_superColumn");
-        ThriftValidation.validateSuperColumnPath(tablename, superColumnPath);
+        ThriftValidation.validateSuperColumnPath(table, super_column_path);
 
-        ColumnFamily cfamily = readColumnFamily(new ColumnReadCommand(tablename, key, superColumnPath));
+        ColumnFamily cfamily = readColumnFamily(new SliceByNamesReadCommand(table, key, new QueryPath(super_column_path.column_family), Arrays.asList(super_column_path.super_column)));
         if (cfamily == null)
         {
             throw new NotFoundException();
@@ -382,17 +371,18 @@
             throw new NotFoundException();
         }
 
-        return new superColumn_t(column.name(), thriftifyColumns(column.getSubColumns()));
+        return new SuperColumn(column.name(), thriftifyColumns(column.getSubColumns()));
     }
 
-    public void batch_insert_superColumn(batch_mutation_super_t batchMutationSuper, int block) throws InvalidRequestException, UnavailableException
+    public void batch_insert_super_column(String table, BatchMutationSuper batch_mutation_super, int block_for)
+    throws InvalidRequestException, UnavailableException
     {
         logger.debug("batch_insert_SuperColumn");
-        RowMutation rm = RowMutation.getRowMutation(batchMutationSuper);
+        RowMutation rm = RowMutation.getRowMutation(table, batch_mutation_super);
         Set<String> cfNames = rm.columnFamilyNames();
         ThriftValidation.validateKeyCommand(rm.key(), rm.table(), cfNames.toArray(new String[cfNames.size()]));
 
-        doInsert(block, rm);
+        doInsert(block_for, rm);
     }
 
     public String getStringProperty(String propertyName)
@@ -484,18 +474,18 @@
         return columnFamiliesMap;
     }
 
-    public CqlResult_t executeQuery(String query) throws TException
+    public org.apache.cassandra.service.CqlResult executeQuery(String query) throws TException
     {
-        CqlResult_t result = new CqlResult_t();
+        org.apache.cassandra.service.CqlResult result = new org.apache.cassandra.service.CqlResult();
 
         CqlResult cqlResult = CqlDriver.executeQuery(query);
         
         // convert CQL result type to Thrift specific return type
         if (cqlResult != null)
         {
-            result.errorTxt = cqlResult.errorTxt;
-            result.resultSet = cqlResult.resultSet;
-            result.errorCode = cqlResult.errorCode;
+            result.error_txt = cqlResult.errorTxt;
+            result.result_set = cqlResult.resultSet;
+            result.error_code = cqlResult.errorCode;
         }
         return result;
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/ThriftValidation.java Wed Jul 15 22:04:43 2009
@@ -41,95 +41,70 @@
         }
     }
 
-    private static String validateColumnFamily(String tablename, String[] values) throws InvalidRequestException
+    public static String validateColumnFamily(String tablename, String cfName) throws InvalidRequestException
     {
-        if (values.length < 1)
+        if (cfName.isEmpty())
         {
             throw new InvalidRequestException("non-empty columnfamily is required");
         }
-        String cfType = DatabaseDescriptor.getColumnType(tablename, values[0]);
+        String cfType = DatabaseDescriptor.getColumnType(tablename, cfName);
         if (cfType == null)
         {
-            throw new InvalidRequestException("unconfigured columnfamily " + values[0]);
+            throw new InvalidRequestException("unconfigured columnfamily " + cfName);
         }
         return cfType;
     }
 
-    static String[] validateColumnPath(String tablename, String columnPath) throws InvalidRequestException
+    static void validateColumnPath(String tablename, ColumnPath column_path) throws InvalidRequestException
     {
         validateTable(tablename);
-        String[] values = RowMutation.getColumnAndColumnFamily(columnPath);
-        String cfType = validateColumnFamily(tablename, values);
+        String cfType = validateColumnFamily(tablename, column_path.column_family);
         if (cfType.equals("Standard"))
         {
-            if (values.length != 2)
+            if (column_path.super_column != null)
             {
-                throw new InvalidRequestException("both parts of columnfamily:column are required for standard CF " + values[0]);
+                throw new InvalidRequestException("supercolumn parameter is invalid for standard CF " + column_path.column_family);
             }
         }
-        else if (values.length != 3)
-        {
-            throw new InvalidRequestException("all parts of columnfamily:supercolumn:subcolumn are required for super CF " + values[0]);
-        }
-        return values;
     }
 
-    static String[] validateColumnParent(String tablename, String columnParent) throws InvalidRequestException
+    static void validateColumnParent(String tablename, ColumnParent column_parent) throws InvalidRequestException
     {
         validateTable(tablename);
-        String[] values = RowMutation.getColumnAndColumnFamily(columnParent);
-        String cfType = validateColumnFamily(tablename, values);
+        String cfType = validateColumnFamily(tablename, column_parent.column_family);
         if (cfType.equals("Standard"))
         {
-            if (values.length != 1)
+            if (column_parent.super_column != null)
             {
-                throw new InvalidRequestException("columnfamily alone is required for standard CF " + values[0]);
+                throw new InvalidRequestException("columnfamily alone is required for standard CF " + column_parent.column_family);
             }
         }
-        else if (values.length != 2)
+        else if (column_parent.super_column == null)
         {
-            throw new InvalidRequestException("columnfamily:supercolumn is required for super CF " + values[0]);
+            throw new InvalidRequestException("columnfamily and supercolumn are both required for super CF " + column_parent.column_family);
         }
-        return values;
     }
 
-    static String[] validateSuperColumnPath(String tablename, String columnPath) throws InvalidRequestException
+    static void validateSuperColumnPath(String tablename, SuperColumnPath super_column_path) throws InvalidRequestException
     {
         validateTable(tablename);
-        String[] values = RowMutation.getColumnAndColumnFamily(columnPath);
-        String cfType = validateColumnFamily(tablename, values);
+        String cfType = validateColumnFamily(tablename, super_column_path.column_family);
         if (cfType.equals("Standard"))
         {
-            throw new InvalidRequestException(values[0] + " is a standard columnfamily; only super columnfamilies are valid here");
+            throw new InvalidRequestException(super_column_path.column_family + " is a standard columnfamily; only super columnfamilies are valid here");
         }
-        else if (values.length != 1)
-        {
-            throw new InvalidRequestException("columnfamily alone is required for super CF " + values[0]);
-        }
-        return values;
     }
 
-    static String[] validateColumnPathOrParent(String tablename, String columnPath) throws InvalidRequestException
+    static void validateColumnPathOrParent(String tablename, ColumnPathOrParent column_path_or_parent) throws InvalidRequestException
     {
         validateTable(tablename);
-        String[] values = RowMutation.getColumnAndColumnFamily(columnPath);
-        String cfType = validateColumnFamily(tablename, values);
+        String cfType = validateColumnFamily(tablename, column_path_or_parent.column_family);
         if (cfType.equals("Standard"))
         {
-            if (values.length > 2)
+            if (column_path_or_parent.super_column != null)
             {
-                throw new InvalidRequestException("columnfamily:column is the most path components possible for standard CF " + values[0]);
+                throw new InvalidRequestException("supercolumn may not be specified for standard CF " + column_path_or_parent.column_family);
             }
         }
-        else if (values.length > 3)
-        {
-            throw new InvalidRequestException("columnfamily:supercolumn:column is the most path components possible for super CF " + values[0]);
-        }
-        return values;
-    }
-
-    public static String validateColumnFamily(String tablename, String columnFamily) throws InvalidRequestException
-    {
-        return validateColumnFamily(tablename, RowMutation.getColumnAndColumnFamily(columnFamily)); 
     }
 }
\ No newline at end of file

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java Wed Jul 15 22:04:43 2009
@@ -31,6 +31,7 @@
 import static junit.framework.Assert.assertEquals;
 import org.apache.cassandra.CleanupHelper;
 import org.apache.cassandra.db.filter.IdentityQueryFilter;
+import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.io.SSTableReader;
 
 public class ColumnFamilyStoreTest extends CleanupHelper
@@ -108,15 +109,15 @@
 
         // add data
         rm = new RowMutation("Table1", "key1");
-        rm.add("Standard1:Column1", "asdf".getBytes(), 0);
-        rm.add("Standard1:Column2", "asdf".getBytes(), 0);
+        rm.add(new QueryPath("Standard1", null, "Column1"), "asdf".getBytes(), 0);
+        rm.add(new QueryPath("Standard1", null, "Column2"), "asdf".getBytes(), 0);
         rm.apply();
         store.forceBlockingFlush();
 
         List<SSTableReader> ssTables = table.getAllSSTablesOnDisk();
         assertEquals(1, ssTables.size());
         ssTables.get(0).forceBloomFilterFailures();
-        ColumnFamily cf = store.getColumnFamily(new IdentityQueryFilter("key2", "Standard1:Column1"));
+        ColumnFamily cf = store.getColumnFamily(new IdentityQueryFilter("key2", new QueryPath("Standard1", null, "Column1")));
         assertNull(cf);
     }
 }

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ColumnFamilyTest.java Wed Jul 15 22:04:43 2009
@@ -28,6 +28,7 @@
 
 import org.apache.cassandra.io.DataInputBuffer;
 import org.apache.cassandra.io.DataOutputBuffer;
+import org.apache.cassandra.db.filter.QueryPath;
 
 public class ColumnFamilyTest
 {
@@ -42,7 +43,7 @@
         ColumnFamily cf;
 
         cf = ColumnFamily.create("Table1", "Standard1");
-        cf.addColumn("C", bytes, 1);
+        cf.addColumn(QueryPath.column("C"), bytes, 1);
         DataOutputBuffer bufOut = new DataOutputBuffer();
         ColumnFamily.serializer().serialize(cf, bufOut);
 
@@ -70,7 +71,7 @@
         DataOutputBuffer bufOut = new DataOutputBuffer();
         for (String cName : map.navigableKeySet())
         {
-            cf.addColumn(cName, map.get(cName), 314);
+            cf.addColumn(QueryPath.column(cName), map.get(cName), 314);
         }
         ColumnFamily.serializer().serialize(cf, bufOut);
 
@@ -81,7 +82,6 @@
         for (String cName : map.navigableKeySet())
         {
             assert Arrays.equals(cf.getColumn(cName).value(), map.get(cName));
-
         }
         assert new HashSet<String>(cf.getColumns().keySet()).equals(map.keySet());
     }
@@ -92,9 +92,9 @@
         ColumnFamily cf = ColumnFamily.create("Table1", "Standard1");
         byte val[] = "sample value".getBytes();
 
-        cf.addColumn("col1", val, 1);
-        cf.addColumn("col2", val, 2);
-        cf.addColumn("col1", val, 3);
+        cf.addColumn(QueryPath.column("col1"), val, 1);
+        cf.addColumn(QueryPath.column("col2"), val, 2);
+        cf.addColumn(QueryPath.column("col1"), val, 3);
 
         assert 2 == cf.getColumnCount();
         assert 2 == cf.getAllColumns().size();
@@ -108,9 +108,9 @@
         byte val2[] = "sample 2".getBytes();
         byte val3[] = "sample 3".getBytes();
 
-        cf.addColumn("col1", val1, 2);
-        cf.addColumn("col1", val2, 2); // same timestamp, new value
-        cf.addColumn("col1", val3, 1); // older timestamp -- should be ignored
+        cf.addColumn(QueryPath.column("col1"), val1, 2);
+        cf.addColumn(QueryPath.column("col1"), val2, 2); // same timestamp, new value
+        cf.addColumn(QueryPath.column("col1"), val3, 1); // older timestamp -- should be ignored
 
         assert Arrays.equals(val2, cf.getColumn("col1").value());
     }
@@ -124,11 +124,11 @@
         byte val[] = "sample value".getBytes();
         byte val2[] = "x value ".getBytes();
 
-        cf_new.addColumn("col1", val, 3);
-        cf_new.addColumn("col2", val, 4);
+        cf_new.addColumn(QueryPath.column("col1"), val, 3);
+        cf_new.addColumn(QueryPath.column("col2"), val, 4);
 
-        cf_old.addColumn("col2", val2, 1);
-        cf_old.addColumn("col3", val2, 2);
+        cf_old.addColumn(QueryPath.column("col2"), val2, 1);
+        cf_old.addColumn(QueryPath.column("col3"), val2, 2);
 
         cf_result.addColumns(cf_new);
         cf_result.addColumns(cf_old);

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CommitLogTest.java Wed Jul 15 22:04:43 2009
@@ -24,6 +24,7 @@
 import org.junit.Test;
 
 import org.apache.cassandra.CleanupHelper;
+import org.apache.cassandra.db.filter.QueryPath;
 
 public class CommitLogTest extends CleanupHelper
 {
@@ -43,8 +44,8 @@
         for (int i = 0; i < 10; i++)
         {
             rm = new RowMutation("Table1", "key1");
-            rm.add("Standard1:Column1", value, 0);
-            rm.add("Standard2:Column1", value, 0);
+            rm.add(new QueryPath("Standard1", null, "Column1"), value, 0);
+            rm.add(new QueryPath("Standard2", null, "Column1"), value, 0);
             rm.apply();
         }
         assert CommitLog.getSegmentCount() > 1;

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsTest.java Wed Jul 15 22:04:43 2009
@@ -29,6 +29,7 @@
 
 import org.apache.cassandra.io.SSTableReader;
 import org.apache.cassandra.CleanupHelper;
+import org.apache.cassandra.db.filter.QueryPath;
 import static junit.framework.Assert.assertEquals;
 
 public class CompactionsTest extends CleanupHelper
@@ -46,7 +47,7 @@
             for (int i = 0; i < ROWS_PER_SSTABLE; i++) {
                 String key = String.valueOf(i % 2);
                 RowMutation rm = new RowMutation("Table1", key);
-                rm.add("Standard1:" + (i / 2), new byte[0], j * ROWS_PER_SSTABLE + i);
+                rm.add(new QueryPath("Standard1", null, String.valueOf(i / 2)), new byte[0], j * ROWS_PER_SSTABLE + i);
                 rm.apply();
                 inserted.add(key);
             }

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/NameSortTest.java Wed Jul 15 22:04:43 2009
@@ -26,6 +26,7 @@
 import org.junit.Test;
 
 import org.apache.cassandra.CleanupHelper;
+import org.apache.cassandra.db.filter.QueryPath;
 
 public class NameSortTest extends CleanupHelper
 {
@@ -65,7 +66,7 @@
             {
                 byte[] bytes = j % 2 == 0 ? "a".getBytes() : "b".getBytes();
                 rm = new RowMutation("Table1", key);
-                rm.add("Standard1:" + "Column-" + j, bytes, j);
+                rm.add(new QueryPath("Standard1", null, "Column-" + j), bytes, j);
                 rm.apply();
             }
 
@@ -76,7 +77,7 @@
                 {
                     byte[] bytes = (j + k) % 2 == 0 ? "a".getBytes() : "b".getBytes();
                     rm = new RowMutation("Table1", key);
-                    rm.add("Super1:" + "SuperColumn-" + j + ":Column-" + k, bytes, k);
+                    rm.add(new QueryPath("Super1", "SuperColumn-" + j, "Column-" + k), bytes, k);
                     rm.apply();
                 }
             }

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/OneCompactionTest.java Wed Jul 15 22:04:43 2009
@@ -28,6 +28,7 @@
 import org.junit.Test;
 
 import static junit.framework.Assert.assertEquals;
+import org.apache.cassandra.db.filter.QueryPath;
 
 public class OneCompactionTest
 {
@@ -40,7 +41,7 @@
         for (int j = 0; j < insertsPerTable; j++) {
             String key = "0";
             RowMutation rm = new RowMutation("Table1", key);
-            rm.add(columnFamilyName + ":0", new byte[0], j);
+            rm.add(new QueryPath(columnFamilyName, null, "0"), new byte[0], j);
             rm.apply();
             inserted.add(key);
             store.forceBlockingFlush();

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/ReadMessageTest.java Wed Jul 15 22:04:43 2009
@@ -29,6 +29,7 @@
 
 import org.apache.cassandra.io.DataInputBuffer;
 import org.apache.cassandra.io.DataOutputBuffer;
+import org.apache.cassandra.db.filter.QueryPath;
 
 public class ReadMessageTest
 {
@@ -41,23 +42,19 @@
         
         ReadCommand rm, rm2;
         
-        rm = new SliceByNamesReadCommand("Table1", "row1", "foo", colList);
+        rm = new SliceByNamesReadCommand("Table1", "row1", new QueryPath("foo"), colList);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assert rm2.toString().equals(rm.toString());
 
-        rm = new ColumnReadCommand("Table1", "row1", "foo:col1");
+        rm = new ColumnsSinceReadCommand("Table1", "row1", new QueryPath("foo"), 1);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assert rm2.toString().equals(rm.toString());
 
-        rm = new ColumnsSinceReadCommand("Table1", "row1", "foo", 1);
-        rm2 = serializeAndDeserializeReadMessage(rm);
-        assert rm2.toString().equals(rm.toString());
-
-        rm = new SliceFromReadCommand("Table1", "row1", "foo", "", "", true, 0, 2);
+        rm = new SliceFromReadCommand("Table1", "row1", new QueryPath("foo"), "", "", true, 0, 2);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assert rm2.toString().equals(rm.toString());
         
-        rm = new SliceFromReadCommand("Table1", "row1", "foo", "a", "z", true, 0, 5);
+        rm = new SliceFromReadCommand("Table1", "row1", new QueryPath("foo"), "a", "z", true, 0, 5);
         rm2 = serializeAndDeserializeReadMessage(rm);
         assertEquals(rm2.toString(), rm.toString());
     }
@@ -90,10 +87,10 @@
 
         // add data
         rm = new RowMutation("Table1", "key1");
-        rm.add("Standard1:Column1", "abcd".getBytes(), 0);
+        rm.add(new QueryPath("Standard1", null, "Column1"), "abcd".getBytes(), 0);
         rm.apply();
 
-        ReadCommand command = new ColumnReadCommand("Table1", "key1", "Standard1:Column1");
+        ReadCommand command = new SliceByNamesReadCommand("Table1", "key1", new QueryPath("Standard1"), Arrays.asList("Column1"));
         Row row = command.getRow(table);
         ColumnFamily cf = row.getColumnFamily("Standard1");
         IColumn col = cf.getColumn("Column1");

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java?rev=794429&r1=794428&r2=794429&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/db/RemoveColumnFamilyTest.java Wed Jul 15 22:04:43 2009
@@ -25,6 +25,7 @@
 
 import static junit.framework.Assert.assertNull;
 import org.apache.cassandra.db.filter.IdentityQueryFilter;
+import org.apache.cassandra.db.filter.QueryPath;
 
 public class RemoveColumnFamilyTest
 {
@@ -37,15 +38,15 @@
 
         // add data
         rm = new RowMutation("Table1", "key1");
-        rm.add("Standard1:Column1", "asdf".getBytes(), 0);
+        rm.add(new QueryPath("Standard1", null, "Column1"), "asdf".getBytes(), 0);
         rm.apply();
 
         // remove
         rm = new RowMutation("Table1", "key1");
-        rm.delete("Standard1", 1);
+        rm.delete(new QueryPath("Standard1"), 1);
         rm.apply();
 
-        ColumnFamily retrieved = store.getColumnFamily(new IdentityQueryFilter("key1", "Standard1:Column1"));
+        ColumnFamily retrieved = store.getColumnFamily(new IdentityQueryFilter("key1", new QueryPath("Standard1", null, "Column1")));
         assert retrieved.isMarkedForDelete();
         assertNull(retrieved.getColumn("Column1"));
         assertNull(ColumnFamilyStore.removeDeleted(retrieved, Integer.MAX_VALUE));



Mime
View raw message