diff --git a/CHANGES.txt b/CHANGES.txt index d59480a418..70d9bbec0b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -47,6 +47,7 @@ * fix the problem re-creating Keyspace/ColumnFamily (CASSANDRA-4219) * fix SecondaryIndex LelevedManifest save upon snapshot (CASSANDRA-4230) * fix missing arrayOffset in FBUtilities.hash (CASSANDRA-4250) + * (cql3) Add name of parameters in CqlResultSet (CASSANDRA-4242) Merged from 1.0: * Fix super columns bug where cache is not updated (CASSANDRA-4190) * fix maxTimestamp to include row tombstones (CASSANDRA-4116) diff --git a/interface/cassandra.thrift b/interface/cassandra.thrift index 148f277ce4..6df9628f7a 100644 --- a/interface/cassandra.thrift +++ b/interface/cassandra.thrift @@ -55,7 +55,7 @@ namespace rb CassandraThrift # An effort should be made not to break forward-client-compatibility either # (e.g. one should avoid removing obsolete fields from the IDL), but no # guarantees in this respect are made by the Cassandra project. -const string VERSION = "19.31.0" +const string VERSION = "19.32.0" # @@ -497,7 +497,8 @@ struct CqlResult { struct CqlPreparedResult { 1: required i32 itemId, 2: required i32 count, - 3: optional list variable_types + 3: optional list variable_types, + 4: optional list variable_names } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java index a10f936ed1..1c6ec690ad 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java @@ -7260,14 +7260,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list91 = iprot.readListBegin(); - this.success = new ArrayList(_list91.size); - for (int _i92 = 0; _i92 < _list91.size; ++_i92) + org.apache.thrift.protocol.TList _list95 = iprot.readListBegin(); + this.success = new ArrayList(_list95.size); + for (int _i96 = 0; _i96 < _list95.size; ++_i96) { - ColumnOrSuperColumn _elem93; // required - _elem93 = new ColumnOrSuperColumn(); - _elem93.read(iprot); - this.success.add(_elem93); + ColumnOrSuperColumn _elem97; // required + _elem97 = new ColumnOrSuperColumn(); + _elem97.read(iprot); + this.success.add(_elem97); } iprot.readListEnd(); } @@ -7317,9 +7317,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (ColumnOrSuperColumn _iter94 : this.success) + for (ColumnOrSuperColumn _iter98 : this.success) { - _iter94.write(oprot); + _iter98.write(oprot); } oprot.writeListEnd(); } @@ -9119,13 +9119,13 @@ public class Cassandra { case 1: // KEYS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list95 = iprot.readListBegin(); - this.keys = new ArrayList(_list95.size); - for (int _i96 = 0; _i96 < _list95.size; ++_i96) + org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); + this.keys = new ArrayList(_list99.size); + for (int _i100 = 0; _i100 < _list99.size; ++_i100) { - ByteBuffer _elem97; // required - _elem97 = iprot.readBinary(); - this.keys.add(_elem97); + ByteBuffer _elem101; // required + _elem101 = iprot.readBinary(); + this.keys.add(_elem101); } iprot.readListEnd(); } @@ -9175,9 +9175,9 @@ public class Cassandra { oprot.writeFieldBegin(KEYS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.keys.size())); - for (ByteBuffer _iter98 : this.keys) + for (ByteBuffer _iter102 : this.keys) { - oprot.writeBinary(_iter98); + oprot.writeBinary(_iter102); } oprot.writeListEnd(); } @@ -9766,26 +9766,26 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map99 = iprot.readMapBegin(); - this.success = new HashMap>(2*_map99.size); - for (int _i100 = 0; _i100 < _map99.size; ++_i100) + org.apache.thrift.protocol.TMap _map103 = iprot.readMapBegin(); + this.success = new HashMap>(2*_map103.size); + for (int _i104 = 0; _i104 < _map103.size; ++_i104) { - ByteBuffer _key101; // required - List _val102; // required - _key101 = iprot.readBinary(); + ByteBuffer _key105; // required + List _val106; // required + _key105 = iprot.readBinary(); { - org.apache.thrift.protocol.TList _list103 = iprot.readListBegin(); - _val102 = new ArrayList(_list103.size); - for (int _i104 = 0; _i104 < _list103.size; ++_i104) + org.apache.thrift.protocol.TList _list107 = iprot.readListBegin(); + _val106 = new ArrayList(_list107.size); + for (int _i108 = 0; _i108 < _list107.size; ++_i108) { - ColumnOrSuperColumn _elem105; // required - _elem105 = new ColumnOrSuperColumn(); - _elem105.read(iprot); - _val102.add(_elem105); + ColumnOrSuperColumn _elem109; // required + _elem109 = new ColumnOrSuperColumn(); + _elem109.read(iprot); + _val106.add(_elem109); } iprot.readListEnd(); } - this.success.put(_key101, _val102); + this.success.put(_key105, _val106); } iprot.readMapEnd(); } @@ -9835,14 +9835,14 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.success.size())); - for (Map.Entry> _iter106 : this.success.entrySet()) + for (Map.Entry> _iter110 : this.success.entrySet()) { - oprot.writeBinary(_iter106.getKey()); + oprot.writeBinary(_iter110.getKey()); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter106.getValue().size())); - for (ColumnOrSuperColumn _iter107 : _iter106.getValue()) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter110.getValue().size())); + for (ColumnOrSuperColumn _iter111 : _iter110.getValue()) { - _iter107.write(oprot); + _iter111.write(oprot); } oprot.writeListEnd(); } @@ -10430,13 +10430,13 @@ public class Cassandra { case 1: // KEYS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list108 = iprot.readListBegin(); - this.keys = new ArrayList(_list108.size); - for (int _i109 = 0; _i109 < _list108.size; ++_i109) + org.apache.thrift.protocol.TList _list112 = iprot.readListBegin(); + this.keys = new ArrayList(_list112.size); + for (int _i113 = 0; _i113 < _list112.size; ++_i113) { - ByteBuffer _elem110; // required - _elem110 = iprot.readBinary(); - this.keys.add(_elem110); + ByteBuffer _elem114; // required + _elem114 = iprot.readBinary(); + this.keys.add(_elem114); } iprot.readListEnd(); } @@ -10486,9 +10486,9 @@ public class Cassandra { oprot.writeFieldBegin(KEYS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.keys.size())); - for (ByteBuffer _iter111 : this.keys) + for (ByteBuffer _iter115 : this.keys) { - oprot.writeBinary(_iter111); + oprot.writeBinary(_iter115); } oprot.writeListEnd(); } @@ -11073,15 +11073,15 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map112 = iprot.readMapBegin(); - this.success = new HashMap(2*_map112.size); - for (int _i113 = 0; _i113 < _map112.size; ++_i113) + org.apache.thrift.protocol.TMap _map116 = iprot.readMapBegin(); + this.success = new HashMap(2*_map116.size); + for (int _i117 = 0; _i117 < _map116.size; ++_i117) { - ByteBuffer _key114; // required - int _val115; // required - _key114 = iprot.readBinary(); - _val115 = iprot.readI32(); - this.success.put(_key114, _val115); + ByteBuffer _key118; // required + int _val119; // required + _key118 = iprot.readBinary(); + _val119 = iprot.readI32(); + this.success.put(_key118, _val119); } iprot.readMapEnd(); } @@ -11131,10 +11131,10 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, this.success.size())); - for (Map.Entry _iter116 : this.success.entrySet()) + for (Map.Entry _iter120 : this.success.entrySet()) { - oprot.writeBinary(_iter116.getKey()); - oprot.writeI32(_iter116.getValue()); + oprot.writeBinary(_iter120.getKey()); + oprot.writeI32(_iter120.getValue()); } oprot.writeMapEnd(); } @@ -12318,14 +12318,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list117 = iprot.readListBegin(); - this.success = new ArrayList(_list117.size); - for (int _i118 = 0; _i118 < _list117.size; ++_i118) + org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); + this.success = new ArrayList(_list121.size); + for (int _i122 = 0; _i122 < _list121.size; ++_i122) { - KeySlice _elem119; // required - _elem119 = new KeySlice(); - _elem119.read(iprot); - this.success.add(_elem119); + KeySlice _elem123; // required + _elem123 = new KeySlice(); + _elem123.read(iprot); + this.success.add(_elem123); } iprot.readListEnd(); } @@ -12375,9 +12375,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KeySlice _iter120 : this.success) + for (KeySlice _iter124 : this.success) { - _iter120.write(oprot); + _iter124.write(oprot); } oprot.writeListEnd(); } @@ -13570,14 +13570,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - this.success = new ArrayList(_list121.size); - for (int _i122 = 0; _i122 < _list121.size; ++_i122) + org.apache.thrift.protocol.TList _list125 = iprot.readListBegin(); + this.success = new ArrayList(_list125.size); + for (int _i126 = 0; _i126 < _list125.size; ++_i126) { - KeySlice _elem123; // required - _elem123 = new KeySlice(); - _elem123.read(iprot); - this.success.add(_elem123); + KeySlice _elem127; // required + _elem127 = new KeySlice(); + _elem127.read(iprot); + this.success.add(_elem127); } iprot.readListEnd(); } @@ -13627,9 +13627,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KeySlice _iter124 : this.success) + for (KeySlice _iter128 : this.success) { - _iter124.write(oprot); + _iter128.write(oprot); } oprot.writeListEnd(); } @@ -14813,14 +14813,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list125 = iprot.readListBegin(); - this.success = new ArrayList(_list125.size); - for (int _i126 = 0; _i126 < _list125.size; ++_i126) + org.apache.thrift.protocol.TList _list129 = iprot.readListBegin(); + this.success = new ArrayList(_list129.size); + for (int _i130 = 0; _i130 < _list129.size; ++_i130) { - KeySlice _elem127; // required - _elem127 = new KeySlice(); - _elem127.read(iprot); - this.success.add(_elem127); + KeySlice _elem131; // required + _elem131 = new KeySlice(); + _elem131.read(iprot); + this.success.add(_elem131); } iprot.readListEnd(); } @@ -14870,9 +14870,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KeySlice _iter128 : this.success) + for (KeySlice _iter132 : this.success) { - _iter128.write(oprot); + _iter132.write(oprot); } oprot.writeListEnd(); } @@ -17817,8 +17817,6 @@ public class Cassandra { private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -19717,38 +19715,38 @@ public class Cassandra { case 1: // MUTATION_MAP if (field.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map129 = iprot.readMapBegin(); - this.mutation_map = new HashMap>>(2*_map129.size); - for (int _i130 = 0; _i130 < _map129.size; ++_i130) + org.apache.thrift.protocol.TMap _map133 = iprot.readMapBegin(); + this.mutation_map = new HashMap>>(2*_map133.size); + for (int _i134 = 0; _i134 < _map133.size; ++_i134) { - ByteBuffer _key131; // required - Map> _val132; // required - _key131 = iprot.readBinary(); + ByteBuffer _key135; // required + Map> _val136; // required + _key135 = iprot.readBinary(); { - org.apache.thrift.protocol.TMap _map133 = iprot.readMapBegin(); - _val132 = new HashMap>(2*_map133.size); - for (int _i134 = 0; _i134 < _map133.size; ++_i134) + org.apache.thrift.protocol.TMap _map137 = iprot.readMapBegin(); + _val136 = new HashMap>(2*_map137.size); + for (int _i138 = 0; _i138 < _map137.size; ++_i138) { - String _key135; // required - List _val136; // required - _key135 = iprot.readString(); + String _key139; // required + List _val140; // required + _key139 = iprot.readString(); { - org.apache.thrift.protocol.TList _list137 = iprot.readListBegin(); - _val136 = new ArrayList(_list137.size); - for (int _i138 = 0; _i138 < _list137.size; ++_i138) + org.apache.thrift.protocol.TList _list141 = iprot.readListBegin(); + _val140 = new ArrayList(_list141.size); + for (int _i142 = 0; _i142 < _list141.size; ++_i142) { - Mutation _elem139; // required - _elem139 = new Mutation(); - _elem139.read(iprot); - _val136.add(_elem139); + Mutation _elem143; // required + _elem143 = new Mutation(); + _elem143.read(iprot); + _val140.add(_elem143); } iprot.readListEnd(); } - _val132.put(_key135, _val136); + _val136.put(_key139, _val140); } iprot.readMapEnd(); } - this.mutation_map.put(_key131, _val132); + this.mutation_map.put(_key135, _val136); } iprot.readMapEnd(); } @@ -19782,19 +19780,19 @@ public class Cassandra { oprot.writeFieldBegin(MUTATION_MAP_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.mutation_map.size())); - for (Map.Entry>> _iter140 : this.mutation_map.entrySet()) + for (Map.Entry>> _iter144 : this.mutation_map.entrySet()) { - oprot.writeBinary(_iter140.getKey()); + oprot.writeBinary(_iter144.getKey()); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter140.getValue().size())); - for (Map.Entry> _iter141 : _iter140.getValue().entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter144.getValue().size())); + for (Map.Entry> _iter145 : _iter144.getValue().entrySet()) { - oprot.writeString(_iter141.getKey()); + oprot.writeString(_iter145.getKey()); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter141.getValue().size())); - for (Mutation _iter142 : _iter141.getValue()) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter145.getValue().size())); + for (Mutation _iter146 : _iter145.getValue()) { - _iter142.write(oprot); + _iter146.write(oprot); } oprot.writeListEnd(); } @@ -21703,25 +21701,25 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map143 = iprot.readMapBegin(); - this.success = new HashMap>(2*_map143.size); - for (int _i144 = 0; _i144 < _map143.size; ++_i144) + org.apache.thrift.protocol.TMap _map147 = iprot.readMapBegin(); + this.success = new HashMap>(2*_map147.size); + for (int _i148 = 0; _i148 < _map147.size; ++_i148) { - String _key145; // required - List _val146; // required - _key145 = iprot.readString(); + String _key149; // required + List _val150; // required + _key149 = iprot.readString(); { - org.apache.thrift.protocol.TList _list147 = iprot.readListBegin(); - _val146 = new ArrayList(_list147.size); - for (int _i148 = 0; _i148 < _list147.size; ++_i148) + org.apache.thrift.protocol.TList _list151 = iprot.readListBegin(); + _val150 = new ArrayList(_list151.size); + for (int _i152 = 0; _i152 < _list151.size; ++_i152) { - String _elem149; // required - _elem149 = iprot.readString(); - _val146.add(_elem149); + String _elem153; // required + _elem153 = iprot.readString(); + _val150.add(_elem153); } iprot.readListEnd(); } - this.success.put(_key145, _val146); + this.success.put(_key149, _val150); } iprot.readMapEnd(); } @@ -21755,14 +21753,14 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.success.size())); - for (Map.Entry> _iter150 : this.success.entrySet()) + for (Map.Entry> _iter154 : this.success.entrySet()) { - oprot.writeString(_iter150.getKey()); + oprot.writeString(_iter154.getKey()); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter150.getValue().size())); - for (String _iter151 : _iter150.getValue()) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter154.getValue().size())); + for (String _iter155 : _iter154.getValue()) { - oprot.writeString(_iter151); + oprot.writeString(_iter155); } oprot.writeListEnd(); } @@ -22361,14 +22359,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list152 = iprot.readListBegin(); - this.success = new ArrayList(_list152.size); - for (int _i153 = 0; _i153 < _list152.size; ++_i153) + org.apache.thrift.protocol.TList _list156 = iprot.readListBegin(); + this.success = new ArrayList(_list156.size); + for (int _i157 = 0; _i157 < _list156.size; ++_i157) { - KsDef _elem154; // required - _elem154 = new KsDef(); - _elem154.read(iprot); - this.success.add(_elem154); + KsDef _elem158; // required + _elem158 = new KsDef(); + _elem158.read(iprot); + this.success.add(_elem158); } iprot.readListEnd(); } @@ -22402,9 +22400,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KsDef _iter155 : this.success) + for (KsDef _iter159 : this.success) { - _iter155.write(oprot); + _iter159.write(oprot); } oprot.writeListEnd(); } @@ -24117,14 +24115,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list156 = iprot.readListBegin(); - this.success = new ArrayList(_list156.size); - for (int _i157 = 0; _i157 < _list156.size; ++_i157) + org.apache.thrift.protocol.TList _list160 = iprot.readListBegin(); + this.success = new ArrayList(_list160.size); + for (int _i161 = 0; _i161 < _list160.size; ++_i161) { - TokenRange _elem158; // required - _elem158 = new TokenRange(); - _elem158.read(iprot); - this.success.add(_elem158); + TokenRange _elem162; // required + _elem162 = new TokenRange(); + _elem162.read(iprot); + this.success.add(_elem162); } iprot.readListEnd(); } @@ -24158,9 +24156,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (TokenRange _iter159 : this.success) + for (TokenRange _iter163 : this.success) { - _iter159.write(oprot); + _iter163.write(oprot); } oprot.writeListEnd(); } @@ -24761,15 +24759,15 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map160 = iprot.readMapBegin(); - this.success = new HashMap(2*_map160.size); - for (int _i161 = 0; _i161 < _map160.size; ++_i161) + org.apache.thrift.protocol.TMap _map164 = iprot.readMapBegin(); + this.success = new HashMap(2*_map164.size); + for (int _i165 = 0; _i165 < _map164.size; ++_i165) { - String _key162; // required - String _val163; // required - _key162 = iprot.readString(); - _val163 = iprot.readString(); - this.success.put(_key162, _val163); + String _key166; // required + String _val167; // required + _key166 = iprot.readString(); + _val167 = iprot.readString(); + this.success.put(_key166, _val167); } iprot.readMapEnd(); } @@ -24803,10 +24801,10 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (Map.Entry _iter164 : this.success.entrySet()) + for (Map.Entry _iter168 : this.success.entrySet()) { - oprot.writeString(_iter164.getKey()); - oprot.writeString(_iter164.getValue()); + oprot.writeString(_iter168.getKey()); + oprot.writeString(_iter168.getValue()); } oprot.writeMapEnd(); } @@ -27610,13 +27608,13 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list165 = iprot.readListBegin(); - this.success = new ArrayList(_list165.size); - for (int _i166 = 0; _i166 < _list165.size; ++_i166) + org.apache.thrift.protocol.TList _list169 = iprot.readListBegin(); + this.success = new ArrayList(_list169.size); + for (int _i170 = 0; _i170 < _list169.size; ++_i170) { - String _elem167; // required - _elem167 = iprot.readString(); - this.success.add(_elem167); + String _elem171; // required + _elem171 = iprot.readString(); + this.success.add(_elem171); } iprot.readListEnd(); } @@ -27650,9 +27648,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (String _iter168 : this.success) + for (String _iter172 : this.success) { - oprot.writeString(_iter168); + oprot.writeString(_iter172); } oprot.writeListEnd(); } @@ -34789,13 +34787,13 @@ public class Cassandra { case 2: // VALUES if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list169 = iprot.readListBegin(); - this.values = new ArrayList(_list169.size); - for (int _i170 = 0; _i170 < _list169.size; ++_i170) + org.apache.thrift.protocol.TList _list173 = iprot.readListBegin(); + this.values = new ArrayList(_list173.size); + for (int _i174 = 0; _i174 < _list173.size; ++_i174) { - ByteBuffer _elem171; // required - _elem171 = iprot.readBinary(); - this.values.add(_elem171); + ByteBuffer _elem175; // required + _elem175 = iprot.readBinary(); + this.values.add(_elem175); } iprot.readListEnd(); } @@ -34828,9 +34826,9 @@ public class Cassandra { oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.values.size())); - for (ByteBuffer _iter172 : this.values) + for (ByteBuffer _iter176 : this.values) { - oprot.writeBinary(_iter172); + oprot.writeBinary(_iter176); } oprot.writeListEnd(); } @@ -34878,8 +34876,6 @@ public class Cassandra { private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java index 723562b775..7e183c79fc 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java @@ -44,6 +44,6 @@ import org.slf4j.LoggerFactory; public class Constants { - public static final String VERSION = "19.31.0"; + public static final String VERSION = "19.32.0"; } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java index 0a36673259..25e5f0ffcf 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java @@ -48,16 +48,19 @@ public class CqlPreparedResult implements org.apache.thrift.TBase variable_types; // required + public List variable_names; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ITEM_ID((short)1, "itemId"), COUNT((short)2, "count"), - VARIABLE_TYPES((short)3, "variable_types"); + VARIABLE_TYPES((short)3, "variable_types"), + VARIABLE_NAMES((short)4, "variable_names"); private static final Map byName = new HashMap(); @@ -78,6 +81,8 @@ public class CqlPreparedResult implements org.apache.thrift.TBase __this__variable_names = new ArrayList(); + for (String other_element : other.variable_names) { + __this__variable_names.add(other_element); + } + this.variable_names = __this__variable_names; + } } public CqlPreparedResult deepCopy() { @@ -178,6 +193,7 @@ public class CqlPreparedResult implements org.apache.thrift.TBase getVariable_namesIterator() { + return (this.variable_names == null) ? null : this.variable_names.iterator(); + } + + public void addToVariable_names(String elem) { + if (this.variable_names == null) { + this.variable_names = new ArrayList(); + } + this.variable_names.add(elem); + } + + public List getVariable_names() { + return this.variable_names; + } + + public CqlPreparedResult setVariable_names(List variable_names) { + this.variable_names = variable_names; + return this; + } + + public void unsetVariable_names() { + this.variable_names = null; + } + + /** Returns true if field variable_names is set (has been assigned a value) and false otherwise */ + public boolean isSetVariable_names() { + return this.variable_names != null; + } + + public void setVariable_namesIsSet(boolean value) { + if (!value) { + this.variable_names = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case ITEM_ID: @@ -291,6 +346,14 @@ public class CqlPreparedResult implements org.apache.thrift.TBase)value); + } + break; + } } @@ -305,6 +368,9 @@ public class CqlPreparedResult implements org.apache.thrift.TBase(_list90.size); + for (int _i91 = 0; _i91 < _list90.size; ++_i91) + { + String _elem92; // required + _elem92 = iprot.readString(); + this.variable_names.add(_elem92); + } + iprot.readListEnd(); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } @@ -511,9 +620,23 @@ public class CqlPreparedResult implements org.apache.thrift.TBase types = new ArrayList(prepared.boundTypes.size()); - for (AbstractType t : prepared.boundTypes) - types.add(TypeParser.getShortName(t)); - return new CqlPreparedResult(statementId, types.size()).setVariable_types(types); + assert prepared.statement.getBoundsTerms() == prepared.boundNames.size(); + List var_types = new ArrayList(prepared.boundNames.size()) ; + List var_names = new ArrayList(prepared.boundNames.size()); + for (CFDefinition.Name n : prepared.boundNames) + { + var_types.add(TypeParser.getShortName(n.type)); + var_names.add(n.name.toString()); + } + + CqlPreparedResult result = new CqlPreparedResult(statementId, prepared.boundNames.size()); + result.setVariable_types(var_types); + result.setVariable_names(var_names); + return result; } public static CqlResult processPrepared(CQLStatement statement, ClientState clientState, List variables) diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java index 0f06a66b43..2241b0589e 100644 --- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java @@ -147,20 +147,20 @@ public class BatchStatement extends ModificationStatement return batch; } - public ParsedStatement.Prepared prepare(AbstractType[] boundTypes) throws InvalidRequestException + public ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames) throws InvalidRequestException { // XXX: we use our knowledge that Modification don't create new statement upon call to prepare() for (ModificationStatement statement : statements) { - statement.prepare(boundTypes); + statement.prepare(boundNames); } - return new ParsedStatement.Prepared(this, Arrays.>asList(boundTypes)); + return new ParsedStatement.Prepared(this, Arrays.asList(boundNames)); } public ParsedStatement.Prepared prepare() throws InvalidRequestException { - AbstractType[] boundTypes = new AbstractType[getBoundsTerms()]; - return prepare(boundTypes); + CFDefinition.Name[] boundNames = new CFDefinition.Name[getBoundsTerms()]; + return prepare(boundNames); } public String toString() diff --git a/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java b/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java index f9f6c4f46a..4af3aa2612 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java @@ -145,18 +145,18 @@ public class DeleteStatement extends ModificationStatement return rm; } - public ParsedStatement.Prepared prepare(AbstractType[] boundTypes) throws InvalidRequestException + public ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames) throws InvalidRequestException { CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace(), columnFamily()); cfDef = metadata.getCfDef(); - UpdateStatement.processKeys(cfDef, whereClause, processedKeys, boundTypes); - return new ParsedStatement.Prepared(this, Arrays.>asList(boundTypes)); + UpdateStatement.processKeys(cfDef, whereClause, processedKeys, boundNames); + return new ParsedStatement.Prepared(this, Arrays.asList(boundNames)); } public ParsedStatement.Prepared prepare() throws InvalidRequestException { - AbstractType[] boundTypes = new AbstractType[getBoundsTerms()]; - return prepare(boundTypes); + CFDefinition.Name[] boundNames = new CFDefinition.Name[getBoundsTerms()]; + return prepare(boundNames); } public String toString() diff --git a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java index e5a9ffdb69..7899e41763 100644 --- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java @@ -127,5 +127,5 @@ public abstract class ModificationStatement extends CFStatement implements CQLSt */ public abstract List getMutations(ClientState clientState, List variables) throws InvalidRequestException; - public abstract ParsedStatement.Prepared prepare(AbstractType[] boundTypes) throws InvalidRequestException; + public abstract ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames) throws InvalidRequestException; } diff --git a/src/java/org/apache/cassandra/cql3/statements/ParsedStatement.java b/src/java/org/apache/cassandra/cql3/statements/ParsedStatement.java index 6f428b2909..e877aa9737 100644 --- a/src/java/org/apache/cassandra/cql3/statements/ParsedStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ParsedStatement.java @@ -45,17 +45,17 @@ public abstract class ParsedStatement public static class Prepared { public final CQLStatement statement; - public final List> boundTypes; + public final List boundNames; - public Prepared(CQLStatement statement, List> boundTypes) + public Prepared(CQLStatement statement, List boundNames) { this.statement = statement; - this.boundTypes = boundTypes; + this.boundNames = boundNames; } public Prepared(CQLStatement statement) { - this(statement, Collections.>emptyList()); + this(statement, Collections.emptyList()); } } } diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java index 425cf17a48..d3fb50a0cc 100644 --- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java @@ -848,7 +848,7 @@ public class SelectStatement implements CQLStatement CFDefinition cfDef = cfm.getCfDef(); SelectStatement stmt = new SelectStatement(cfDef, getBoundsTerms(), parameters); - AbstractType[] types = new AbstractType[getBoundsTerms()]; + CFDefinition.Name[] names = new CFDefinition.Name[getBoundsTerms()]; // Select clause if (parameters.isCount) @@ -886,13 +886,13 @@ public class SelectStatement implements CQLStatement { for (Term value : rel.getInValues()) if (value.isBindMarker()) - types[value.bindIndex] = name.type; + names[value.bindIndex] = name; } else { Term value = rel.getValue(); if (value.isBindMarker()) - types[value.bindIndex] = name.type; + names[value.bindIndex] = name; } switch (name.kind) @@ -1027,7 +1027,7 @@ public class SelectStatement implements CQLStatement if (stmt.keyRestriction != null && stmt.keyRestriction.onToken && stmt.keyRestriction.isEquality() && stmt.keyRestriction.eqValues.size() > 1) throw new InvalidRequestException("Select using the token() function don't support IN clause"); - return new ParsedStatement.Prepared(stmt, Arrays.>asList(types)); + return new ParsedStatement.Prepared(stmt, Arrays.asList(names)); } private static boolean isReversedType(CFDefinition.Name name) diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java index e05a8234f1..097c07eef7 100644 --- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java @@ -234,7 +234,7 @@ public class UpdateStatement extends ModificationStatement } } - public ParsedStatement.Prepared prepare(AbstractType[] boundTypes) throws InvalidRequestException + public ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames) throws InvalidRequestException { boolean hasCommutativeOperation = false; @@ -274,7 +274,7 @@ public class UpdateStatement extends ModificationStatement Term value = columnValues.get(i); if (value.isBindMarker()) - boundTypes[value.bindIndex] = name.type; + boundNames[value.bindIndex] = name; switch (name.kind) { @@ -313,25 +313,25 @@ public class UpdateStatement extends ModificationStatement throw new InvalidRequestException(String.format("Multiple definition found for column %s", name)); Operation op = entry.getValue(); if (op.value.isBindMarker()) - boundTypes[op.value.bindIndex] = name.type; + boundNames[op.value.bindIndex] = name; processedColumns.put(name.name, op); break; } } - processKeys(cfDef, whereClause, processedKeys, boundTypes); + processKeys(cfDef, whereClause, processedKeys, boundNames); } - return new ParsedStatement.Prepared(this, Arrays.>asList(boundTypes)); + return new ParsedStatement.Prepared(this, Arrays.asList(boundNames)); } public ParsedStatement.Prepared prepare() throws InvalidRequestException { - AbstractType[] types = new AbstractType[getBoundsTerms()]; - return prepare(types); + CFDefinition.Name[] names = new CFDefinition.Name[getBoundsTerms()]; + return prepare(names); } // Reused by DeleteStatement - static void processKeys(CFDefinition cfDef, List keys, Map> processed, AbstractType[] types) throws InvalidRequestException + static void processKeys(CFDefinition cfDef, List keys, Map> processed, CFDefinition.Name[] names) throws InvalidRequestException { for (Relation rel : keys) { @@ -355,7 +355,7 @@ public class UpdateStatement extends ModificationStatement throw new InvalidRequestException(String.format("Multiple definition found for PRIMARY KEY part %s", name)); for (Term value : values) if (value.isBindMarker()) - types[value.bindIndex] = name.type; + names[value.bindIndex] = name; processed.put(name.name, values); break; case VALUE_ALIAS: