cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: r/m retrieveKeysForThriftTables since it is unneeded in 2.0
Date Wed, 31 Jul 2013 23:20:19 GMT
Updated Branches:
  refs/heads/trunk 2451140b8 -> d410a719d


r/m retrieveKeysForThriftTables since it is unneeded in 2.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d410a719
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d410a719
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d410a719

Branch: refs/heads/trunk
Commit: d410a719d2cbe9d8e7cb89fdf2075792e06a303f
Parents: 2451140
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Jul 31 18:20:17 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Jul 31 18:20:17 2013 -0500

----------------------------------------------------------------------
 .../hadoop/cql3/CqlPagingRecordReader.java      | 41 ++------------------
 1 file changed, 4 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d410a719/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
index a342ac4..54506e9 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlPagingRecordReader.java
@@ -29,9 +29,6 @@ import com.google.common.collect.Iterables;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.config.CFMetaData;
-import org.apache.cassandra.cql3.CFDefinition;
-import org.apache.cassandra.cql3.ColumnIdentifier;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.CompositeType;
 import org.apache.cassandra.db.marshal.LongType;
@@ -674,11 +671,6 @@ public class CqlPagingRecordReader extends RecordReader<Map<String,
ByteBuffer>,
 
         for (String key : keys)
             partitionBoundColumns.add(new BoundColumn(key));
-        if (partitionBoundColumns.size() == 0)
-        {
-            retrieveKeysForThriftTables();
-            return;
-        }
 
         keyString = ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.columns.get(1).getValue()));
         logger.debug("cluster columns: {}", keyString);
@@ -687,35 +679,10 @@ public class CqlPagingRecordReader extends RecordReader<Map<String,
ByteBuffer>,
         for (String key : keys)
             clusterColumns.add(new BoundColumn(key));
 
-        parseKeyValidators(ByteBufferUtil.string(ByteBuffer.wrap(cqlRow.columns.get(2).getValue())));
-    }
-
-    /** 
-     * retrieve the fake partition keys and cluster keys for classic thrift table 
-     * use CFDefinition to get keys and columns
-     * */
-    private void retrieveKeysForThriftTables() throws Exception
-    {
-        KsDef ksDef = client.describe_keyspace(keyspace);
-        for (CfDef cfDef : ksDef.cf_defs)
-        {
-            if (cfDef.name.equalsIgnoreCase(cfName))
-            {
-                CFMetaData cfMeta = CFMetaData.fromThrift(cfDef);
-                CFDefinition cfDefinition = new CFDefinition(cfMeta);
-                for (ColumnIdentifier columnIdentifier : cfDefinition.keys.keySet())
-                    partitionBoundColumns.add(new BoundColumn(columnIdentifier.toString()));
-                parseKeyValidators(cfDef.key_validation_class);
-                return;
-            }
-        }
-    }
-
-    /** parse key validators */
-    private void parseKeyValidators(String rowKeyValidator) throws IOException
-    {
-        logger.debug("row key validator: {} ", rowKeyValidator);
-        keyValidator = parseType(rowKeyValidator);
+        Column rawKeyValidator = cqlRow.columns.get(2);
+        String validator = ByteBufferUtil.string(ByteBuffer.wrap(rawKeyValidator.getValue()));
+        logger.debug("row key validator: {}", validator);
+        keyValidator = parseType(validator);
 
         if (keyValidator instanceof CompositeType)
         {


Mime
View raw message