Elffuss BraidHub

kikocis/java-driver public

Merge pull request #548 from DevFactory/release/override-annotation-on-overriding-methods-fix-1

Code quality fix - @Override annotation should be used on any method overriding
Changesetf8d7c8f27f4594258a05fee9dfcd4909d151fe1ff2b2b0563ee11dd04c5c1ca5
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2016-01-04 17:50 +01:00
CommitterOlivier Michallat <olim7t@users.noreply.github.com> · 2016-01-04 17:50 +01:00
Parentse85d9dc25858, c2df6e94606c

Browse the files at this changeset

36 files changed

modified driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java +20 −0
@@ -38,40 +38,48 @@
3838 return (T) this;
3939 }
4040
41+ @Override
4142 protected ByteBuffer getValue(int i) {
4243 return values[i];
4344 }
4445
46+ @Override
4547 public T setBool(int i, boolean v) {
4648 checkType(i, DataType.Name.BOOLEAN);
4749 return setValue(i, TypeCodec.booleanCodec.serializeNoBoxing(v));
4850 }
4951
52+ @Override
5053 public T setInt(int i, int v) {
5154 checkType(i, DataType.Name.INT);
5255 return setValue(i, TypeCodec.intCodec.serializeNoBoxing(v));
5356 }
5457
58+ @Override
5559 public T setLong(int i, long v) {
5660 checkType(i, DataType.Name.BIGINT, DataType.Name.COUNTER);
5761 return setValue(i, TypeCodec.longCodec.serializeNoBoxing(v));
5862 }
5963
64+ @Override
6065 public T setDate(int i, Date v) {
6166 checkType(i, DataType.Name.TIMESTAMP);
6267 return setValue(i, v == null ? null : TypeCodec.dateCodec.serialize(v));
6368 }
6469
70+ @Override
6571 public T setFloat(int i, float v) {
6672 checkType(i, DataType.Name.FLOAT);
6773 return setValue(i, TypeCodec.floatCodec.serializeNoBoxing(v));
6874 }
6975
76+ @Override
7077 public T setDouble(int i, double v) {
7178 checkType(i, DataType.Name.DOUBLE);
7279 return setValue(i, TypeCodec.doubleCodec.serializeNoBoxing(v));
7380 }
7481
82+ @Override
7583 public T setString(int i, String v) {
7684 DataType.Name type = checkType(i, DataType.Name.VARCHAR, DataType.Name.TEXT, DataType.Name.ASCII);
7785 switch (type) {
@@ -85,25 +93,30 @@
8593 }
8694 }
8795
96+ @Override
8897 public T setBytes(int i, ByteBuffer v) {
8998 checkType(i, DataType.Name.BLOB);
9099 return setBytesUnsafe(i, v);
91100 }
92101
102+ @Override
93103 public T setBytesUnsafe(int i, ByteBuffer v) {
94104 return setValue(i, v == null ? null : v.duplicate());
95105 }
96106
107+ @Override
97108 public T setVarint(int i, BigInteger v) {
98109 checkType(i, DataType.Name.VARINT);
99110 return setValue(i, v == null ? null : TypeCodec.bigIntegerCodec.serialize(v));
100111 }
101112
113+ @Override
102114 public T setDecimal(int i, BigDecimal v) {
103115 checkType(i, DataType.Name.DECIMAL);
104116 return setValue(i, v == null ? null : TypeCodec.decimalCodec.serialize(v));
105117 }
106118
119+ @Override
107120 public T setUUID(int i, UUID v) {
108121 DataType.Name type = checkType(i, DataType.Name.UUID, DataType.Name.TIMEUUID);
109122
@@ -118,11 +131,13 @@
118131 : setValue(i, TypeCodec.timeUuidCodec.serialize(v));
119132 }
120133
134+ @Override
121135 public T setInet(int i, InetAddress v) {
122136 checkType(i, DataType.Name.INET);
123137 return setValue(i, v == null ? null : TypeCodec.inetCodec.serialize(v));
124138 }
125139
140+ @Override
126141 public <E> T setList(int i, List<E> v) {
127142 DataType type = getType(i);
128143 if (type.getName() != DataType.Name.LIST)
@@ -143,6 +158,7 @@
143158 return setValue(i, type.codec(protocolVersion).serialize(v));
144159 }
145160
161+ @Override
146162 public <K, V> T setMap(int i, Map<K, V> v) {
147163 DataType type = getType(i);
148164 if (type.getName() != DataType.Name.MAP)
@@ -165,6 +181,7 @@
165181 return setValue(i, type.codec(protocolVersion).serialize(v));
166182 }
167183
184+ @Override
168185 public <E> T setSet(int i, Set<E> v) {
169186 DataType type = getType(i);
170187 if (type.getName() != DataType.Name.SET)
@@ -184,6 +201,7 @@
184201 return setValue(i, type.codec(protocolVersion).serialize(v));
185202 }
186203
204+ @Override
187205 public T setUDTValue(int i, UDTValue v) {
188206 DataType type = getType(i);
189207 if (type.getName() != DataType.Name.UDT)
@@ -196,6 +214,7 @@
196214 return setValue(i, type.codec(ProtocolVersion.V3).serialize(v));
197215 }
198216
217+ @Override
199218 public T setTupleValue(int i, TupleValue v) {
200219 DataType type = getType(i);
201220 if (type.getName() != DataType.Name.TUPLE)
@@ -208,6 +227,7 @@
208227 return setValue(i, type.codec(ProtocolVersion.V3).serialize(v));
209228 }
210229
230+ @Override
211231 public T setToNull(int i) {
212232 return setValue(i, null);
213233 }
modified driver-core/src/main/java/com/datastax/driver/core/AbstractData.java +38 −0
@@ -55,19 +55,23 @@
5555 return wrapped;
5656 }
5757
58+ @Override
5859 protected ByteBuffer getValue(int i) {
5960 return values[i];
6061 }
6162
63+ @Override
6264 protected int getIndexOf(String name) {
6365 return getAllIndexesOf(name)[0];
6466 }
6567
68+ @Override
6669 public T setBool(int i, boolean v) {
6770 checkType(i, DataType.Name.BOOLEAN);
6871 return setValue(i, TypeCodec.booleanCodec.serializeNoBoxing(v));
6972 }
7073
74+ @Override
7175 public T setBool(String name, boolean v) {
7276 int[] indexes = getAllIndexesOf(name);
7377 ByteBuffer value = TypeCodec.booleanCodec.serializeNoBoxing(v);
@@ -78,11 +82,13 @@
7882 return wrapped;
7983 }
8084
85+ @Override
8186 public T setInt(int i, int v) {
8287 checkType(i, DataType.Name.INT);
8388 return setValue(i, TypeCodec.intCodec.serializeNoBoxing(v));
8489 }
8590
91+ @Override
8692 public T setInt(String name, int v) {
8793 int[] indexes = getAllIndexesOf(name);
8894 ByteBuffer value = TypeCodec.intCodec.serializeNoBoxing(v);
@@ -93,11 +99,13 @@
9399 return wrapped;
94100 }
95101
102+ @Override
96103 public T setLong(int i, long v) {
97104 checkType(i, DataType.Name.BIGINT, DataType.Name.COUNTER);
98105 return setValue(i, TypeCodec.longCodec.serializeNoBoxing(v));
99106 }
100107
108+ @Override
101109 public T setLong(String name, long v) {
102110 int[] indexes = getAllIndexesOf(name);
103111 ByteBuffer value = TypeCodec.longCodec.serializeNoBoxing(v);
@@ -108,11 +116,13 @@
108116 return wrapped;
109117 }
110118
119+ @Override
111120 public T setDate(int i, Date v) {
112121 checkType(i, DataType.Name.TIMESTAMP);
113122 return setValue(i, v == null ? null : TypeCodec.dateCodec.serialize(v));
114123 }
115124
125+ @Override
116126 public T setDate(String name, Date v) {
117127 int[] indexes = getAllIndexesOf(name);
118128 ByteBuffer value = v == null ? null : TypeCodec.dateCodec.serialize(v);
@@ -123,11 +133,13 @@
123133 return wrapped;
124134 }
125135
136+ @Override
126137 public T setFloat(int i, float v) {
127138 checkType(i, DataType.Name.FLOAT);
128139 return setValue(i, TypeCodec.floatCodec.serializeNoBoxing(v));
129140 }
130141
142+ @Override
131143 public T setFloat(String name, float v) {
132144 int[] indexes = getAllIndexesOf(name);
133145 ByteBuffer value = TypeCodec.floatCodec.serializeNoBoxing(v);
@@ -138,11 +150,13 @@
138150 return wrapped;
139151 }
140152
153+ @Override
141154 public T setDouble(int i, double v) {
142155 checkType(i, DataType.Name.DOUBLE);
143156 return setValue(i, TypeCodec.doubleCodec.serializeNoBoxing(v));
144157 }
145158
159+ @Override
146160 public T setDouble(String name, double v) {
147161 int[] indexes = getAllIndexesOf(name);
148162 ByteBuffer value = TypeCodec.doubleCodec.serializeNoBoxing(v);
@@ -153,6 +167,7 @@
153167 return wrapped;
154168 }
155169
170+ @Override
156171 public T setString(int i, String v) {
157172 DataType.Name type = checkType(i, DataType.Name.VARCHAR, DataType.Name.TEXT, DataType.Name.ASCII);
158173 switch (type) {
@@ -166,6 +181,7 @@
166181 }
167182 }
168183
184+ @Override
169185 public T setString(String name, String v) {
170186 int[] indexes = getAllIndexesOf(name);
171187 for (int i = 0; i < indexes.length; i++)
@@ -173,11 +189,13 @@
173189 return wrapped;
174190 }
175191
192+ @Override
176193 public T setBytes(int i, ByteBuffer v) {
177194 checkType(i, DataType.Name.BLOB);
178195 return setBytesUnsafe(i, v);
179196 }
180197
198+ @Override
181199 public T setBytes(String name, ByteBuffer v) {
182200 int[] indexes = getAllIndexesOf(name);
183201 ByteBuffer value = v == null ? null : v.duplicate();
@@ -188,10 +206,12 @@
188206 return wrapped;
189207 }
190208
209+ @Override
191210 public T setBytesUnsafe(int i, ByteBuffer v) {
192211 return setValue(i, v == null ? null : v.duplicate());
193212 }
194213
214+ @Override
195215 public T setBytesUnsafe(String name, ByteBuffer v) {
196216 int[] indexes = getAllIndexesOf(name);
197217 ByteBuffer value = v == null ? null : v.duplicate();
@@ -200,11 +220,13 @@
200220 return wrapped;
201221 }
202222
223+ @Override
203224 public T setVarint(int i, BigInteger v) {
204225 checkType(i, DataType.Name.VARINT);
205226 return setValue(i, v == null ? null : TypeCodec.bigIntegerCodec.serialize(v));
206227 }
207228
229+ @Override
208230 public T setVarint(String name, BigInteger v) {
209231 int[] indexes = getAllIndexesOf(name);
210232 ByteBuffer value = v == null ? null : TypeCodec.bigIntegerCodec.serialize(v);
@@ -215,11 +237,13 @@
215237 return wrapped;
216238 }
217239
240+ @Override
218241 public T setDecimal(int i, BigDecimal v) {
219242 checkType(i, DataType.Name.DECIMAL);
220243 return setValue(i, v == null ? null : TypeCodec.decimalCodec.serialize(v));
221244 }
222245
246+ @Override
223247 public T setDecimal(String name, BigDecimal v) {
224248 int[] indexes = getAllIndexesOf(name);
225249 ByteBuffer value = v == null ? null : TypeCodec.decimalCodec.serialize(v);
@@ -230,6 +254,7 @@
230254 return wrapped;
231255 }
232256
257+ @Override
233258 public T setUUID(int i, UUID v) {
234259 DataType.Name type = checkType(i, DataType.Name.UUID, DataType.Name.TIMEUUID);
235260
@@ -244,6 +269,7 @@
244269 : setValue(i, TypeCodec.timeUuidCodec.serialize(v));
245270 }
246271
272+ @Override
247273 public T setUUID(String name, UUID v) {
248274 int[] indexes = getAllIndexesOf(name);
249275 ByteBuffer value = v == null ? null : TypeCodec.uuidCodec.serialize(v);
@@ -256,11 +282,13 @@
256282 return wrapped;
257283 }
258284
285+ @Override
259286 public T setInet(int i, InetAddress v) {
260287 checkType(i, DataType.Name.INET);
261288 return setValue(i, v == null ? null : TypeCodec.inetCodec.serialize(v));
262289 }
263290
291+ @Override
264292 public T setInet(String name, InetAddress v) {
265293 int[] indexes = getAllIndexesOf(name);
266294 ByteBuffer value = v == null ? null : TypeCodec.inetCodec.serialize(v);
@@ -286,6 +314,7 @@
286314 return wrapped;
287315 }
288316
317+ @Override
289318 public <E> T setList(int i, List<E> v) {
290319 DataType type = getType(i);
291320 if (type.getName() != DataType.Name.LIST)
@@ -306,6 +335,7 @@
306335 return setValue(i, type.codec(protocolVersion).serialize(v));
307336 }
308337
338+ @Override
309339 public <E> T setList(String name, List<E> v) {
310340 int[] indexes = getAllIndexesOf(name);
311341 for (int i = 0; i < indexes.length; i++)
@@ -313,6 +343,7 @@
313343 return wrapped;
314344 }
315345
346+ @Override
316347 public <K, V> T setMap(int i, Map<K, V> v) {
317348 DataType type = getType(i);
318349 if (type.getName() != DataType.Name.MAP)
@@ -335,6 +366,7 @@
335366 return setValue(i, type.codec(protocolVersion).serialize(v));
336367 }
337368
369+ @Override
338370 public <K, V> T setMap(String name, Map<K, V> v) {
339371 int[] indexes = getAllIndexesOf(name);
340372 for (int i = 0; i < indexes.length; i++)
@@ -342,6 +374,7 @@
342374 return wrapped;
343375 }
344376
377+ @Override
345378 public <E> T setSet(int i, Set<E> v) {
346379 DataType type = getType(i);
347380 if (type.getName() != DataType.Name.SET)
@@ -361,6 +394,7 @@
361394 return setValue(i, type.codec(protocolVersion).serialize(v));
362395 }
363396
397+ @Override
364398 public <E> T setSet(String name, Set<E> v) {
365399 int[] indexes = getAllIndexesOf(name);
366400 for (int i = 0; i < indexes.length; i++)
@@ -368,6 +402,7 @@
368402 return wrapped;
369403 }
370404
405+ @Override
371406 public T setUDTValue(int i, UDTValue v) {
372407 DataType type = getType(i);
373408 if (type.getName() != DataType.Name.UDT)
@@ -381,6 +416,7 @@
381416 return wrapped;
382417 }
383418
419+ @Override
384420 public T setUDTValue(String name, UDTValue v) {
385421 int[] indexes = getAllIndexesOf(name);
386422 for (int i = 0; i < indexes.length; i++)
@@ -388,6 +424,7 @@
388424 return wrapped;
389425 }
390426
427+ @Override
391428 public T setTupleValue(int i, TupleValue v) {
392429 DataType type = getType(i);
393430 if (type.getName() != DataType.Name.TUPLE)
@@ -401,6 +438,7 @@
401438 return wrapped;
402439 }
403440
441+ @Override
404442 public T setTupleValue(String name, TupleValue v) {
405443 int[] indexes = getAllIndexesOf(name);
406444 for (int i = 0; i < indexes.length; i++)
modified driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java +16 −0
@@ -100,10 +100,12 @@
100100 return new SinglePage(ColumnDefinitions.EMPTY, null, null, EMPTY_QUEUE, info);
101101 }
102102
103+ @Override
103104 public ColumnDefinitions getColumnDefinitions() {
104105 return metadata;
105106 }
106107
108+ @Override
107109 public List<Row> all() {
108110 if (isExhausted())
109111 return Collections.emptyList();
@@ -165,30 +167,37 @@
165167 this.rows = rows;
166168 }
167169
170+ @Override
168171 public boolean isExhausted() {
169172 return rows.isEmpty();
170173 }
171174
175+ @Override
172176 public Row one() {
173177 return ArrayBackedRow.fromData(metadata, tokenFactory, protocolVersion, rows.poll());
174178 }
175179
180+ @Override
176181 public int getAvailableWithoutFetching() {
177182 return rows.size();
178183 }
179184
185+ @Override
180186 public boolean isFullyFetched() {
181187 return true;
182188 }
183189
190+ @Override
184191 public ListenableFuture<Void> fetchMoreResults() {
185192 return MoreFutures.VOID_SUCCESS;
186193 }
187194
195+ @Override
188196 public ExecutionInfo getExecutionInfo() {
189197 return info;
190198 }
191199
200+ @Override
192201 public List<ExecutionInfo> getAllExecutionInfo() {
193202 return Collections.singletonList(info);
194203 }
@@ -240,16 +249,19 @@
240249 this.statement = statement;
241250 }
242251
252+ @Override
243253 public boolean isExhausted() {
244254 prepareNextRow();
245255 return currentPage.isEmpty();
246256 }
247257
258+ @Override
248259 public Row one() {
249260 prepareNextRow();
250261 return ArrayBackedRow.fromData(metadata, tokenFactory, protocolVersion, currentPage.poll());
251262 }
252263
264+ @Override
253265 public int getAvailableWithoutFetching() {
254266 int available = currentPage.size();
255267 for (Queue<List<ByteBuffer>> page : nextPages)
@@ -257,6 +269,7 @@
257269 return available;
258270 }
259271
272+ @Override
260273 public boolean isFullyFetched() {
261274 return fetchState == null;
262275 }
@@ -286,6 +299,7 @@
286299 }
287300 }
288301
302+ @Override
289303 public ListenableFuture<Void> fetchMoreResults() {
290304 return fetchMoreResults(this.fetchState);
291305 }
@@ -390,10 +404,12 @@
390404 return future;
391405 }
392406
407+ @Override
393408 public ExecutionInfo getExecutionInfo() {
394409 return infos.getLast();
395410 }
396411
412+ @Override
397413 public List<ExecutionInfo> getAllExecutionInfo() {
398414 return new ArrayList<ExecutionInfo>(infos);
399415 }
modified driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java +1 −0
@@ -87,6 +87,7 @@
8787 return getToken(metadata.getFirstIdx(name));
8888 }
8989
90+ @Override
9091 public Token getPartitionKeyToken() {
9192 int i = 0;
9293 for (ColumnDefinitions.Definition column : metadata) {
modified driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java +1 −0
@@ -34,6 +34,7 @@
3434 * This is only useful as a placeholder when no authentication is to be used.
3535 */
3636 public static final AuthProvider NONE = new AuthProvider() {
37+ @Override
3738 public Authenticator newAuthenticator(InetSocketAddress host) {
3839 throw new AuthenticationException(host,
3940 String.format("Host %s requires authentication, but no authenticator found in Cluster configuration", host));
modified driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java +83 −0
@@ -304,6 +304,7 @@
304304 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
305305 * @throws InvalidTypeException if column {@code i} is not of type BOOLEAN.
306306 */
307+ @Override
307308 public BoundStatement setBool(int i, boolean v) {
308309 return wrapper.setBool(i, v);
309310 }
@@ -320,6 +321,7 @@
320321 * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}.
321322 * @throws InvalidTypeException if (any one occurrence of) {@code name} is not of type BOOLEAN.
322323 */
324+ @Override
323325 public BoundStatement setBool(String name, boolean v) {
324326 return wrapper.setBool(name, v);
325327 }
@@ -333,6 +335,7 @@
333335 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
334336 * @throws InvalidTypeException if column {@code i} is not of type INT.
335337 */
338+ @Override
336339 public BoundStatement setInt(int i, int v) {
337340 return wrapper.setInt(i, v);
338341 }
@@ -349,6 +352,7 @@
349352 * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}.
350353 * @throws InvalidTypeException if (any one occurrence of) {@code name} is not of type INT.
351354 */
355+ @Override
352356 public BoundStatement setInt(String name, int v) {
353357 return wrapper.setInt(name, v);
354358 }
@@ -362,6 +366,7 @@
362366 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
363367 * @throws InvalidTypeException if column {@code i} is not of type BIGINT or COUNTER.
364368 */
369+ @Override
365370 public BoundStatement setLong(int i, long v) {
366371 return wrapper.setLong(i, v);
367372 }
@@ -379,6 +384,7 @@
379384 * @throws InvalidTypeException if (any occurrence of) {@code name} is
380385 * not of type BIGINT or COUNTER.
381386 */
387+ @Override
382388 public BoundStatement setLong(String name, long v) {
383389 return wrapper.setLong(name, v);
384390 }
@@ -392,6 +398,7 @@
392398 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
393399 * @throws InvalidTypeException if column {@code i} is not of type TIMESTAMP.
394400 */
401+ @Override
395402 public BoundStatement setDate(int i, Date v) {
396403 return wrapper.setDate(i, v);
397404 }
@@ -409,6 +416,7 @@
409416 * @throws InvalidTypeException if (any occurrence of) {@code name} is
410417 * not of type TIMESTAMP.
411418 */
419+ @Override
412420 public BoundStatement setDate(String name, Date v) {
413421 return wrapper.setDate(name, v);
414422 }
@@ -422,6 +430,7 @@
422430 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
423431 * @throws InvalidTypeException if column {@code i} is not of type FLOAT.
424432 */
433+ @Override
425434 public BoundStatement setFloat(int i, float v) {
426435 return wrapper.setFloat(i, v);
427436 }
@@ -439,6 +448,7 @@
439448 * @throws InvalidTypeException if (any occurrence of) {@code name} is
440449 * not of type FLOAT.
441450 */
451+ @Override
442452 public BoundStatement setFloat(String name, float v) {
443453 return wrapper.setFloat(name, v);
444454 }
@@ -452,6 +462,7 @@
452462 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
453463 * @throws InvalidTypeException if column {@code i} is not of type DOUBLE.
454464 */
465+ @Override
455466 public BoundStatement setDouble(int i, double v) {
456467 return wrapper.setDouble(i, v);
457468 }
@@ -469,6 +480,7 @@
469480 * @throws InvalidTypeException if (any occurrence of) {@code name} is
470481 * not of type DOUBLE.
471482 */
483+ @Override
472484 public BoundStatement setDouble(String name, double v) {
473485 return wrapper.setDouble(name, v);
474486 }
@@ -483,6 +495,7 @@
483495 * @throws InvalidTypeException if column {@code i} is of neither of the
484496 * following types: VARCHAR, TEXT or ASCII.
485497 */
498+ @Override
486499 public BoundStatement setString(int i, String v) {
487500 return wrapper.setString(i, v);
488501 }
@@ -500,6 +513,7 @@
500513 * @throws InvalidTypeException if (any occurrence of) {@code name} is
501514 * of neither of the following types: VARCHAR, TEXT or ASCII.
502515 */
516+ @Override
503517 public BoundStatement setString(String name, String v) {
504518 return wrapper.setString(name, v);
505519 }
@@ -517,6 +531,7 @@
517531 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
518532 * @throws InvalidTypeException if column {@code i} is not of type BLOB.
519533 */
534+ @Override
520535 public BoundStatement setBytes(int i, ByteBuffer v) {
521536 return wrapper.setBytes(i, v);
522537 }
@@ -537,6 +552,7 @@
537552 * variable, that is if {@code !this.preparedStatement().variables().names().contains(name)}.
538553 * @throws InvalidTypeException if (any occurrence of) {@code name} is not of type BLOB.
539554 */
555+ @Override
540556 public BoundStatement setBytes(String name, ByteBuffer v) {
541557 return wrapper.setBytes(name, v);
542558 }
@@ -554,6 +570,7 @@
554570 * @return this BoundStatement.
555571 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
556572 */
573+ @Override
557574 public BoundStatement setBytesUnsafe(int i, ByteBuffer v) {
558575 return wrapper.setBytesUnsafe(i, v);
559576 }
@@ -574,6 +591,7 @@
574591 * @throws IllegalArgumentException if {@code name} is not a prepared
575592 * variable, that is if {@code !this.preparedStatement().variables().names().contains(name)}.
576593 */
594+ @Override
577595 public BoundStatement setBytesUnsafe(String name, ByteBuffer v) {
578596 return wrapper.setBytesUnsafe(name, v);
579597 }
@@ -587,6 +605,7 @@
587605 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
588606 * @throws InvalidTypeException if column {@code i} is not of type VARINT.
589607 */
608+ @Override
590609 public BoundStatement setVarint(int i, BigInteger v) {
591610 return wrapper.setVarint(i, v);
592611 }
@@ -604,6 +623,7 @@
604623 * @throws InvalidTypeException if (any occurrence of) {@code name} is
605624 * not of type VARINT.
606625 */
626+ @Override
607627 public BoundStatement setVarint(String name, BigInteger v) {
608628 return wrapper.setVarint(name, v);
609629 }
@@ -617,6 +637,7 @@
617637 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
618638 * @throws InvalidTypeException if column {@code i} is not of type DECIMAL.
619639 */
640+ @Override
620641 public BoundStatement setDecimal(int i, BigDecimal v) {
621642 return wrapper.setDecimal(i, v);
622643 }
@@ -634,6 +655,7 @@
634655 * @throws InvalidTypeException if (any occurrence of) {@code name} is
635656 * not of type DECIMAL.
636657 */
658+ @Override
637659 public BoundStatement setDecimal(String name, BigDecimal v) {
638660 return wrapper.setDecimal(name, v);
639661 }
@@ -649,6 +671,7 @@
649671 * TIMEUUID, or if column {@code i} is of type TIMEUUID but {@code v} is
650672 * not a type 1 UUID.
651673 */
674+ @Override
652675 public BoundStatement setUUID(int i, UUID v) {
653676 return wrapper.setUUID(i, v);
654677 }
@@ -667,6 +690,7 @@
667690 * not of type UUID or TIMEUUID, or if column {@code name} is of type
668691 * TIMEUUID but {@code v} is not a type 1 UUID.
669692 */
693+ @Override
670694 public BoundStatement setUUID(String name, UUID v) {
671695 return wrapper.setUUID(name, v);
672696 }
@@ -680,6 +704,7 @@
680704 * @throws IndexOutOfBoundsException if {@code i < 0 || i >= this.preparedStatement().variables().size()}.
681705 * @throws InvalidTypeException if column {@code i} is not of type INET.
682706 */
707+ @Override
683708 public BoundStatement setInet(int i, InetAddress v) {
684709 return wrapper.setInet(i, v);
685710 }
@@ -697,6 +722,7 @@
697722 * @throws InvalidTypeException if (any occurrence of) {@code name} is
698723 * not of type INET.
699724 */
725+ @Override
700726 public BoundStatement setInet(String name, InetAddress v) {
701727 return wrapper.setInet(name, v);
702728 }
@@ -795,6 +821,7 @@
795821 * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections
796822 * by CQL.
797823 */
824+ @Override
798825 public <T> BoundStatement setList(int i, List<T> v) {
799826 return wrapper.setList(i, v);
800827 }
@@ -818,6 +845,7 @@
818845 * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections
819846 * by CQL.
820847 */
848+ @Override
821849 public <T> BoundStatement setList(String name, List<T> v) {
822850 return wrapper.setList(name, v);
823851 }
@@ -839,6 +867,7 @@
839867 * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections
840868 * by CQL.
841869 */
870+ @Override
842871 public <K, V> BoundStatement setMap(int i, Map<K, V> v) {
843872 return wrapper.setMap(i, v);
844873 }
@@ -863,6 +892,7 @@
863892 * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections
864893 * by CQL.
865894 */
895+ @Override
866896 public <K, V> BoundStatement setMap(String name, Map<K, V> v) {
867897 return wrapper.setMap(name, v);
868898 }
@@ -883,6 +913,7 @@
883913 * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections
884914 * by CQL.
885915 */
916+ @Override
886917 public <T> BoundStatement setSet(int i, Set<T> v) {
887918 return wrapper.setSet(i, v);
888919 }
@@ -906,6 +937,7 @@
906937 * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections
907938 * by CQL.
908939 */
940+ @Override
909941 public <T> BoundStatement setSet(String name, Set<T> v) {
910942 return wrapper.setSet(name, v);
911943 }
@@ -920,6 +952,7 @@
920952 * @throws InvalidTypeException if value {@code i} is not a UDT value or if its definition
921953 * does not correspond to the one of {@code v}.
922954 */
955+ @Override
923956 public BoundStatement setUDTValue(int i, UDTValue v) {
924957 return wrapper.setUDTValue(i, v);
925958 }
@@ -937,6 +970,7 @@
937970 * not a UDT value or if the definition of column {@code name} does not correspond to
938971 * the one of {@code v}.
939972 */
973+ @Override
940974 public BoundStatement setUDTValue(String name, UDTValue v) {
941975 return wrapper.setUDTValue(name, v);
942976 }
@@ -951,6 +985,7 @@
951985 * @throws InvalidTypeException if value {@code i} is not a tuple value or if its types
952986 * do not correspond to the ones of {@code v}.
953987 */
988+ @Override
954989 public BoundStatement setTupleValue(int i, TupleValue v) {
955990 return wrapper.setTupleValue(i, v);
956991 }
@@ -968,6 +1003,7 @@
9681003 * not a tuple value or if the types of column {@code name} do not correspond to
9691004 * the ones of {@code v}.
9701005 */
1006+ @Override
9711007 public BoundStatement setTupleValue(String name, TupleValue v) {
9721008 return wrapper.setTupleValue(name, v);
9731009 }
@@ -981,6 +1017,7 @@
9811017 * @return this object.
9821018 * @throws IndexOutOfBoundsException if {@code i} is not a valid index for this object.
9831019 */
1020+ @Override
9841021 public BoundStatement setToNull(int i) {
9851022 return wrapper.setToNull(i);
9861023 }
@@ -995,6 +1032,7 @@
9951032 * @return this object.
9961033 * @throws IllegalArgumentException if {@code name} is not a valid name for this object.
9971034 */
1035+ @Override
9981036 public BoundStatement setToNull(String name) {
9991037 return wrapper.setToNull(name);
10001038 }
@@ -1002,6 +1040,7 @@
10021040 /**
10031041 * {@inheritDoc}
10041042 */
1043+ @Override
10051044 public boolean isNull(int i) {
10061045 return wrapper.isNull(i);
10071046 }
@@ -1009,6 +1048,7 @@
10091048 /**
10101049 * {@inheritDoc}
10111050 */
1051+ @Override
10121052 public boolean isNull(String name) {
10131053 return wrapper.isNull(name);
10141054 }
@@ -1023,6 +1063,7 @@
10231063 /**
10241064 * {@inheritDoc}
10251065 */
1066+ @Override
10261067 public boolean getBool(String name) {
10271068 return wrapper.getBool(name);
10281069 }
@@ -1030,6 +1071,7 @@
10301071 /**
10311072 * {@inheritDoc}
10321073 */
1074+ @Override
10331075 public int getInt(int i) {
10341076 return wrapper.getInt(i);
10351077 }
@@ -1037,6 +1079,7 @@
10371079 /**
10381080 * {@inheritDoc}
10391081 */
1082+ @Override
10401083 public int getInt(String name) {
10411084 return wrapper.getInt(name);
10421085 }
@@ -1044,6 +1087,7 @@
10441087 /**
10451088 * {@inheritDoc}
10461089 */
1090+ @Override
10471091 public long getLong(int i) {
10481092 return wrapper.getLong(i);
10491093 }
@@ -1051,6 +1095,7 @@
10511095 /**
10521096 * {@inheritDoc}
10531097 */
1098+ @Override
10541099 public long getLong(String name) {
10551100 return wrapper.getLong(name);
10561101 }
@@ -1058,6 +1103,7 @@
10581103 /**
10591104 * {@inheritDoc}
10601105 */
1106+ @Override
10611107 public Date getDate(int i) {
10621108 return wrapper.getDate(i);
10631109 }
@@ -1065,6 +1111,7 @@
10651111 /**
10661112 * {@inheritDoc}
10671113 */
1114+ @Override
10681115 public Date getDate(String name) {
10691116 return wrapper.getDate(name);
10701117 }
@@ -1072,6 +1119,7 @@
10721119 /**
10731120 * {@inheritDoc}
10741121 */
1122+ @Override
10751123 public float getFloat(int i) {
10761124 return wrapper.getFloat(i);
10771125 }
@@ -1079,6 +1127,7 @@
10791127 /**
10801128 * {@inheritDoc}
10811129 */
1130+ @Override
10821131 public float getFloat(String name) {
10831132 return wrapper.getFloat(name);
10841133 }
@@ -1086,6 +1135,7 @@
10861135 /**
10871136 * {@inheritDoc}
10881137 */
1138+ @Override
10891139 public double getDouble(int i) {
10901140 return wrapper.getDouble(i);
10911141 }
@@ -1093,6 +1143,7 @@
10931143 /**
10941144 * {@inheritDoc}
10951145 */
1146+ @Override
10961147 public double getDouble(String name) {
10971148 return wrapper.getDouble(name);
10981149 }
@@ -1100,6 +1151,7 @@
11001151 /**
11011152 * {@inheritDoc}
11021153 */
1154+ @Override
11031155 public ByteBuffer getBytesUnsafe(int i) {
11041156 return wrapper.getBytesUnsafe(i);
11051157 }
@@ -1107,6 +1159,7 @@
11071159 /**
11081160 * {@inheritDoc}
11091161 */
1162+ @Override
11101163 public ByteBuffer getBytesUnsafe(String name) {
11111164 return wrapper.getBytesUnsafe(name);
11121165 }
@@ -1114,6 +1167,7 @@
11141167 /**
11151168 * {@inheritDoc}
11161169 */
1170+ @Override
11171171 public ByteBuffer getBytes(int i) {
11181172 return wrapper.getBytes(i);
11191173 }
@@ -1121,6 +1175,7 @@
11211175 /**
11221176 * {@inheritDoc}
11231177 */
1178+ @Override
11241179 public ByteBuffer getBytes(String name) {
11251180 return wrapper.getBytes(name);
11261181 }
@@ -1128,6 +1183,7 @@
11281183 /**
11291184 * {@inheritDoc}
11301185 */
1186+ @Override
11311187 public String getString(int i) {
11321188 return wrapper.getString(i);
11331189 }
@@ -1135,6 +1191,7 @@
11351191 /**
11361192 * {@inheritDoc}
11371193 */
1194+ @Override
11381195 public String getString(String name) {
11391196 return wrapper.getString(name);
11401197 }
@@ -1142,6 +1199,7 @@
11421199 /**
11431200 * {@inheritDoc}
11441201 */
1202+ @Override
11451203 public BigInteger getVarint(int i) {
11461204 return wrapper.getVarint(i);
11471205 }
@@ -1149,6 +1207,7 @@
11491207 /**
11501208 * {@inheritDoc}
11511209 */
1210+ @Override
11521211 public BigInteger getVarint(String name) {
11531212 return wrapper.getVarint(name);
11541213 }
@@ -1156,6 +1215,7 @@
11561215 /**
11571216 * {@inheritDoc}
11581217 */
1218+ @Override
11591219 public BigDecimal getDecimal(int i) {
11601220 return wrapper.getDecimal(i);
11611221 }
@@ -1163,6 +1223,7 @@
11631223 /**
11641224 * {@inheritDoc}
11651225 */
1226+ @Override
11661227 public BigDecimal getDecimal(String name) {
11671228 return wrapper.getDecimal(name);
11681229 }
@@ -1170,6 +1231,7 @@
11701231 /**
11711232 * {@inheritDoc}
11721233 */
1234+ @Override
11731235 public UUID getUUID(int i) {
11741236 return wrapper.getUUID(i);
11751237 }
@@ -1177,6 +1239,7 @@
11771239 /**
11781240 * {@inheritDoc}
11791241 */
1242+ @Override
11801243 public UUID getUUID(String name) {
11811244 return wrapper.getUUID(name);
11821245 }
@@ -1184,6 +1247,7 @@
11841247 /**
11851248 * {@inheritDoc}
11861249 */
1250+ @Override
11871251 public InetAddress getInet(int i) {
11881252 return wrapper.getInet(i);
11891253 }
@@ -1191,6 +1255,7 @@
11911255 /**
11921256 * {@inheritDoc}
11931257 */
1258+ @Override
11941259 public InetAddress getInet(String name) {
11951260 return wrapper.getInet(name);
11961261 }
@@ -1198,6 +1263,7 @@
11981263 /**
11991264 * {@inheritDoc}
12001265 */
1266+ @Override
12011267 public <T> List<T> getList(int i, Class<T> elementsClass) {
12021268 return wrapper.getList(i, elementsClass);
12031269 }
@@ -1205,6 +1271,7 @@
12051271 /**
12061272 * {@inheritDoc}
12071273 */
1274+ @Override
12081275 public <T> List<T> getList(int i, TypeToken<T> elementsType) {
12091276 return wrapper.getList(i, elementsType);
12101277 }
@@ -1212,6 +1279,7 @@
12121279 /**
12131280 * {@inheritDoc}
12141281 */
1282+ @Override
12151283 public <T> List<T> getList(String name, Class<T> elementsClass) {
12161284 return wrapper.getList(name, elementsClass);
12171285 }
@@ -1219,6 +1287,7 @@
12191287 /**
12201288 * {@inheritDoc}
12211289 */
1290+ @Override
12221291 public <T> List<T> getList(String name, TypeToken<T> elementsType) {
12231292 return wrapper.getList(name, elementsType);
12241293 }
@@ -1226,6 +1295,7 @@
12261295 /**
12271296 * {@inheritDoc}
12281297 */
1298+ @Override
12291299 public <T> Set<T> getSet(int i, Class<T> elementsClass) {
12301300 return wrapper.getSet(i, elementsClass);
12311301 }
@@ -1233,6 +1303,7 @@
12331303 /**
12341304 * {@inheritDoc}
12351305 */
1306+ @Override
12361307 public <T> Set<T> getSet(int i, TypeToken<T> elementsType) {
12371308 return wrapper.getSet(i, elementsType);
12381309 }
@@ -1240,6 +1311,7 @@
12401311 /**
12411312 * {@inheritDoc}
12421313 */
1314+ @Override
12431315 public <T> Set<T> getSet(String name, Class<T> elementsClass) {
12441316 return wrapper.getSet(name, elementsClass);
12451317 }
@@ -1247,6 +1319,7 @@
12471319 /**
12481320 * {@inheritDoc}
12491321 */
1322+ @Override
12501323 public <T> Set<T> getSet(String name, TypeToken<T> elementsType) {
12511324 return wrapper.getSet(name, elementsType);
12521325 }
@@ -1254,6 +1327,7 @@
12541327 /**
12551328 * {@inheritDoc}
12561329 */
1330+ @Override
12571331 public <K, V> Map<K, V> getMap(int i, Class<K> keysClass, Class<V> valuesClass) {
12581332 return wrapper.getMap(i, keysClass, valuesClass);
12591333 }
@@ -1261,6 +1335,7 @@
12611335 /**
12621336 * {@inheritDoc}
12631337 */
1338+ @Override
12641339 public <K, V> Map<K, V> getMap(int i, TypeToken<K> keysType, TypeToken<V> valuesType) {
12651340 return wrapper.getMap(i, keysType, valuesType);
12661341 }
@@ -1268,6 +1343,7 @@
12681343 /**
12691344 * {@inheritDoc}
12701345 */
1346+ @Override
12711347 public <K, V> Map<K, V> getMap(String name, Class<K> keysClass, Class<V> valuesClass) {
12721348 return wrapper.getMap(name, keysClass, valuesClass);
12731349 }
@@ -1275,6 +1351,7 @@
12751351 /**
12761352 * {@inheritDoc}
12771353 */
1354+ @Override
12781355 public <K, V> Map<K, V> getMap(String name, TypeToken<K> keysType, TypeToken<V> valuesType) {
12791356 return wrapper.getMap(name, keysType, valuesType);
12801357 }
@@ -1282,6 +1359,7 @@
12821359 /**
12831360 * {@inheritDoc}
12841361 */
1362+ @Override
12851363 public UDTValue getUDTValue(int i) {
12861364 return wrapper.getUDTValue(i);
12871365 }
@@ -1289,6 +1367,7 @@
12891367 /**
12901368 * {@inheritDoc}
12911369 */
1370+ @Override
12921371 public UDTValue getUDTValue(String name) {
12931372 return wrapper.getUDTValue(name);
12941373 }
@@ -1296,6 +1375,7 @@
12961375 /**
12971376 * {@inheritDoc}
12981377 */
1378+ @Override
12991379 public TupleValue getTupleValue(int i) {
13001380 return wrapper.getTupleValue(i);
13011381 }
@@ -1303,6 +1383,7 @@
13031383 /**
13041384 * {@inheritDoc}
13051385 */
1386+ @Override
13061387 public TupleValue getTupleValue(String name) {
13071388 return wrapper.getTupleValue(name);
13081389 }
@@ -1310,6 +1391,7 @@
13101391 /**
13111392 * {@inheritDoc}
13121393 */
1394+ @Override
13131395 public Object getObject(int i) {
13141396 return wrapper.getObject(i);
13151397 }
@@ -1317,6 +1399,7 @@
13171399 /**
13181400 * {@inheritDoc}
13191401 */
1402+ @Override
13201403 public Object getObject(String name) {
13211404 return wrapper.getObject(name);
13221405 }
modified driver-core/src/main/java/com/datastax/driver/core/CloseFuture.java +2 −0
@@ -72,10 +72,12 @@
7272 this.futures = futures;
7373
7474 Futures.addCallback(Futures.allAsList(futures), new FutureCallback<List<Void>>() {
75+ @Override
7576 public void onFailure(Throwable t) {
7677 Forwarding.this.setException(t);
7778 }
7879
80+ @Override
7981 public void onSuccess(List<Void> v) {
8082 Forwarding.this.onFuturesDone();
8183 }
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +13 −0
@@ -548,6 +548,7 @@
548548 * <p/>
549549 * This method is a shortcut for {@code closeAsync().get()}.
550550 */
551+ @Override
551552 public void close() {
552553 try {
553554 closeAsync().get();
@@ -1814,10 +1815,12 @@
18141815 void startPeriodicReconnectionAttempt(final Host host, final boolean isHostAddition) {
18151816 new AbstractReconnectionHandler(host.toString(), reconnectionExecutor, reconnectionPolicy().newSchedule(), host.reconnectionAttempt) {
18161817
1818+ @Override
18171819 protected Connection tryReconnect() throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException {
18181820 return connectionFactory.open(host);
18191821 }
18201822
1823+ @Override
18211824 protected void onReconnection(Connection connection) {
18221825 // Make sure we have up-to-date infos on that host before adding it (so we typically
18231826 // catch that an upgraded node uses a new cassandra version).
@@ -1839,17 +1842,20 @@
18391842 }
18401843 }
18411844
1845+ @Override
18421846 protected boolean onConnectionException(ConnectionException e, long nextDelayMs) {
18431847 if (logger.isDebugEnabled())
18441848 logger.debug("Failed reconnection to {} ({}), scheduling retry in {} milliseconds", host, e.getMessage(), nextDelayMs);
18451849 return true;
18461850 }
18471851
1852+ @Override
18481853 protected boolean onUnknownException(Exception e, long nextDelayMs) {
18491854 logger.error(String.format("Unknown error during reconnection to %s, scheduling retry in %d milliseconds", host, nextDelayMs), e);
18501855 return true;
18511856 }
18521857
1858+ @Override
18531859 protected boolean onAuthenticationException(AuthenticationException e, long nextDelayMs) {
18541860 logger.error(String.format("Authentication error during reconnection to %s, scheduling retry in %d milliseconds", host, nextDelayMs), e);
18551861 return true;
@@ -1867,10 +1873,12 @@
18671873 // Setting an initial delay of 0 to start immediately, and all the exception handlers return false to prevent further attempts
18681874 new AbstractReconnectionHandler(host.toString(), reconnectionExecutor, reconnectionPolicy().newSchedule(), host.reconnectionAttempt, 0) {
18691875
1876+ @Override
18701877 protected Connection tryReconnect() throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException {
18711878 return connectionFactory.open(host);
18721879 }
18731880
1881+ @Override
18741882 protected void onReconnection(Connection connection) {
18751883 // Make sure we have up-to-date infos on that host before adding it (so we typically
18761884 // catch that an upgraded node uses a new cassandra version).
@@ -1889,17 +1897,20 @@
18891897 }
18901898 }
18911899
1900+ @Override
18921901 protected boolean onConnectionException(ConnectionException e, long nextDelayMs) {
18931902 if (logger.isDebugEnabled())
18941903 logger.debug("Failed one-time reconnection to {} ({})", host, e.getMessage());
18951904 return false;
18961905 }
18971906
1907+ @Override
18981908 protected boolean onUnknownException(Exception e, long nextDelayMs) {
18991909 logger.error(String.format("Unknown error during one-time reconnection to %s", host), e);
19001910 return false;
19011911 }
19021912
1913+ @Override
19031914 protected boolean onAuthenticationException(AuthenticationException e, long nextDelayMs) {
19041915 logger.error(String.format("Authentication error during one-time reconnection to %s", host), e);
19051916 return false;
@@ -2414,6 +2425,7 @@
24142425 * a netty worker, which we're going to shutdown. So creates some thread for that.
24152426 */
24162427 (new Thread("Shutdown-checker") {
2428+ @Override
24172429 public void run() {
24182430 // Just wait indefinitely on the the completion of the thread pools. Provided the user
24192431 // call force(), we'll never really block forever.
@@ -2605,6 +2617,7 @@
26052617 // probably should be fixed C* side, after which we'll be able to remove this.
26062618 final SettableFuture<?> future = SettableFuture.create();
26072619 scheduledTasksExecutor.schedule(new ExceptionCatchingRunnable() {
2620+ @Override
26082621 public void runMayThrow() throws Exception {
26092622 ListenableFuture<?> f = execute(task);
26102623 Futures.addCallback(f, new FutureCallback<Object>() {
modified driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java +20 −0
@@ -95,42 +95,51 @@
9595 return true;
9696 }
9797
98+ @Override
9899 public ColumnDefinitions getVariables() {
99100 return preparedId.metadata;
100101 }
101102
103+ @Override
102104 public BoundStatement bind(Object... values) {
103105 BoundStatement bs = new BoundStatement(this);
104106 return bs.bind(values);
105107 }
106108
109+ @Override
107110 public BoundStatement bind() {
108111 return new BoundStatement(this);
109112 }
110113
114+ @Override
111115 public PreparedStatement setRoutingKey(ByteBuffer routingKey) {
112116 this.routingKey = routingKey;
113117 return this;
114118 }
115119
120+ @Override
116121 public PreparedStatement setRoutingKey(ByteBuffer... routingKeyComponents) {
117122 this.routingKey = SimpleStatement.compose(routingKeyComponents);
118123 return this;
119124 }
120125
126+ @Override
121127 public ByteBuffer getRoutingKey() {
122128 return routingKey;
123129 }
124130
131+ @Override
125132 public PreparedStatement setConsistencyLevel(ConsistencyLevel consistency) {
126133 this.consistency = consistency;
127134 return this;
128135 }
129136
137+ @Override
130138 public ConsistencyLevel getConsistencyLevel() {
131139 return consistency;
132140 }
133141
142+ @Override
134143 public PreparedStatement setSerialConsistencyLevel(ConsistencyLevel serialConsistency) {
135144 if (serialConsistency != ConsistencyLevel.SERIAL && serialConsistency != ConsistencyLevel.LOCAL_SERIAL)
136145 throw new IllegalArgumentException();
@@ -138,50 +147,61 @@
138147 return this;
139148 }
140149
150+ @Override
141151 public ConsistencyLevel getSerialConsistencyLevel() {
142152 return serialConsistency;
143153 }
144154
155+ @Override
145156 public String getQueryString() {
146157 return query;
147158 }
148159
160+ @Override
149161 public String getQueryKeyspace() {
150162 return queryKeyspace;
151163 }
152164
165+ @Override
153166 public PreparedStatement enableTracing() {
154167 this.traceQuery = true;
155168 return this;
156169 }
157170
171+ @Override
158172 public PreparedStatement disableTracing() {
159173 this.traceQuery = false;
160174 return this;
161175 }
162176
177+ @Override
163178 public boolean isTracing() {
164179 return traceQuery;
165180 }
166181
182+ @Override
167183 public PreparedStatement setRetryPolicy(RetryPolicy policy) {
168184 this.retryPolicy = policy;
169185 return this;
170186 }
171187
188+ @Override
172189 public RetryPolicy getRetryPolicy() {
173190 return retryPolicy;
174191 }
175192
193+ @Override
176194 public PreparedId getPreparedId() {
177195 return preparedId;
178196 }
179197
198+ @Override
180199 public PreparedStatement setIdempotent(Boolean idempotent) {
181200 this.idempotent = idempotent;
182201 return this;
183202 }
184203
204+ @Override
185205 public Boolean isIdempotent() {
186206 return this.idempotent;
187207 }
modified driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java +2 −0
@@ -209,6 +209,7 @@
209209 * @throws QueryValidationException if the query is invalid (syntax error,
210210 * unauthorized or any other validation problem).
211211 */
212+ @Override
212213 public ResultSet getUninterruptibly() {
213214 try {
214215 return Uninterruptibles.getUninterruptibly(this);
@@ -241,6 +242,7 @@
241242 * different from a Cassandra timeout, which is a {@code
242243 * QueryExecutionException}).
243244 */
245+ @Override
244246 public ResultSet getUninterruptibly(long timeout, TimeUnit unit) throws TimeoutException {
245247 try {
246248 return Uninterruptibles.getUninterruptibly(this, timeout, unit);
modified driver-core/src/main/java/com/datastax/driver/core/FrameCompressor.java +4 −0
@@ -56,6 +56,7 @@
5656 Snappy.getNativeLibraryVersion();
5757 }
5858
59+ @Override
5960 public Frame compress(Frame frame) throws IOException {
6061 byte[] input = CBUtil.readRawBytes(frame.body);
6162 byte[] output = new byte[Snappy.maxCompressedLength(input.length)];
@@ -64,6 +65,7 @@
6465 return frame.with(Unpooled.wrappedBuffer(output, 0, written));
6566 }
6667
68+ @Override
6769 public Frame decompress(Frame frame) throws IOException {
6870 byte[] input = CBUtil.readRawBytes(frame.body);
6971
@@ -105,6 +107,7 @@
105107 decompressor = lz4Factory.fastDecompressor();
106108 }
107109
110+ @Override
108111 public Frame compress(Frame frame) throws IOException {
109112 byte[] input = CBUtil.readRawBytes(frame.body);
110113
@@ -124,6 +127,7 @@
124127 }
125128 }
126129
130+ @Override
127131 public Frame decompress(Frame frame) throws IOException {
128132 byte[] input = CBUtil.readRawBytes(frame.body);
129133
modified driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +1 −0
@@ -637,6 +637,7 @@
637637 for (final Connection connection : connections) {
638638 CloseFuture future = connection.closeAsync();
639639 future.addListener(new Runnable() {
640+ @Override
640641 public void run() {
641642 if (connection.state.compareAndSet(OPEN, GONE))
642643 open.decrementAndGet();
modified driver-core/src/main/java/com/datastax/driver/core/PlainTextAuthProvider.java +2 −0
@@ -77,6 +77,7 @@
7777 * @return an Authenticator instance which can be used to perform
7878 * authentication negotiations on behalf of the client
7979 */
80+ @Override
8081 public Authenticator newAuthenticator(InetSocketAddress host) {
8182 return new PlainTextAuthenticator(username, password);
8283 }
@@ -116,6 +117,7 @@
116117 // no-op, the server should send nothing anyway
117118 }
118119
120+ @Override
119121 Map<String, String> getCredentials() {
120122 return ImmutableMap.of("username", new String(username, Charsets.UTF_8),
121123 "password", new String(password, Charsets.UTF_8));
modified driver-core/src/main/java/com/datastax/driver/core/ReplicationStategy.java +3 −1
@@ -73,6 +73,7 @@
7373 this.replicationFactor = replicationFactor;
7474 }
7575
76+ @Override
7677 Map<Token, Set<Host>> computeTokenToReplicaMap(String keyspaceName, Map<Token, Host> tokenToPrimary, List<Token> ring) {
7778
7879 int rf = Math.min(replicationFactor, ring.size());
@@ -116,7 +117,8 @@
116117 this.replicationFactors = replicationFactors;
117118 }
118119
119- Map<Token, Set<Host>> computeTokenToReplicaMap(String keyspaceName, Map<Token, Host> tokenToPrimary, List<Token> ring) {
120+ @Override
121+ Map<Token, Set<Host>> computeTokenToReplicaMap(String keyspaceName, Map<Token, Host> tokenToPrimary, List<Token> ring) {
120122
121123 // This is essentially a copy of org.apache.cassandra.locator.NetworkTopologyStrategy
122124 Map<String, Set<String>> racks = getRacksInDcs(tokenToPrimary.values());
modified driver-core/src/main/java/com/datastax/driver/core/Requests.java +18 −0
@@ -36,10 +36,12 @@
3636 public static final String COMPRESSION_OPTION = "COMPRESSION";
3737
3838 public static final Message.Coder<Startup> coder = new Message.Coder<Startup>() {
39+ @Override
3940 public void encode(Startup msg, ByteBuf dest, ProtocolVersion version) {
4041 CBUtil.writeStringMap(msg.options, dest);
4142 }
4243
44+ @Override
4345 public int encodedSize(Startup msg, ProtocolVersion version) {
4446 return CBUtil.sizeOfStringMap(msg.options);
4547 }
@@ -68,11 +70,13 @@
6870
6971 public static final Message.Coder<Credentials> coder = new Message.Coder<Credentials>() {
7072
73+ @Override
7174 public void encode(Credentials msg, ByteBuf dest, ProtocolVersion version) {
7275 assert version == ProtocolVersion.V1;
7376 CBUtil.writeStringMap(msg.credentials, dest);
7477 }
7578
79+ @Override
7680 public int encodedSize(Credentials msg, ProtocolVersion version) {
7781 assert version == ProtocolVersion.V1;
7882 return CBUtil.sizeOfStringMap(msg.credentials);
@@ -90,9 +94,11 @@
9094 public static class Options extends Message.Request {
9195
9296 public static final Message.Coder<Options> coder = new Message.Coder<Options>() {
97+ @Override
9398 public void encode(Options msg, ByteBuf dest, ProtocolVersion version) {
9499 }
95100
101+ @Override
96102 public int encodedSize(Options msg, ProtocolVersion version) {
97103 return 0;
98104 }
@@ -111,11 +117,13 @@
111117 public static class Query extends Message.Request {
112118
113119 public static final Message.Coder<Query> coder = new Message.Coder<Query>() {
120+ @Override
114121 public void encode(Query msg, ByteBuf dest, ProtocolVersion version) {
115122 CBUtil.writeLongString(msg.query, dest);
116123 msg.options.encode(dest, version);
117124 }
118125
126+ @Override
119127 public int encodedSize(Query msg, ProtocolVersion version) {
120128 return CBUtil.sizeOfLongString(msg.query)
121129 + msg.options.encodedSize(version);
@@ -154,11 +162,13 @@
154162 public static class Execute extends Message.Request {
155163
156164 public static final Message.Coder<Execute> coder = new Message.Coder<Execute>() {
165+ @Override
157166 public void encode(Execute msg, ByteBuf dest, ProtocolVersion version) {
158167 CBUtil.writeBytes(msg.statementId.bytes, dest);
159168 msg.options.encode(dest, version);
160169 }
161170
171+ @Override
162172 public int encodedSize(Execute msg, ProtocolVersion version) {
163173 return CBUtil.sizeOfBytes(msg.statementId.bytes)
164174 + msg.options.encodedSize(version);
@@ -334,6 +344,7 @@
334344 public static class Batch extends Message.Request {
335345
336346 public static final Message.Coder<Batch> coder = new Message.Coder<Batch>() {
347+ @Override
337348 public void encode(Batch msg, ByteBuf dest, ProtocolVersion version) {
338349 int queries = msg.queryOrIdList.size();
339350 assert queries <= 0xFFFF;
@@ -355,6 +366,7 @@
355366 msg.options.encode(dest, version);
356367 }
357368
369+ @Override
358370 public int encodedSize(Batch msg, ProtocolVersion version) {
359371 int size = 3; // type + nb queries
360372 for (int i = 0; i < msg.queryOrIdList.size(); i++) {
@@ -487,10 +499,12 @@
487499
488500 public static final Message.Coder<Prepare> coder = new Message.Coder<Prepare>() {
489501
502+ @Override
490503 public void encode(Prepare msg, ByteBuf dest, ProtocolVersion version) {
491504 CBUtil.writeLongString(msg.query, dest);
492505 }
493506
507+ @Override
494508 public int encodedSize(Prepare msg, ProtocolVersion version) {
495509 return CBUtil.sizeOfLongString(msg.query);
496510 }
@@ -512,12 +526,14 @@
512526 public static class Register extends Message.Request {
513527
514528 public static final Message.Coder<Register> coder = new Message.Coder<Register>() {
529+ @Override
515530 public void encode(Register msg, ByteBuf dest, ProtocolVersion version) {
516531 dest.writeShort(msg.eventTypes.size());
517532 for (ProtocolEvent.Type type : msg.eventTypes)
518533 CBUtil.writeEnumValue(type, dest);
519534 }
520535
536+ @Override
521537 public int encodedSize(Register msg, ProtocolVersion version) {
522538 int size = 2;
523539 for (ProtocolEvent.Type type : msg.eventTypes)
@@ -543,10 +559,12 @@
543559
544560 public static final Message.Coder<AuthResponse> coder = new Message.Coder<AuthResponse>() {
545561
562+ @Override
546563 public void encode(AuthResponse response, ByteBuf dest, ProtocolVersion version) {
547564 CBUtil.writeValue(response.token, dest);
548565 }
549566
567+ @Override
550568 public int encodedSize(AuthResponse response, ProtocolVersion version) {
551569 return CBUtil.sizeOfValue(response.token);
552570 }
modified driver-core/src/main/java/com/datastax/driver/core/Responses.java +12 −0
@@ -132,6 +132,7 @@
132132 public static class Ready extends Message.Response {
133133
134134 public static final Message.Decoder<Ready> decoder = new Message.Decoder<Ready>() {
135+ @Override
135136 public Ready decode(ByteBuf body, ProtocolVersion version) {
136137 // TODO: Would it be cool to return a singleton? Check we don't need to
137138 // set the streamId or something
@@ -152,6 +153,7 @@
152153 public static class Authenticate extends Message.Response {
153154
154155 public static final Message.Decoder<Authenticate> decoder = new Message.Decoder<Authenticate>() {
156+ @Override
155157 public Authenticate decode(ByteBuf body, ProtocolVersion version) {
156158 String authenticator = CBUtil.readString(body);
157159 return new Authenticate(authenticator);
@@ -174,6 +176,7 @@
174176 public static class Supported extends Message.Response {
175177
176178 public static final Message.Decoder<Supported> decoder = new Message.Decoder<Supported>() {
179+ @Override
177180 public Supported decode(ByteBuf body, ProtocolVersion version) {
178181 return new Supported(CBUtil.readStringToStringListMap(body));
179182 }
@@ -210,6 +213,7 @@
210213 public static abstract class Result extends Message.Response {
211214
212215 public static final Message.Decoder<Result> decoder = new Message.Decoder<Result>() {
216+ @Override
213217 public Result decode(ByteBuf body, ProtocolVersion version) {
214218 Kind kind = Kind.fromId(body.readInt());
215219 return kind.subDecoder.decode(body, version);
@@ -268,6 +272,7 @@
268272 }
269273
270274 public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
275+ @Override
271276 public Result decode(ByteBuf body, ProtocolVersion version) {
272277 return new Void();
273278 }
@@ -288,6 +293,7 @@
288293 }
289294
290295 public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
296+ @Override
291297 public Result decode(ByteBuf body, ProtocolVersion version) {
292298 return new SetKeyspace(CBUtil.readString(body));
293299 }
@@ -393,6 +399,7 @@
393399 }
394400
395401 public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
402+ @Override
396403 public Result decode(ByteBuf body, ProtocolVersion version) {
397404
398405 Metadata metadata = Metadata.decode(body);
@@ -451,6 +458,7 @@
451458 public static class Prepared extends Result {
452459
453460 public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
461+ @Override
454462 public Result decode(ByteBuf body, ProtocolVersion version) {
455463 MD5Digest id = MD5Digest.wrap(CBUtil.readBytes(body));
456464 Rows.Metadata metadata = Rows.Metadata.decode(body);
@@ -498,6 +506,7 @@
498506 public final String targetName;
499507
500508 public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
509+ @Override
501510 public Result decode(ByteBuf body, ProtocolVersion version) {
502511 // Note: the CREATE KEYSPACE/TABLE/TYPE SCHEMA_CHANGE response is different from the SCHEMA_CHANGE EVENT type
503512 Change change;
@@ -541,6 +550,7 @@
541550 public static class Event extends Message.Response {
542551
543552 public static final Message.Decoder<Event> decoder = new Message.Decoder<Event>() {
553+ @Override
544554 public Event decode(ByteBuf body, ProtocolVersion version) {
545555 return new Event(ProtocolEvent.deserialize(body, version));
546556 }
@@ -562,6 +572,7 @@
562572 public static class AuthChallenge extends Message.Response {
563573
564574 public static final Message.Decoder<AuthChallenge> decoder = new Message.Decoder<AuthChallenge>() {
575+ @Override
565576 public AuthChallenge decode(ByteBuf body, ProtocolVersion version) {
566577 ByteBuffer b = CBUtil.readValue(body);
567578 if (b == null)
@@ -584,6 +595,7 @@
584595 public static class AuthSuccess extends Message.Response {
585596
586597 public static final Message.Decoder<AuthSuccess> decoder = new Message.Decoder<AuthSuccess>() {
598+ @Override
587599 public AuthSuccess decode(ByteBuf body, ProtocolVersion version) {
588600 ByteBuffer b = CBUtil.readValue(body);
589601 if (b == null)
modified driver-core/src/main/java/com/datastax/driver/core/Session.java +1 −0
@@ -309,6 +309,7 @@
309309 * If you want to do so, use {@link Cluster#close}, but note that it will
310310 * close all sessions created from that cluster.
311311 */
312+ @Override
312313 public void close();
313314
314315 /**
modified driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +15 −0
@@ -62,6 +62,7 @@
6262 this.poolsState = new HostConnectionPool.PoolState();
6363 }
6464
65+ @Override
6566 public Session init() {
6667 try {
6768 return Uninterruptibles.getUninterruptibly(initAsync());
@@ -70,6 +71,7 @@
7071 }
7172 }
7273
74+ @Override
7375 public ListenableFuture<Session> initAsync() {
7476 // If we haven't initialized the cluster, do it now
7577 cluster.init();
@@ -117,10 +119,12 @@
117119 return Futures.allAsList(futures);
118120 }
119121
122+ @Override
120123 public String getLoggedKeyspace() {
121124 return poolsState.keyspace;
122125 }
123126
127+ @Override
124128 public ResultSetFuture executeAsync(final Statement statement) {
125129 if (isInit) {
126130 DefaultResultSetFuture future = new DefaultResultSetFuture(this, cluster.manager.protocolVersion(), makeRequestMessage(statement, null));
@@ -143,12 +147,14 @@
143147 }
144148 }
145149
150+ @Override
146151 public ListenableFuture<PreparedStatement> prepareAsync(String query) {
147152 Connection.Future future = new Connection.Future(new Requests.Prepare(query));
148153 execute(future, Statement.DEFAULT);
149154 return toPreparedStatement(query, future);
150155 }
151156
157+ @Override
152158 public CloseFuture closeAsync() {
153159 CloseFuture future = closeFuture.get();
154160 if (future != null)
@@ -168,20 +174,24 @@
168174 : closeFuture.get(); // We raced, it's ok, return the future that was actually set
169175 }
170176
177+ @Override
171178 public boolean isClosed() {
172179 return closeFuture.get() != null;
173180 }
174181
182+ @Override
175183 public Cluster getCluster() {
176184 return cluster;
177185 }
178186
187+ @Override
179188 public Session.State getState() {
180189 return new State(this);
181190 }
182191
183192 private ListenableFuture<PreparedStatement> toPreparedStatement(final String query, final Connection.Future future) {
184193 return Futures.transform(future, new AsyncFunction<Response, PreparedStatement>() {
194+ @Override
185195 public ListenableFuture<PreparedStatement> apply(Response response) {
186196 switch (response.type) {
187197 case RESULT:
@@ -679,24 +689,29 @@
679689 return -1;
680690 }
681691
692+ @Override
682693 public Session getSession() {
683694 return session;
684695 }
685696
697+ @Override
686698 public Collection<Host> getConnectedHosts() {
687699 return connectedHosts;
688700 }
689701
702+ @Override
690703 public int getOpenConnections(Host host) {
691704 int i = getIdx(host);
692705 return i < 0 ? 0 : openConnections[i];
693706 }
694707
708+ @Override
695709 public int getTrashedConnections(Host host) {
696710 int i = getIdx(host);
697711 return i < 0 ? 0 : trashedConnections[i];
698712 }
699713
714+ @Override
700715 public int getInFlightQueries(Host host) {
701716 int i = getIdx(host);
702717 return i < 0 ? 0 : inFlightQueries[i];
modified driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java +2 −0
@@ -46,6 +46,7 @@
4646 private static final String DEFAULT_VALUE_ALIAS = "value";
4747
4848 private static final Comparator<ColumnMetadata> columnMetadataComparator = new Comparator<ColumnMetadata>() {
49+ @Override
4950 public int compare(ColumnMetadata c1, ColumnMetadata c2) {
5051 return c1.getName().compareTo(c2.getName());
5152 }
@@ -72,6 +73,7 @@
7273 ASC, DESC;
7374
7475 static final Predicate<Order> isAscending = new Predicate<Order>() {
76+ @Override
7577 public boolean apply(Order o) {
7678 return o == ASC;
7779 }
modified driver-core/src/main/java/com/datastax/driver/core/UDTValue.java +3 −0
@@ -28,14 +28,17 @@
2828 this.definition = definition;
2929 }
3030
31+ @Override
3132 protected DataType getType(int i) {
3233 return definition.byIdx[i].getType();
3334 }
3435
36+ @Override
3537 protected String getName(int i) {
3638 return definition.byIdx[i].getName();
3739 }
3840
41+ @Override
3942 protected int[] getAllIndexesOf(String name) {
4043 int[] indexes = definition.byName.get(Metadata.handleId(name));
4144 if (indexes == null)
modified driver-core/src/main/java/com/datastax/driver/core/VersionNumber.java +1 −0
@@ -171,6 +171,7 @@
171171 return new VersionNumber(major, minor, patch, dsePatch, null, null);
172172 }
173173
174+ @Override
174175 public int compareTo(VersionNumber other) {
175176 if (major < other.major)
176177 return -1;
modified driver-core/src/main/java/com/datastax/driver/core/policies/EC2MultiRegionAddressTranslater.java +1 −0
@@ -101,6 +101,7 @@
101101 return null;
102102 }
103103
104+ @Override
104105 public void close() {
105106 try {
106107 ctx.close();
modified driver-core/src/main/java/com/datastax/driver/core/policies/IdentityTranslater.java +1 −0
@@ -32,6 +32,7 @@
3232 * @param address the address of a node as returned by Cassandra.
3333 * @return {@code address} unmodified.
3434 */
35+ @Override
3536 public InetSocketAddress translate(InetSocketAddress address) {
3637 return address;
3738 }
modified driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java +1 −0
@@ -392,6 +392,7 @@
392392 private final ConcurrentMap<Host, HostLatencyTracker> latencies = new ConcurrentHashMap<Host, HostLatencyTracker>();
393393 private volatile long cachedMin = -1L;
394394
395+ @Override
395396 public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) {
396397 if (shouldConsiderNewLatency(statement, exception)) {
397398 HostLatencyTracker hostTracker = latencies.get(host);
modified driver-core/src/main/java/com/datastax/driver/core/querybuilder/Select.java +7 −0
@@ -310,6 +310,7 @@
310310 *
311311 * @return this in-build SELECT statement.
312312 */
313+ @Override
313314 public Selection distinct() {
314315 this.isDistinct = true;
315316 return this;
@@ -426,6 +427,7 @@
426427 * @return an in-build SELECT statement.
427428 * @throws IllegalStateException if some columns had already been selected for this builder.
428429 */
430+ @Override
429431 public Builder all() {
430432 if (columnNames != null)
431433 throw new IllegalStateException(String.format("Some columns (%s) have already been selected.", columnNames));
@@ -441,6 +443,7 @@
441443 * @return an in-build SELECT statement.
442444 * @throws IllegalStateException if some columns had already been selected for this builder.
443445 */
446+ @Override
444447 public Builder countAll() {
445448 if (columnNames != null)
446449 throw new IllegalStateException(String.format("Some columns (%s) have already been selected.", columnNames));
@@ -457,6 +460,7 @@
457460 * @param name the new column name to add.
458461 * @return this in-build SELECT statement
459462 */
463+ @Override
460464 public SelectionOrAlias column(String name) {
461465 return queueName(name);
462466 }
@@ -484,6 +488,7 @@
484488 * @param name the name of the column to select the write time of.
485489 * @return this in-build SELECT statement
486490 */
491+ @Override
487492 public SelectionOrAlias writeTime(String name) {
488493 return queueName(new Utils.FCall("writetime", new Utils.CName(name)));
489494 }
@@ -496,6 +501,7 @@
496501 * @param name the name of the column to select the ttl of.
497502 * @return this in-build SELECT statement
498503 */
504+ @Override
499505 public SelectionOrAlias ttl(String name) {
500506 return queueName(new Utils.FCall("ttl", new Utils.CName(name)));
501507 }
@@ -511,6 +517,7 @@
511517 * {@link QueryBuilder#column} method, and so
512518 * {@code fcall("textToBlob", QueryBuilder.column(foo)}.
513519 */
520+ @Override
514521 public SelectionOrAlias fcall(String name, Object... parameters) {
515522 return queueName(new Utils.FCall(name, parameters));
516523 }
modified driver-core/src/main/java/com/datastax/driver/core/schemabuilder/TableOptions.java +2 −0
@@ -1038,10 +1038,12 @@
10381038 super(Algorithm.NONE);
10391039 }
10401040
1041+ @Override
10411042 public CompressionOptions withChunkLengthInKb(Integer chunkLengthInKb) {
10421043 return this;
10431044 }
10441045
1046+ @Override
10451047 public CompressionOptions withCRCCheckChance(Double crcCheckChance) {
10461048 return this;
10471049 }
modified driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java +1 −0
@@ -532,6 +532,7 @@
532532 }
533533
534534 public static class terminationHook extends Thread {
535+ @Override
535536 public void run() {
536537 logger.debug("shut down hook task..");
537538
modified driver-examples/stress/src/main/java/com/datastax/driver/stress/BlockingConsumer.java +1 −0
@@ -52,6 +52,7 @@
5252 super("Consumer Threads");
5353 }
5454
55+ @Override
5556 public void run() {
5657 try {
5758 while (requests.hasNext())
modified driver-examples/stress/src/main/java/com/datastax/driver/stress/Generators.java +9 −0
@@ -26,6 +26,7 @@
2626
2727 public class Generators {
2828 private static ThreadLocal<Random> random = new ThreadLocal<Random>() {
29+ @Override
2930 protected Random initialValue() {
3031 return new Random();
3132 }
@@ -62,10 +63,12 @@
6263
6364 public static final QueryGenerator.Builder INSERTER = new QueryGenerator.Builder() {
6465
66+ @Override
6567 public String name() {
6668 return "insert";
6769 }
6870
71+ @Override
6972 public OptionParser addOptions(OptionParser parser) {
7073 String msg = "Simple insertion of CQL3 rows (using prepared statements unless the --no-prepare option is used). "
7174 + "The inserted rows have a fixed set of columns but no clustering columns.";
@@ -78,6 +81,7 @@
7881 return parser;
7982 }
8083
84+ @Override
8185 public void prepare(OptionSet options, Session session) {
8286
8387 try {
@@ -100,6 +104,7 @@
100104 session.execute(sb.toString());
101105 }
102106
107+ @Override
103108 public QueryGenerator create(int id, int iterations, OptionSet options, Session session) {
104109
105110 return options.has("no-prepare")
@@ -159,10 +164,12 @@
159164
160165 public static final QueryGenerator.Builder READER = new QueryGenerator.Builder() {
161166
167+ @Override
162168 public String name() {
163169 return "read";
164170 }
165171
172+ @Override
166173 public OptionParser addOptions(OptionParser parser) {
167174 String msg = "Read the rows inserted with the insert generator. Use prepared statements unless the --no-prepare option is used.";
168175 parser.formatHelpWith(Stress.Help.formatFor(name(), msg));
@@ -171,6 +178,7 @@
171178 return parser;
172179 }
173180
181+ @Override
174182 public void prepare(OptionSet options, Session session) {
175183 KeyspaceMetadata ks = session.getCluster().getMetadata().getKeyspace("stress");
176184 if (ks == null || ks.getTable("standard1") == null) {
@@ -181,6 +189,7 @@
181189 session.execute("USE stress");
182190 }
183191
192+ @Override
184193 public QueryGenerator create(int id, int iterations, OptionSet options, Session session) {
185194 return options.has("no-prepare")
186195 ? createRegular(id, iterations)
modified driver-examples/stress/src/main/java/com/datastax/driver/stress/QueryGenerator.java +4 −0
@@ -59,10 +59,12 @@
5959 this.statement = statement;
6060 }
6161
62+ @Override
6263 public ResultSet execute(Session session) {
6364 return session.execute(statement);
6465 }
6566
67+ @Override
6668 public ResultSetFuture executeAsync(Session session) {
6769 return session.executeAsync(statement);
6870 }
@@ -76,10 +78,12 @@
7678 this.query = query;
7779 }
7880
81+ @Override
7982 public ResultSet execute(Session session) {
8083 return session.execute(query);
8184 }
8285
86+ @Override
8387 public ResultSetFuture executeAsync(Session session) {
8488 return session.executeAsync(query);
8589 }
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorInvocationHandler.java +1 −0
@@ -49,6 +49,7 @@
4949 methodMap.put(method.method, method);
5050 }
5151
52+ @Override
5253 public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
5354 if (m.equals(TO_STRING))
5455 return mapper.daoClass.getSimpleName() + " implementation generated by the Cassandra driver mapper";
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AccessorReflectionMapper.java +1 −0
@@ -47,6 +47,7 @@
4747 }
4848
4949 private static class AccessorReflectionFactory implements Factory {
50+ @Override
5051 public <T> AccessorMapper<T> create(Class<T> daoClass, List<MethodMapper> methods) {
5152 return new AccessorReflectionMapper<T>(daoClass, methods);
5253 }
modified driver-mapping/src/main/java/com/datastax/driver/mapping/AnnotationParser.java +1 −0
@@ -38,6 +38,7 @@
3838 class AnnotationParser {
3939
4040 private static final Comparator<Field> fieldComparator = new Comparator<Field>() {
41+ @Override
4142 public int compare(Field f1, Field f2) {
4243 return position(f1) - position(f2);
4344 }
modified driver-mapping/src/main/java/com/datastax/driver/mapping/Mapper.java +5 −0
@@ -77,16 +77,19 @@
7777
7878 this.protocolVersion = manager.getSession().getCluster().getConfiguration().getProtocolOptions().getProtocolVersionEnum();
7979 this.mapOneFunction = new Function<ResultSet, T>() {
80+ @Override
8081 public T apply(ResultSet rs) {
8182 return Mapper.this.mapAliased(rs).one();
8283 }
8384 };
8485 this.mapOneFunctionWithoutAliases = new Function<ResultSet, T>() {
86+ @Override
8587 public T apply(ResultSet rs) {
8688 return Mapper.this.map(rs).one();
8789 }
8890 };
8991 this.mapAllFunctionWithoutAliases = new Function<ResultSet, Result<T>>() {
92+ @Override
9093 public Result<T> apply(ResultSet rs) {
9194 return Mapper.this.map(rs);
9295 }
@@ -822,6 +825,7 @@
822825 this.ttlValue = value;
823826 }
824827
828+ @Override
825829 void appendTo(Insert.Options usings) {
826830 usings.and(QueryBuilder.ttl(QueryBuilder.bindMarker()));
827831 }
@@ -1025,6 +1029,7 @@
10251029 return false;
10261030 }
10271031
1032+ @Override
10281033 public int hashCode() {
10291034 return Objects.hashCode(queryType, optionTypes, columns);
10301035 }
modified driver-mapping/src/main/java/com/datastax/driver/mapping/ReflectionMapper.java +2 −0
@@ -198,11 +198,13 @@
198198
199199 private static class ReflectionFactory implements Factory {
200200
201+ @Override
201202 public <T> EntityMapper<T> create(Class<T> entityClass, String keyspace, String table, ConsistencyLevel writeConsistency, ConsistencyLevel readConsistency) {
202203 return new ReflectionMapper<T>(entityClass, keyspace, table, writeConsistency, readConsistency);
203204 }
204205
205206 @SuppressWarnings({"unchecked", "rawtypes"})
207+ @Override
206208 public <T> ColumnMapper<T> createColumnMapper(Class<T> entityClass, Field field, int position, MappingManager mappingManager, AtomicInteger columnCounter) {
207209 String fieldName = field.getName();
208210 try {
modified driver-mapping/src/main/java/com/datastax/driver/mapping/Result.java +5 −1
@@ -107,18 +107,22 @@
107107 * @return an iterator that will consume and return the remaining rows of
108108 * this mapped result set.
109109 */
110- public Iterator<T> iterator() {
110+ @Override
111+ public Iterator<T> iterator() {
111112 return new Iterator<T>() {
112113 private final Iterator<Row> rowIterator = rs.iterator();
113114
115+ @Override
114116 public boolean hasNext() {
115117 return rowIterator.hasNext();
116118 }
117119
120+ @Override
118121 public T next() {
119122 return map(rowIterator.next());
120123 }
121124
125+ @Override
122126 public void remove() {
123127 throw new UnsupportedOperationException();
124128 }