kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | d9afbf74ecb325c0b3386640d3ba7986727bbb3cf850c4ba5a59f820ca40a211 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-05-21 17:43 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-05-21 17:45 +02:00 |
| Parents | e8f426346b04 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +6 −5
| @@ -336,16 +336,17 @@ | ||
| 336 | 336 | whereClause += " AND type_name = '" + targetName + '\''; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - DefaultResultSetFuture ksFuture = (targetType == null || targetType == KEYSPACE) | |
| 339 | + boolean isSchemaOrKeyspace = (targetType == null || targetType == KEYSPACE); | |
| 340 | + DefaultResultSetFuture ksFuture = isSchemaOrKeyspace | |
| 340 | 341 | ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_KEYSPACES + whereClause)) |
| 341 | 342 | : null; |
| 342 | - DefaultResultSetFuture udtFuture = (targetType == KEYSPACE && supportsUdts(cassandraVersion) || targetType == TYPE) | |
| 343 | + DefaultResultSetFuture udtFuture = (isSchemaOrKeyspace && supportsUdts(cassandraVersion) || targetType == TYPE) | |
| 343 | 344 | ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_USERTYPES + whereClause)) |
| 344 | 345 | : null; |
| 345 | - DefaultResultSetFuture cfFuture = (targetType == KEYSPACE || targetType == TABLE) | |
| 346 | + DefaultResultSetFuture cfFuture = (isSchemaOrKeyspace || targetType == TABLE) | |
| 346 | 347 | ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_COLUMN_FAMILIES + whereClause)) |
| 347 | 348 | : null; |
| 348 | - DefaultResultSetFuture colsFuture = (targetType == KEYSPACE || targetType == TABLE) | |
| 349 | + DefaultResultSetFuture colsFuture = (isSchemaOrKeyspace || targetType == TABLE) | |
| 349 | 350 | ? new DefaultResultSetFuture(null, cluster.protocolVersion(), new Requests.Query(SELECT_COLUMNS + whereClause)) |
| 350 | 351 | : null; |
| 351 | 352 | |
| @@ -374,7 +375,7 @@ | ||
| 374 | 375 | |
| 375 | 376 | // If we rebuild all from scratch or have an updated keyspace, rebuild the token map since some replication on some keyspace |
| 376 | 377 | // may have changed |
| 377 | - if (targetType == null || targetType == KEYSPACE) | |
| 378 | + if (isSchemaOrKeyspace) | |
| 378 | 379 | refreshNodeListAndTokenMap(connection, cluster, false, false); |
| 379 | 380 | } |
| 380 | 381 |