cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r955049 - in /cassandra/trunk: interface/cassandra.avpr interface/cassandra.genavro src/java/org/apache/cassandra/avro/CassandraServer.java
Date Tue, 15 Jun 2010 20:57:16 GMT
Author: eevans
Date: Tue Jun 15 20:57:16 2010
New Revision: 955049

URL: http://svn.apache.org/viewvc?rev=955049&view=rev
Log:
remove deprecated (and non-working) batch_insert()

Patch by eevans

Modified:
    cassandra/trunk/interface/cassandra.avpr
    cassandra/trunk/interface/cassandra.genavro
    cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java

Modified: cassandra/trunk/interface/cassandra.avpr
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.avpr?rev=955049&r1=955048&r2=955049&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.avpr (original)
+++ cassandra/trunk/interface/cassandra.avpr Tue Jun 15 20:57:16 2010
@@ -148,17 +148,6 @@
         "errors": ["InvalidRequestException", "UnavailableException",
             "TimedOutException"]
     },
-    "batch_insert": {
-        "request": [
-            {"name": "keyspace", "type": "string"},
-            {"name": "key", "type": "string"},
-            {"name": "cfmap", "type": {"type": "map", "values": {"type": "array", "items":
"ColumnOrSuperColumn"}}},
-            {"name": "consistency_level", "type": "ConsistencyLevel"}
-        ],
-        "response": "null",
-        "errors": ["InvalidRequestException", "UnavailableException",
-            "TimedOutException"]
-    },
     "batch_mutate": {
         "request": [
             {"name": "keyspace", "type": "string"},

Modified: cassandra/trunk/interface/cassandra.genavro
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.genavro?rev=955049&r1=955048&r2=955049&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.genavro (original)
+++ cassandra/trunk/interface/cassandra.genavro Tue Jun 15 20:57:16 2010
@@ -116,12 +116,6 @@ protocol Cassandra {
                 ConsistencyLevel consistency_level)
     throws InvalidRequestException, UnavailableException, TimedOutException;
 
-    void batch_insert(string keyspace,
-                      string key,
-                      map<array<ColumnOrSuperColumn>> cfmap,
-                      ConsistencyLevel consistency_level)
-    throws InvalidRequestException, UnavailableException, TimedOutException;
-
     void batch_mutate(string keyspace,
                       map<map<array<Mutation>>> mutation_map,
                       ConsistencyLevel consistency_level)

Modified: cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java?rev=955049&r1=955048&r2=955049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java Tue Jun 15 20:57:16
2010
@@ -306,56 +306,6 @@ public class CassandraServer implements 
         }
     }
 
-    public Void batch_insert(Utf8 keyspace, Utf8 key, Map<Utf8, GenericArray<ColumnOrSuperColumn>>
cfmap, ConsistencyLevel consistency)
-    throws AvroRemoteException, InvalidRequestException, UnavailableException, TimedOutException
-    {
-        if (logger.isDebugEnabled())
-            logger.debug("batch_insert");
-
-        byte[] keyBytes = key.getBytes();
-        String keyspaceString = keyspace.toString();
-
-        AvroValidation.validateKey(key.toString());
-
-        for (Utf8 cfName : cfmap.keySet())
-        {
-            for (ColumnOrSuperColumn cosc : cfmap.get(cfName))
-                AvroValidation.validateColumnOrSuperColumn(keyspaceString, cfName.toString(),
cosc);
-        }
-
-        doInsert(consistency, getRowMutation(keyspaceString, keyBytes, cfmap));
-        return null;
-    }
-
-    // FIXME: This is copypasta from o.a.c.db.RowMutation, (RowMutation.getRowMutation uses
Thrift types directly).
-    private static RowMutation getRowMutation(String keyspace, byte[] key, Map<Utf8, GenericArray<ColumnOrSuperColumn>>
cfmap)
-    {
-        RowMutation rm = new RowMutation(keyspace, key);
-        for (Map.Entry<Utf8, GenericArray<ColumnOrSuperColumn>> entry : cfmap.entrySet())
-        {
-            String cfName = entry.getKey().toString();
-            for (ColumnOrSuperColumn cosc : entry.getValue())
-            {
-                if (cosc.column == null)
-                {
-                    assert cosc.super_column != null;
-                    for (Column column : cosc.super_column.columns)
-                    {
-                        QueryPath path = new QueryPath(cfName, cosc.super_column.name.array(),
column.name.array());
-                        rm.add(path, column.value.array(), unavronateClock(column.clock),
column.ttl == null ? 0 : column.ttl);
-                    }
-                }
-                else
-                {
-                    assert cosc.super_column == null;
-                    QueryPath path = new QueryPath(cfName, null, cosc.column.name.array());
-                    rm.add(path, cosc.column.value.array(), unavronateClock(cosc.column.clock),
cosc.column.ttl == null ? 0 : cosc.column.ttl);
-                }
-            }
-        }
-        return rm;
-    }
-
     public Void batch_mutate(Utf8 keyspace, Map<Utf8, Map<Utf8, GenericArray<Mutation>>>
mutationMap, ConsistencyLevel consistencyLevel)
     throws AvroRemoteException, UnavailableException, TimedOutException
     {



Mime
View raw message