lowka commented on code in PR #6695: URL: https://github.com/apache/ignite-3/pull/6695#discussion_r2409302401
########## modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/AlterTablePropertiesEntrySerializers.java: ########## @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.catalog.storage; + +import static org.apache.ignite.internal.catalog.storage.serialization.CatalogSerializationUtils.readNullableDouble; +import static org.apache.ignite.internal.catalog.storage.serialization.CatalogSerializationUtils.readNullableLong; +import static org.apache.ignite.internal.catalog.storage.serialization.CatalogSerializationUtils.writeNullableDouble; +import static org.apache.ignite.internal.catalog.storage.serialization.CatalogSerializationUtils.writeNullableLong; + +import java.io.IOException; +import org.apache.ignite.internal.catalog.storage.serialization.CatalogEntrySerializerProvider; +import org.apache.ignite.internal.catalog.storage.serialization.CatalogObjectDataInput; +import org.apache.ignite.internal.catalog.storage.serialization.CatalogObjectDataOutput; +import org.apache.ignite.internal.catalog.storage.serialization.CatalogObjectSerializer; +import org.apache.ignite.internal.catalog.storage.serialization.CatalogSerializer; + +/** + * Serializers for {@link AlterTablePropertiesEntry}. + */ +public class AlterTablePropertiesEntrySerializers { + /** + * Serializer for {@link AlterTablePropertiesEntry}. + */ + @CatalogSerializer(version = 1, since = "3.1.0") Review Comment: I think this is not right. The version 1 of the protocol should not be used, so it should be `CatalogSerializer(version = 2, since = "3.1.0")`. But there is an `omission` in `CatalogEntrySerializerProviderImpl` that expects that version 1 is present. ``` @CatalogSerializer(version = 1, since = "3.1.0") static class AlterTablePropertiesEntrySerializerV1 extends AlterTablePropertiesEntrySerializer { public AlterTablePropertiesEntrySerializerV1(CatalogEntrySerializerProvider serializers) { super(serializers); } } ``` ########## modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/AlterTablePropertiesEntry.java: ########## @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.catalog.storage; + +import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor; +import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor.Builder; +import org.apache.ignite.internal.catalog.events.AlterTablePropertiesEventParameters; +import org.apache.ignite.internal.catalog.events.CatalogEvent; +import org.apache.ignite.internal.catalog.events.CatalogEventParameters; +import org.apache.ignite.internal.catalog.storage.serialization.MarshallableEntryType; +import org.apache.ignite.internal.tostring.S; +import org.jetbrains.annotations.Nullable; + +/** + * Describes changing of table properties. + */ +public class AlterTablePropertiesEntry extends UpdateTable implements Fireable { Review Comment: I think there should be a compatibility test case for `AlterTablePropertiesEntry`. It looks roughly like this (CatalogSerializationCompatibilityTest): ``` @Test public void alterTableProperties() { List<UpdateEntry> entries = List.of( new AlterTablePropertiesEntry(state.id(), null, null), new AlterTablePropertiesEntry(state.id(), 1.0d, null), new AlterTablePropertiesEntry(state.id(), null, 10L), new AlterTablePropertiesEntry(state.id(), 2.0d, 10L) ); checker.compareEntries(entries, "AlterTableProperties", entryVersion()); } ``` Then set `CatalogSerializationCompatibilityTest.WRITE_SNAPSHOT` = true and run the tests to get snapshot generated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
