cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1100878 - in /cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc: CResultSet.java ColumnDecoder.java
Date Mon, 09 May 2011 04:11:06 GMT
Author: jbellis
Date: Mon May  9 04:11:06 2011
New Revision: 1100878

URL: http://svn.apache.org/viewvc?rev=1100878&view=rev
Log:
r/m no-op trips through colNameAsString
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
    cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java

Modified: cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java?rev=1100878&r1=1100877&r2=1100878&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
(original)
+++ cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/CResultSet.java
Mon May  9 04:11:06 2011
@@ -108,7 +108,7 @@ public class CResultSet extends Abstract
 
     public byte[] getBytes(String name) throws SQLException
     {
-        return getBytes(valueMap.get(decoder.colNameAsString(keyspace, columnFamily, name)));
+        return getBytes(valueMap.get(name));
     }
 
     public Date getDate(int arg0) throws SQLException
@@ -175,7 +175,7 @@ public class CResultSet extends Abstract
 
     public BigInteger getBigInteger(String name)
     {
-        return getBigInteger(valueMap.get(decoder.colNameAsString(keyspace, columnFamily,
name)));
+        return getBigInteger(valueMap.get(name));
     }
 
     private int getInt(TypedColumn column) throws SQLException
@@ -196,7 +196,7 @@ public class CResultSet extends Abstract
 
     public int getInt(String name) throws SQLException
     {
-        return getInt(valueMap.get(decoder.colNameAsString(keyspace, columnFamily, name)));
+        return getInt(valueMap.get(name));
     }
 
     private Long getLong(TypedColumn column)
@@ -213,7 +213,7 @@ public class CResultSet extends Abstract
 
     public long getLong(String name) throws SQLException
     {
-        return getLong(valueMap.get(decoder.colNameAsString(keyspace, columnFamily, name)));
+        return getLong(valueMap.get(name));
     }
 
     public ResultSetMetaData getMetaData() throws SQLException
@@ -235,7 +235,7 @@ public class CResultSet extends Abstract
 
     public Object getObject(String name) throws SQLException
     {
-        return getObject(valueMap.get(decoder.colNameAsString(keyspace, columnFamily, name)));
+        return getObject(valueMap.get(name));
     }
 
     public Object getObject(int arg0, Map<String, Class<?>> arg1) throws SQLException
@@ -267,7 +267,7 @@ public class CResultSet extends Abstract
 
     public String getString(String name) throws SQLException
     {
-        return getString(valueMap.get(this.decoder.colNameAsString(this.keyspace, this.columnFamily,
name)));
+        return getString(valueMap.get(name));
     }
 
     public Time getTime(int arg0) throws SQLException

Modified: cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java?rev=1100878&r1=1100877&r2=1100878&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java
(original)
+++ cassandra/branches/cassandra-0.8/drivers/java/src/org/apache/cassandra/cql/jdbc/ColumnDecoder.java
Mon May  9 04:11:06 2011
@@ -145,20 +145,6 @@ class ColumnDecoder 
     }
 
     /**
-     * uses the AbstractType to map a column name to a string.  Relies on AT.fromString()
and AT.getString()
-     * @param keyspace
-     * @param columnFamily
-     * @param name
-     * @return
-     */
-    public String colNameAsString(String keyspace, String columnFamily, String name) 
-    {
-        AbstractType comparator = getComparator(keyspace, columnFamily, Specifier.Comparator,
null);
-        ByteBuffer bb = comparator.fromString(name);
-        return comparator.getString(bb);
-    }
-
-    /**
      * uses the AbstractType to map a column name to a string.
      * @param keyspace
      * @param columnFamily
@@ -171,20 +157,6 @@ class ColumnDecoder 
         return comparator.getString(ByteBuffer.wrap(name));
     }
 
-    /**
-     * converts a column value to a string.
-     * @param value
-     * @return
-     */
-    public static String colValueAsString(Object value) {
-        if (value instanceof String)
-            return (String)value;
-        else if (value instanceof byte[])
-            return ByteBufferUtil.bytesToHex(ByteBuffer.wrap((byte[])value));
-        else
-            return value == null ? null : value.toString();
-    }
-
     /** constructs a typed column */
     public TypedColumn makeCol(String keyspace, String columnFamily, Column column)
     {



Mime
View raw message