Mmuzaf commented on code in PR #10140: URL: https://github.com/apache/ignite/pull/10140#discussion_r922080156
########## modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java: ########## @@ -0,0 +1,47 @@ +/* + * 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.client; + +import org.apache.ignite.cache.affinity.AffinityFunction; +import org.apache.ignite.cache.affinity.AffinityKeyMapper; + +/** + * This factory is used on the client side and only when the partition awareness thin client feature is enabled. By default, + * on a new cache the RendezvousAffinityFunction will be used for calculating mappings 'key-to-partition' and 'partition-to-node'. + * The thin client will update all 'partitions-to-node' mappings on every a cache put/get request and the 'key-to-partition' Review Comment: Fixed. ########## modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapperFactory.java: ########## @@ -0,0 +1,47 @@ +/* + * 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.client; + +import org.apache.ignite.cache.affinity.AffinityFunction; +import org.apache.ignite.cache.affinity.AffinityKeyMapper; + +/** + * This factory is used on the client side and only when the partition awareness thin client feature is enabled. By default, + * on a new cache the RendezvousAffinityFunction will be used for calculating mappings 'key-to-partition' and 'partition-to-node'. + * The thin client will update all 'partitions-to-node' mappings on every a cache put/get request and the 'key-to-partition' + * mapping will be calculated on the client side. + * <p> + * The case described above will not be possible (and in turn partition awareness won't work) when a custom {@link AffinityFunction} or + * a {@link AffinityKeyMapper} was previously used for a cache creation. The partition awareness mapper factory is used to solve this + * issue. All 'partition-to-node' mappings will still be requested nad received from a server node, however, if a custom AffinityFunction Review Comment: Fixed. -- 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]
