kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | b60572d5df2d0c64d2ab7cbd220fff905360ba4c858b01a2868bd75443c4d342 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-09-17 02:43 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-09-29 16:40 -07:00 |
| Parents | 547223707403 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/Metadata.java +6 −7
| @@ -28,8 +28,6 @@ | ||
| 28 | 28 | import org.slf4j.Logger; |
| 29 | 29 | import org.slf4j.LoggerFactory; |
| 30 | 30 | |
| 31 | -import com.datastax.driver.core.exceptions.DriverInternalError; | |
| 32 | - | |
| 33 | 31 | import static com.datastax.driver.core.SchemaElement.KEYSPACE; |
| 34 | 32 | import static com.datastax.driver.core.SchemaElement.TABLE; |
| 35 | 33 | import static com.datastax.driver.core.SchemaElement.TYPE; |
| @@ -88,7 +86,7 @@ | ||
| 88 | 86 | return; |
| 89 | 87 | } |
| 90 | 88 | if (udtRows.containsKey(targetKeyspace)) { |
| 91 | - Map<String, UserType> userTypes = buildUserTypes(keyspace, udtRows.get(targetKeyspace), cassandraVersion); | |
| 89 | + Map<String, UserType> userTypes = buildUserTypes(udtRows.get(targetKeyspace)); | |
| 92 | 90 | updateUserTypes(keyspace.userTypes, userTypes, targetName); |
| 93 | 91 | } |
| 94 | 92 | } |
| @@ -147,7 +145,7 @@ | ||
| 147 | 145 | for (TableMetadata table : tables.values()) { |
| 148 | 146 | keyspace.add(table); |
| 149 | 147 | } |
| 150 | - Map<String, UserType> userTypes = buildUserTypes(keyspace, udtRows.get(keyspace.getName()), cassandraVersion); | |
| 148 | + Map<String, UserType> userTypes = buildUserTypes(udtRows.get(keyspace.getName())); | |
| 151 | 149 | for (UserType userType : userTypes.values()) { |
| 152 | 150 | keyspace.add(userType); |
| 153 | 151 | } |
| @@ -195,7 +193,7 @@ | ||
| 195 | 193 | return tables; |
| 196 | 194 | } |
| 197 | 195 | |
| 198 | - private Map<String, UserType> buildUserTypes(KeyspaceMetadata keyspace, List<Row> udtRows, VersionNumber cassandraVersion) { | |
| 196 | + private Map<String, UserType> buildUserTypes(List<Row> udtRows) { | |
| 199 | 197 | Map<String, UserType> userTypes = new LinkedHashMap<String, UserType>(); |
| 200 | 198 | if (udtRows != null) { |
| 201 | 199 | for (Row udtRow : udtRows) { |
| @@ -237,8 +235,9 @@ | ||
| 237 | 235 | triggerOnKeyspaceChanged(newKeyspace, oldKeyspace); |
| 238 | 236 | } |
| 239 | 237 | Map<String, TableMetadata> oldTables = oldKeyspace == null ? new HashMap<String, TableMetadata>() : oldKeyspace.tables; |
| 240 | - Map<String, TableMetadata> newTables = newKeyspace.tables; | |
| 241 | - updateTables(oldTables, newTables, null); | |
| 238 | + updateTables(oldTables, newKeyspace.tables, null); | |
| 239 | + Map<String, UserType> oldTypes = oldKeyspace == null ? new HashMap<String, UserType>() : oldKeyspace.userTypes; | |
| 240 | + updateUserTypes(oldTypes, newKeyspace.userTypes, null); | |
| 242 | 241 | } |
| 243 | 242 | } |
| 244 | 243 |