private static List<AbstractType<?>> updateTypes(List<AbstractType<?>> toUpdate, String keyspace, ByteBuffer toReplace, UserType updated) { // But this can also be nested. List<AbstractType<?>> updatedTypes = null; for (int i = 0; i < toUpdate.size(); i++) { AbstractType<?> t = updateWith(toUpdate.get(i), keyspace, toReplace, updated); if (t == null) continue; if (updatedTypes == null) updatedTypes = new ArrayList<>(toUpdate); updatedTypes.set(i, t); } return updatedTypes; }
private static List<AbstractType<?>> updateTypes(List<AbstractType<?>> toUpdate, String keyspace, ByteBuffer toReplace, UserType updated) { // But this can also be nested. List<AbstractType<?>> updatedTypes = null; for (int i = 0; i < toUpdate.size(); i++) { AbstractType<?> t = updateWith(toUpdate.get(i), keyspace, toReplace, updated); if (t == null) continue; if (updatedTypes == null) updatedTypes = new ArrayList<>(toUpdate); updatedTypes.set(i, t); } return updatedTypes; }
private static List<AbstractType<?>> updateTypes(List<AbstractType<?>> toUpdate, String keyspace, ByteBuffer toReplace, UserType updated) { // But this can also be nested. List<AbstractType<?>> updatedTypes = null; for (int i = 0; i < toUpdate.size(); i++) { AbstractType<?> t = updateWith(toUpdate.get(i), keyspace, toReplace, updated); if (t == null) continue; if (updatedTypes == null) updatedTypes = new ArrayList<>(toUpdate); updatedTypes.set(i, t); } return updatedTypes; }
private static List<AbstractType<?>> updateTypes(List<AbstractType<?>> toUpdate, String keyspace, ByteBuffer toReplace, UserType updated) { // But this can also be nested. List<AbstractType<?>> updatedTypes = null; for (int i = 0; i < toUpdate.size(); i++) { AbstractType<?> t = updateWith(toUpdate.get(i), keyspace, toReplace, updated); if (t == null) continue; if (updatedTypes == null) updatedTypes = new ArrayList<>(toUpdate); updatedTypes.set(i, t); } return updatedTypes; }
private boolean updateDefinition(CFMetaData cfm, ColumnDefinition def, String keyspace, ByteBuffer toReplace, UserType updated) { AbstractType<?> t = updateWith(def.type, keyspace, toReplace, updated); if (t == null) return false; // We need to update this validator ... cfm.addOrReplaceColumnDefinition(def.withNewType(t)); return true; }
private boolean updateDefinition(CFMetaData cfm, ColumnDefinition def, String keyspace, ByteBuffer toReplace, UserType updated) { AbstractType<?> t = updateWith(def.type, keyspace, toReplace, updated); if (t == null) return false; // We need to update this validator ... cfm.addOrReplaceColumnDefinition(def.withNewType(t)); return true; }
private boolean updateDefinition(CFMetaData cfm, ColumnDefinition def, String keyspace, ByteBuffer toReplace, UserType updated) { AbstractType<?> t = updateWith(def.type, keyspace, toReplace, updated); if (t == null) return false; // We need to update this validator ... cfm.addOrReplaceColumnDefinition(def.withNewType(t)); return true; }
private boolean updateDefinition(CFMetaData cfm, ColumnDefinition def, String keyspace, ByteBuffer toReplace, UserType updated) { AbstractType<?> t = updateWith(def.type, keyspace, toReplace, updated); if (t == null) return false; // We need to update this validator ... cfm.addOrReplaceColumnDefinition(def.withNewType(t)); // ... but if it's part of the comparator or key validator, we need to go update those too. switch (def.kind) { case PARTITION_KEY: cfm.keyValidator(updateWith(cfm.getKeyValidator(), keyspace, toReplace, updated)); break; case CLUSTERING_COLUMN: cfm.comparator = CellNames.fromAbstractType(updateWith(cfm.comparator.asAbstractType(), keyspace, toReplace, updated), cfm.comparator.isDense()); break; default: // If it's a collection, we still want to modify the comparator because the collection is aliased in it if (def.type instanceof CollectionType && def.type.isMultiCell()) { t = updateWith(cfm.comparator.asAbstractType(), keyspace, toReplace, updated); // If t == null, all relevant comparators were updated via updateWith, which reaches into types and // collections if (t != null) cfm.comparator = CellNames.fromAbstractType(t, cfm.comparator.isDense()); } break; } return true; }
for (Map.Entry<ByteBuffer, CollectionType> entry : ctct.defined.entrySet()) AbstractType<?> t = updateWith(entry.getValue(), keyspace, toReplace, updated); if (t == null) continue; AbstractType<?> t = updateWith(((ListType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> t = updateWith(((SetType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> k = updateWith(mt.getKeysType(), keyspace, toReplace, updated); AbstractType<?> v = updateWith(mt.getValuesType(), keyspace, toReplace, updated); if (k == null && v == null) return null;
continue; AbstractType<?> upd = updateWith(ut, toUpdate.keyspace, toUpdate.name, updated); if (upd != null) MigrationManager.announceTypeUpdate((UserType) upd, isLocalOnly);
AbstractType<?> t = updateWith(((ListType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> t = updateWith(((SetType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> k = updateWith(mt.getKeysType(), keyspace, toReplace, updated); AbstractType<?> v = updateWith(mt.getValuesType(), keyspace, toReplace, updated); if (k == null && v == null) return null;
AbstractType<?> t = updateWith(((ListType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> t = updateWith(((SetType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> k = updateWith(mt.getKeysType(), keyspace, toReplace, updated); AbstractType<?> v = updateWith(mt.getValuesType(), keyspace, toReplace, updated); if (k == null && v == null) return null;
AbstractType<?> t = updateWith(((ListType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> t = updateWith(((SetType)type).getElementsType(), keyspace, toReplace, updated); if (t == null) return null; AbstractType<?> k = updateWith(mt.getKeysType(), keyspace, toReplace, updated); AbstractType<?> v = updateWith(mt.getValuesType(), keyspace, toReplace, updated); if (k == null && v == null) return null;
continue; AbstractType<?> upd = updateWith(ut, toUpdate.keyspace, toUpdate.name, updated); if (upd != null) SchemaKeyspace.addTypeToSchemaMutation((UserType) upd, builder);
continue; AbstractType<?> upd = updateWith(ut, toUpdate.keyspace, toUpdate.name, updated); if (upd != null) MigrationManager.announceTypeUpdate((UserType) upd, isLocalOnly);
continue; AbstractType<?> upd = updateWith(ut, toUpdate.keyspace, toUpdate.name, updated); if (upd != null) MigrationManager.announceTypeUpdate((UserType) upd, isLocalOnly);
continue; AbstractType<?> upd = updateWith(ut, toUpdate.keyspace, toUpdate.name, updated); if (upd != null && doAnnounce) MigrationManager.announceTypeUpdate((UserType) upd, isLocalOnly);