ibessonov commented on code in PR #812: URL: https://github.com/apache/ignite-3/pull/812#discussion_r881437740
########## modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/configuration/schema/PersistentPageMemoryDataRegionConfigurationSchema.java: ########## @@ -0,0 +1,49 @@ +/* + * 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.pagememory.configuration.schema; + +import static org.apache.ignite.internal.pagememory.configuration.schema.PersistentPageMemoryDataRegionConfigurationSchema.PERSISTENT_DATA_REGION_TYPE; + +import org.apache.ignite.configuration.annotation.PolymorphicConfigInstance; +import org.apache.ignite.configuration.annotation.Value; +import org.apache.ignite.configuration.validation.OneOf; + +/** + * Persistent data region configuration for page memory. + */ +@PolymorphicConfigInstance(PERSISTENT_DATA_REGION_TYPE) +public class PersistentPageMemoryDataRegionConfigurationSchema extends PageMemoryDataRegionConfigurationSchema { Review Comment: Ok, I guess this change was done too quickly. Considering that engines will have independent configurations, I'm curious about how we are going to pull it off. I guess we will use some weird code magic :) I'd recommend to rollback some of the latest changes, we will have to remove this polymorphic configuration anyways pretty soon, right? ########## modules/api/src/main/java/org/apache/ignite/configuration/schemas/clientconnector/ClientConnectorConfigurationSchema.java: ########## @@ -30,8 +30,7 @@ @ConfigurationRoot(rootName = "clientConnector", type = ConfigurationType.LOCAL) public class ClientConnectorConfigurationSchema { /** TCP port. */ - @Min(1024) - @Max(0xFFFF) + @Range(min = 1024, max = 0xFFFF) Review Comment: Please remove all explicit "@Min" and "@Max", they can be replaced with range. ########## modules/configuration-api/src/main/java/org/apache/ignite/configuration/validation/Range.java: ########## @@ -0,0 +1,42 @@ +/* + * 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.configuration.validation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Signifies that this value has lower limit (inclusive) and has upper limit (inclusive). + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Range { + /** + * Returns the lower bound for the value. + */ + long min(); Review Comment: Can we default these to Long min and max? ########## modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/impl/PageMemoryNoStoreImpl.java: ########## @@ -170,18 +170,19 @@ public class PageMemoryNoStoreImpl implements PageMemory { * @param directMemoryProvider Memory allocator to use. * @param dataRegionCfg Data region configuration. * @param ioRegistry IO registry. + * @param pageSize Page size in bytes. */ public PageMemoryNoStoreImpl( DirectMemoryProvider directMemoryProvider, - PageMemoryDataRegionConfiguration dataRegionCfg, - PageIoRegistry ioRegistry + VolatilePageMemoryDataRegionConfiguration dataRegionCfg, + PageIoRegistry ioRegistry, + // TODO: IGNITE-17017 Move to common config + int pageSize ) { this.directMemoryProvider = directMemoryProvider; this.ioRegistry = ioRegistry; this.trackAcquiredPages = false; - this.dataRegionCfg = dataRegionCfg.value(); - - int pageSize = this.dataRegionCfg.pageSize(); + this.dataRegionCfg = (VolatilePageMemoryDataRegionView) dataRegionCfg.value(); Review Comment: Our naming makes no sense. Both configuration and view are named "dataRegionCfg", how do we distinct them in code? -- 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]
