cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1137494 - in /cassandra/branches/cassandra-0.8: CHANGES.txt bin/cassandra.bat src/java/org/apache/cassandra/cql/Cql.g src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java src/java/org/apache/cassandra/cql/Term.java
Date Mon, 20 Jun 2011 04:08:09 GMT
Author: jbellis
Date: Mon Jun 20 04:08:09 2011
New Revision: 1137494

URL: http://svn.apache.org/viewvc?rev=1137494&view=rev
Log:
Add Date, Float, Double, and Boolean types
patch by Rick Shaw; reviewed by jbellis, slebresne, and pyaskevich for CASSANDRA-2530

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/bin/cassandra.bat
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Term.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1137494&r1=1137493&r2=1137494&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Mon Jun 20 04:08:09 2011
@@ -1,5 +1,6 @@
 0.8.2
  * fix cache mbean getSize (CASSANDRA-2781)
+ * Add Date, Float, Double, and Boolean types
 
 
 0.8.1

Modified: cassandra/branches/cassandra-0.8/bin/cassandra.bat
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/bin/cassandra.bat?rev=1137494&r1=1137493&r2=1137494&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/bin/cassandra.bat (original)
+++ cassandra/branches/cassandra-0.8/bin/cassandra.bat Mon Jun 20 04:08:09 2011
@@ -24,6 +24,7 @@ if NOT DEFINED JAVA_HOME goto err
 REM ***** JAVA options *****
 set JAVA_OPTS=^
  -ea^
+ -javaagent:%CASSANDRA_HOME%/lib/jamm-0.2.2.jar^
  -Xms1G^
  -Xmx1G^
  -XX:+HeapDumpOnOutOfMemoryError^

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g?rev=1137494&r1=1137493&r2=1137494&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g Mon Jun 20 04:08:09
2011
@@ -427,11 +427,11 @@ dropColumnFamilyStatement returns [Strin
     ;
 
 comparatorType
-    : 'bytea' | 'ascii' | 'text' | 'varchar' | 'int' | 'varint' | 'bigint' | 'uuid' | 'counter'
+    : 'bytea' | 'ascii' | 'text' | 'varchar' | 'int' | 'varint' | 'bigint' | 'uuid' | 'counter'
| 'boolean' | 'date' | 'float' | 'double'
     ;
 
 term returns [Term item]
-    : ( t=K_KEY | t=STRING_LITERAL | t=INTEGER | t=UUID | t=IDENT ) { $item = new Term($t.text,
$t.type); }
+    : ( t=K_KEY | t=STRING_LITERAL | t=INTEGER | t=UUID | t=IDENT | t=FLOAT) { $item = new
Term($t.text, $t.type); }
     ;
 
 termList returns [List<Term> items]

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java?rev=1137494&r1=1137493&r2=1137494&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
Mon Jun 20 04:08:09 2011
@@ -73,6 +73,10 @@ public class CreateColumnFamilyStatement
         comparators.put("bigint", "LongType");
         comparators.put("uuid", "UUIDType");
         comparators.put("counter", "CounterColumnType");
+        comparators.put("boolean", "BooleanType");
+        comparators.put("date", "DateType");
+        comparators.put("float", "FloatType");
+        comparators.put("double", "DoubleType");
 
         keywords.add(KW_COMPARATOR);
         keywords.add(KW_COMMENT);

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Term.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Term.java?rev=1137494&r1=1137493&r2=1137494&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Term.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Term.java Mon Jun 20
04:08:09 2011
@@ -24,6 +24,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.AsciiType;
+import org.apache.cassandra.db.marshal.FloatType;
 import org.apache.cassandra.db.marshal.IntegerType;
 import org.apache.cassandra.db.marshal.LexicalUUIDType;
 import org.apache.cassandra.db.marshal.MarshalException;
@@ -107,6 +108,8 @@ public class Term
                 // we specifically want the Lexical class here, not "UUIDType," because we're
supposed to have
                 // a uuid-shaped string here, and UUIDType also accepts integer or date strings
(and turns them into version 1 uuids).
                 return LexicalUUIDType.instance.fromString(text);
+            case FLOAT: 
+              return FloatType.instance.fromString(text);
         }
         
         // FIXME: handle scenario that should never happen
@@ -132,7 +135,7 @@ public class Term
 
 enum TermType
 {
-    STRING, INTEGER, UUID;
+    STRING, INTEGER, UUID, FLOAT;
     
     static TermType forInt(int type)
     {
@@ -141,7 +144,9 @@ enum TermType
         else if (type == CqlParser.INTEGER)
             return INTEGER;
         else if (type == CqlParser.UUID)
-            return UUID;
+          return UUID;
+        else if (type == CqlParser.FLOAT)
+          return FLOAT;
         
         // FIXME: handled scenario that should never occur.
         return null;



Mime
View raw message