Mmuzaf commented on code in PR #10140:
URL: https://github.com/apache/ignite/pull/10140#discussion_r922077249
##########
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java:
##########
@@ -143,8 +147,23 @@ public static ClientCacheAffinityMapping
merge(ClientCacheAffinityMapping... map
*
* @param ch Output channel.
* @param cacheIds Cache IDs.
+ * @param mappers Function that produces key mapping functions.
*/
- public static void writeRequest(PayloadOutputChannel ch,
Collection<Integer> cacheIds) {
+ public static void writeRequest(
+ PayloadOutputChannel ch,
+ Collection<Integer> cacheIds,
+ Function<Integer, Function<Integer, ToIntFunction<Object>>> mappers
+ ) {
+ ProtocolContext ctx = ch.clientChannel().protocolCtx();
+
+ boolean hasFactory = cacheIds.stream()
Review Comment:
Fixed.
##########
modules/core/src/main/java/org/apache/ignite/client/ClientPartitionAwarenessMapper.java:
##########
@@ -0,0 +1,43 @@
+/*
+ * 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;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/**
+ * This function calculates the cache key to a partition mapping for each
cache key. It is used only for local calculation on a client side.
+ * <p>
+ * When the {@link ClientConfiguration#isPartitionAwarenessEnabled()} and the
cache was created with a custom {@link AffinityFunction}
+ * or a {@link AffinityKeyMapper} this function will be used to calculate
mappings. Be sure that a key maps to the same partition
+ * produced by the {@link AffinityFunction#partition(Object)} method.
+ *
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]