Author: jbellis Date: Fri Sep 9 16:54:00 2011 New Revision: 1167291 URL: http://svn.apache.org/viewvc?rev=1167291&view=rev Log: merge #3031 from 1.0.0
Added: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/JdbcInt32.java - copied unchanged from r1167289, cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/cql/jdbc/JdbcInt32.java cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/marshal/Int32Type.java - copied unchanged from r1167289, cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/db/marshal/Int32Type.java Modified: cassandra/branches/cassandra-1.0/ (props changed) cassandra/branches/cassandra-1.0/CHANGES.txt cassandra/branches/cassandra-1.0/NEWS.txt cassandra/branches/cassandra-1.0/contrib/ (props changed) cassandra/branches/cassandra-1.0/doc/cql/CQL.textile cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java (props changed) cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java (props changed) cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java (props changed) cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java (props changed) cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java (props changed) cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/JdbcLong.java cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/TypesMap.java cassandra/branches/cassandra-1.0/src/resources/org/apache/cassandra/cli/CliHelp.yaml cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/Util.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/TableTest.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/RoundTripTest.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeValidationTest.java Propchange: cassandra/branches/cassandra-1.0/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0:1125021-1130369 /cassandra/branches/cassandra-0.8.1:1101014-1125018 /cassandra/branches/cassandra-1.0:1167106,1167185 -/cassandra/branches/cassandra-1.0.0:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1:1102511-1125020 +/cassandra/trunk:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3:774578-796573 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5:888872-915439 Modified: cassandra/branches/cassandra-1.0/CHANGES.txt URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/CHANGES.txt (original) +++ cassandra/branches/cassandra-1.0/CHANGES.txt Fri Sep 9 16:54:00 2011 @@ -69,7 +69,7 @@ (CASSANDRA-3148) * fix inconsistency of the CLI syntax when {} should be used instead of [{}] (CASSANDRA-3119) - * rename CQL type names to match expected SQL behavior (CASSANDRA-3149) + * rename CQL type names to match expected SQL behavior (CASSANDRA-3149, 3031) * Arena-based allocation for memtables (CASSANDRA-2252, 3162) Modified: cassandra/branches/cassandra-1.0/NEWS.txt URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/NEWS.txt?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/NEWS.txt (original) +++ cassandra/branches/cassandra-1.0/NEWS.txt Fri Sep 9 16:54:00 2011 @@ -9,7 +9,8 @@ Upgrading cassandra.yaml (use compaction_throughput_mb_per_sec to throttle compaction instead) - CQL types bytea and date were renamed to blob and timestamp, respectively, - to conform with SQL norms + to conform with SQL norms. CQL type int is now a 4-byte int, not 8 + (which is still available as bigint). Features -------- Propchange: cassandra/branches/cassandra-1.0/contrib/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0/contrib:1125021-1130369 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018 /cassandra/branches/cassandra-1.0/contrib:1167106,1167185 -/cassandra/branches/cassandra-1.0.0/contrib:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0/contrib:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020 +/cassandra/trunk/contrib:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3/contrib:774578-796573 /incubator/cassandra/branches/cassandra-0.4/contrib:810145-810987,810994-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5/contrib:888872-915439 Modified: cassandra/branches/cassandra-1.0/doc/cql/CQL.textile URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/doc/cql/CQL.textile?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/doc/cql/CQL.textile (original) +++ cassandra/branches/cassandra-1.0/doc/cql/CQL.textile Fri Sep 9 16:54:00 2011 @@ -273,6 +273,7 @@ It is possible to assign columns a type |decimal|Variable-precision decimal| |double|8-byte floating point| |float|4-byte floating point| +|int|4-byte int| |text|UTF8 encoded string| |timestamp|Date + Time, encoded as 8 bytes since epoch| |uuid|Type 1, or type 4 UUID| @@ -384,6 +385,9 @@ Versioning of the CQL language adheres t h1. Changes pre. +Fri, 09 Sep 2011 11:43:00 -0500 - Jonathan Ellis + * add int data type + Wed, 07 Sep 2011 09:01:00 -0500 - Jonathan Ellis * Updated version to 2.0; Documented row-based count() * Updated list of supported data types Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167106,1167185 -/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1102511-1125020 +/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-903502 Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167106,1167185 -/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1102511-1125020 +/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-903502 Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167106,1167185 -/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1102511-1125020 +/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-903502 Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167106,1167185 -/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1102511-1125020 +/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-903502 Propchange: cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Sep 9 16:54:00 2011 @@ -5,9 +5,10 @@ /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018 /cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167106,1167185 -/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167106,1167185,1167230-1167231 +/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1167290 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689 /cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1102511-1125020 +/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1167102 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-903502 Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java (original) +++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cli/CliClient.java Fri Sep 9 16:54:00 2011 @@ -66,6 +66,7 @@ public class CliClient BYTES (BytesType.instance), INTEGER (IntegerType.instance), LONG (LongType.instance), + INT (Int32Type.instance), LEXICALUUID (LexicalUUIDType.instance), TIMEUUID (TimeUUIDType.instance), UTF8 (UTF8Type.instance), Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java (original) +++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java Fri Sep 9 16:54:00 2011 @@ -71,7 +71,7 @@ public class CreateColumnFamilyStatement comparators.put("decimal", "DecimalType"); comparators.put("double", "DoubleType"); comparators.put("float", "FloatType"); - // comparators.put("int", "LongType"); TODO add int -> Int32Type + comparators.put("int", "Int32Type"); comparators.put("text", "UTF8Type"); comparators.put("timestamp", "DateType"); comparators.put("uuid", "UUIDType"); Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/JdbcLong.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/JdbcLong.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/JdbcLong.java (original) +++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/JdbcLong.java Fri Sep 9 16:54:00 2011 @@ -90,7 +90,7 @@ public class JdbcLong extends AbstractJd public int getJdbcType() { - return Types.INTEGER; + return Types.BIGINT; } public Long compose(ByteBuffer bytes) Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/TypesMap.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/TypesMap.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/TypesMap.java (original) +++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/jdbc/TypesMap.java Fri Sep 9 16:54:00 2011 @@ -17,6 +17,7 @@ public class TypesMap map.put("org.apache.cassandra.db.marshal.DecimalType", JdbcDecimal.instance); map.put("org.apache.cassandra.db.marshal.DoubleType", JdbcDouble.instance); map.put("org.apache.cassandra.db.marshal.FloatType", JdbcFloat.instance); + map.put("org.apache.cassandra.db.marshal.Int32Type", JdbcInt32.instance); map.put("org.apache.cassandra.db.marshal.IntegerType", JdbcInteger.instance); map.put("org.apache.cassandra.db.marshal.LexicalUUIDType", JdbcLexicalUUID.instance); map.put("org.apache.cassandra.db.marshal.LongType", JdbcLong.instance); Modified: cassandra/branches/cassandra-1.0/src/resources/org/apache/cassandra/cli/CliHelp.yaml URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/resources/org/apache/cassandra/cli/CliHelp.yaml?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/src/resources/org/apache/cassandra/cli/CliHelp.yaml (original) +++ cassandra/branches/cassandra-1.0/src/resources/org/apache/cassandra/cli/CliHelp.yaml Fri Sep 9 16:54:00 2011 @@ -363,6 +363,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -401,6 +402,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -417,6 +419,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -431,6 +434,7 @@ commands: Supported values are: - AsciiType - BytesType + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -511,6 +515,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -626,6 +631,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -668,6 +674,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -684,6 +691,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -698,6 +706,7 @@ commands: Supported values are: - AsciiType - BytesType + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -778,6 +787,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -919,6 +929,7 @@ commands: Valid options are: - ascii - bytes: if used without arguments generates a zero length byte array + - int32 - integer - lexicaluuid: if used without arguments generates a new random uuid - long @@ -944,6 +955,7 @@ commands: - AsciiType - BytesType - CounterColumnType (distributed counter column) + - Int32Type - IntegerType (a generic variable-length integer type) - LexicalUUIDType - LongType @@ -987,6 +999,7 @@ commands: Valid options are: - ascii - bytes: if used without arguments generates a zero length byte array + - int32 - integer - lexicaluuid: if used without arguments generates a new random uuid - long @@ -1030,6 +1043,7 @@ commands: Supported values are: - ascii - bytes: if used without arguments generates a zero length byte array + - int32 - integer - lexicaluuid: if used without arguments generates a new random uuid - long @@ -1134,6 +1148,7 @@ commands: - ascii - bytes - counterColumn (distributed counter column) + - int32 - integer (a generic variable-length integer type) - lexicalUUID - long Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/Util.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/Util.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/Util.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/Util.java Fri Sep 9 16:54:00 2011 @@ -103,6 +103,15 @@ public class Util return bb; } + public static ByteBuffer getBytes(int v) + { + byte[] bytes = new byte[4]; + ByteBuffer bb = ByteBuffer.wrap(bytes); + bb.putInt(v); + bb.rewind(); + return bb; + } + public static List<Row> getRangeSlice(ColumnFamilyStore cfs) throws IOException, ExecutionException, InterruptedException { return getRangeSlice(cfs, null); Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java Fri Sep 9 16:54:00 2011 @@ -499,16 +499,16 @@ public class ColumnFamilyStoreTest exten // create an isolated sstable. putColsSuper(cfs, key, scfName, - new Column(getBytes(1), ByteBufferUtil.bytes("val1"), 1), - new Column(getBytes(2), ByteBufferUtil.bytes("val2"), 1), - new Column(getBytes(3), ByteBufferUtil.bytes("val3"), 1)); + new Column(getBytes(1L), ByteBufferUtil.bytes("val1"), 1), + new Column(getBytes(2L), ByteBufferUtil.bytes("val2"), 1), + new Column(getBytes(3L), ByteBufferUtil.bytes("val3"), 1)); cfs.forceBlockingFlush(); // insert, don't flush. putColsSuper(cfs, key, scfName, - new Column(getBytes(4), ByteBufferUtil.bytes("val4"), 1), - new Column(getBytes(5), ByteBufferUtil.bytes("val5"), 1), - new Column(getBytes(6), ByteBufferUtil.bytes("val6"), 1)); + new Column(getBytes(4L), ByteBufferUtil.bytes("val4"), 1), + new Column(getBytes(5L), ByteBufferUtil.bytes("val5"), 1), + new Column(getBytes(6L), ByteBufferUtil.bytes("val6"), 1)); // verify insert. final SlicePredicate sp = new SlicePredicate(); @@ -535,17 +535,17 @@ public class ColumnFamilyStoreTest exten // late insert. putColsSuper(cfs, key, scfName, - new Column(getBytes(4), ByteBufferUtil.bytes("val4"), 1L), - new Column(getBytes(7), ByteBufferUtil.bytes("val7"), 1L)); + new Column(getBytes(4L), ByteBufferUtil.bytes("val4"), 1L), + new Column(getBytes(7L), ByteBufferUtil.bytes("val7"), 1L)); // re-verify delete. assertRowAndColCount(1, 0, scfName, false, cfs.getRangeSlice(scfName, Util.range("f", "g"), 100, QueryFilter.getFilter(sp, cfs.getComparator()))); // make sure new writes are recognized. putColsSuper(cfs, key, scfName, - new Column(getBytes(3), ByteBufferUtil.bytes("val3"), 3), - new Column(getBytes(8), ByteBufferUtil.bytes("val8"), 3), - new Column(getBytes(9), ByteBufferUtil.bytes("val9"), 3)); + new Column(getBytes(3L), ByteBufferUtil.bytes("val3"), 3), + new Column(getBytes(8L), ByteBufferUtil.bytes("val8"), 3), + new Column(getBytes(9L), ByteBufferUtil.bytes("val9"), 3)); assertRowAndColCount(1, 3, scfName, false, cfs.getRangeSlice(scfName, Util.range("f", "g"), 100, QueryFilter.getFilter(sp, cfs.getComparator()))); } Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSubColumnTest.java Fri Sep 9 16:54:00 2011 @@ -51,11 +51,11 @@ public class RemoveSubColumnTest extends // remove rm = new RowMutation("Keyspace1", dk.key); - rm.delete(new QueryPath("Super1", ByteBufferUtil.bytes("SC1"), getBytes(1)), 1); + rm.delete(new QueryPath("Super1", ByteBufferUtil.bytes("SC1"), getBytes(1L)), 1); rm.apply(); ColumnFamily retrieved = store.getColumnFamily(QueryFilter.getIdentityFilter(dk, new QueryPath("Super1", ByteBufferUtil.bytes("SC1")))); - assert retrieved.getColumn(ByteBufferUtil.bytes("SC1")).getSubColumn(getBytes(1)).isMarkedForDelete(); + assert retrieved.getColumn(ByteBufferUtil.bytes("SC1")).getSubColumn(getBytes(1L)).isMarkedForDelete(); assertNull(Util.cloneAndRemoveDeleted(retrieved, Integer.MAX_VALUE)); } } Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/RemoveSuperColumnTest.java Fri Sep 9 16:54:00 2011 @@ -85,7 +85,7 @@ public class RemoveSuperColumnTest exten // remove rm = new RowMutation("Keyspace1", dk.key); - rm.delete(new QueryPath("Super3", ByteBufferUtil.bytes("SC1"), Util.getBytes(1)), 1); + rm.delete(new QueryPath("Super3", ByteBufferUtil.bytes("SC1"), Util.getBytes(1L)), 1); rm.apply(); validateRemoveSubColumn(dk); @@ -97,9 +97,9 @@ public class RemoveSuperColumnTest exten private void validateRemoveSubColumn(DecoratedKey dk) throws IOException { ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super3"); - ColumnFamily cf = store.getColumnFamily(QueryFilter.getNamesFilter(dk, new QueryPath("Super3", ByteBufferUtil.bytes("SC1")), Util.getBytes(1))); + ColumnFamily cf = store.getColumnFamily(QueryFilter.getNamesFilter(dk, new QueryPath("Super3", ByteBufferUtil.bytes("SC1")), Util.getBytes(1L))); assertNull(Util.cloneAndRemoveDeleted(cf, Integer.MAX_VALUE)); - cf = store.getColumnFamily(QueryFilter.getNamesFilter(dk, new QueryPath("Super3", ByteBufferUtil.bytes("SC1")), Util.getBytes(2))); + cf = store.getColumnFamily(QueryFilter.getNamesFilter(dk, new QueryPath("Super3", ByteBufferUtil.bytes("SC1")), Util.getBytes(2L))); assertNotNull(Util.cloneAndRemoveDeleted(cf, Integer.MAX_VALUE)); } @@ -162,7 +162,7 @@ public class RemoveSuperColumnTest exten private void validateRemoveWithNewData(DecoratedKey dk) throws IOException { ColumnFamilyStore store = Table.open("Keyspace1").getColumnFamilyStore("Super2"); - ColumnFamily cf = store.getColumnFamily(QueryFilter.getNamesFilter(dk, new QueryPath("Super2", ByteBufferUtil.bytes("SC1")), getBytes(2))); + ColumnFamily cf = store.getColumnFamily(QueryFilter.getNamesFilter(dk, new QueryPath("Super2", ByteBufferUtil.bytes("SC1")), getBytes(2L))); Collection<IColumn> subColumns = cf.getSortedColumns().iterator().next().getSubColumns(); assert subColumns.size() == 1; assert subColumns.iterator().next().timestamp() == 2; Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/TableTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/TableTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/TableTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/TableTest.java Fri Sep 9 16:54:00 2011 @@ -41,7 +41,7 @@ import static org.apache.cassandra.Util. import static org.apache.cassandra.Util.getBytes; import org.apache.cassandra.Util; import org.apache.cassandra.db.filter.QueryPath; -import org.apache.cassandra.db.marshal.LongType; +import org.apache.cassandra.db.marshal.Int32Type; import org.apache.cassandra.io.sstable.IndexHelper; import org.apache.cassandra.io.sstable.SSTableReader; import org.apache.cassandra.utils.ByteBufferUtil; @@ -487,7 +487,7 @@ public class TableTest extends CleanupHe RowMutation rm = new RowMutation("Keyspace1", ROW.key); ColumnFamily cf = ColumnFamily.create("Keyspace1", "Super1"); - SuperColumn sc = new SuperColumn(ByteBufferUtil.bytes("sc1"), LongType.instance); + SuperColumn sc = new SuperColumn(ByteBufferUtil.bytes("sc1"), Int32Type.instance); sc.addColumn(new Column(getBytes(1), ByteBufferUtil.bytes("val1"), 1L)); cf.addColumn(sc); rm.add(cf); Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/RoundTripTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/RoundTripTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/RoundTripTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/RoundTripTest.java Fri Sep 9 16:54:00 2011 @@ -60,6 +60,17 @@ public class RoundTripTest } @Test + public void intLong() + { + byte[] v = new byte[]{0,0,0,1}; + assert Int32Type.instance.getString(Int32Type.instance.fromString("1")).equals("1"); + assert Int32Type.instance.fromString(Int32Type.instance.getString(ByteBuffer.wrap(v))) + .equals(ByteBuffer.wrap(v)); + assert Int32Type.instance.compose(ByteBuffer.wrap(v)) == 1; + // assert Int32Type.instance.toString(1).equals("1"); + } + + @Test public void testAscii() throws Exception { byte[] abc = "abc".getBytes(Charsets.US_ASCII); Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeCompareTest.java Fri Sep 9 16:54:00 2011 @@ -93,6 +93,28 @@ public class TypeCompareTest } @Test + public void testInt() + { + Random rng = new Random(); + ByteBuffer[] data = new ByteBuffer[1000]; + for (int i = 0; i < data.length; i++) + { + data[i] = ByteBuffer.allocate(4); + rng.nextBytes(data[i].array()); + } + + Arrays.sort(data, Int32Type.instance); + + for (int i = 1; i < data.length; i++) + { + + int l0 = data[i - 1].getInt(data[i - 1].position()); + int l1 = data[i].getInt(data[i].position()); + assert l0 <= l1; + } + } + + @Test public void testTimeUUID() { // two different UUIDs w/ the same timestamp Modified: cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeValidationTest.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeValidationTest.java?rev=1167291&r1=1167290&r2=1167291&view=diff ============================================================================== --- cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeValidationTest.java (original) +++ cassandra/branches/cassandra-1.0/test/unit/org/apache/cassandra/db/marshal/TypeValidationTest.java Fri Sep 9 16:54:00 2011 @@ -52,11 +52,18 @@ public class TypeValidationTest @Test public void testLong() { - LongType.instance.validate(Util.getBytes(5)); + LongType.instance.validate(Util.getBytes(5L)); LongType.instance.validate(Util.getBytes(5555555555555555555L)); } @Test + public void testInt() + { + Int32Type.instance.validate(Util.getBytes(5)); + Int32Type.instance.validate(Util.getBytes(2057022603)); + } + + @Test public void testValidUtf8() throws UnsupportedEncodingException { assert Character.MAX_CODE_POINT == 0x0010ffff;