sanpwc commented on code in PR #927:
URL: https://github.com/apache/ignite-3/pull/927#discussion_r925519761


##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java:
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.replicator;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.internal.replicator.exception.ReplicationError;
+import org.apache.ignite.internal.replicator.message.CompleteOperationRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaMessagesFactory;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.lang.IgniteStringFormatter;
+
+/**
+ * Replica server.
+ * TODO:IGNITE-17257 Implement Replica server-side logic.
+ */
+public class Replica {
+    /** Replicator network message factory. */
+    private static final ReplicaMessagesFactory REPLICA_MESSAGES_FACTORY = new 
ReplicaMessagesFactory();
+
+    /** Replica group identity, this id is the same as the considered 
partition's id. */
+    private final String replicaGrpId;
+
+    /** Replica listener. */
+    private final ReplicaListener listener;
+
+    /**
+     * The map matches an operation id to the future.
+     */
+    private final ConcurrentHashMap<UUID, CompletableFuture> ops = new 
ConcurrentHashMap<>();
+
+    /**
+     * The constructor of replica server.
+     *
+     * @param replicaGrpId Replication group id.
+     * @param listener Replica listener.
+     */
+    public Replica(
+            String replicaGrpId,
+            ReplicaListener listener
+    ) {
+        this.replicaGrpId = replicaGrpId;
+        this.listener = listener;
+    }
+
+    /**
+     * Process a replication request on the replica.
+     *
+     * @param request Request to replication.
+     * @return Response.
+     */
+    public ReplicaResponse processRequest(ReplicaRequest request) { // define 
proper set of exceptions that might be thrown.
+        assert replicaGrpId.equals(request.replicationGroupId()) : 
IgniteStringFormatter.format(
+                "Partition mismatch: request does not match the replica 
[reqPartId={}, replicaGrpId={}]", request.replicationGroupId(),
+                replicaGrpId);
+
+        //TODO:IGNITE-17378 Check replica is alive.
+
+        ReplicaResponse response;
+
+        try {
+            if (request instanceof CompleteOperationRequest) {

Review Comment:
   It's rather AwaiteOperationResultRequest than Complete... because.



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java:
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.replicator;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.internal.replicator.exception.ReplicationError;
+import org.apache.ignite.internal.replicator.message.CompleteOperationRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaMessagesFactory;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.lang.IgniteStringFormatter;
+
+/**
+ * Replica server.
+ * TODO:IGNITE-17257 Implement Replica server-side logic.
+ */
+public class Replica {
+    /** Replicator network message factory. */
+    private static final ReplicaMessagesFactory REPLICA_MESSAGES_FACTORY = new 
ReplicaMessagesFactory();
+
+    /** Replica group identity, this id is the same as the considered 
partition's id. */
+    private final String replicaGrpId;
+
+    /** Replica listener. */
+    private final ReplicaListener listener;
+
+    /**
+     * The map matches an operation id to the future.
+     */
+    private final ConcurrentHashMap<UUID, CompletableFuture> ops = new 
ConcurrentHashMap<>();
+
+    /**
+     * The constructor of replica server.
+     *
+     * @param replicaGrpId Replication group id.
+     * @param listener Replica listener.
+     */
+    public Replica(
+            String replicaGrpId,
+            ReplicaListener listener
+    ) {
+        this.replicaGrpId = replicaGrpId;
+        this.listener = listener;
+    }
+
+    /**
+     * Process a replication request on the replica.
+     *
+     * @param request Request to replication.
+     * @return Response.
+     */
+    public ReplicaResponse processRequest(ReplicaRequest request) { // define 
proper set of exceptions that might be thrown.
+        assert replicaGrpId.equals(request.replicationGroupId()) : 
IgniteStringFormatter.format(
+                "Partition mismatch: request does not match the replica 
[reqPartId={}, replicaGrpId={}]", request.replicationGroupId(),
+                replicaGrpId);
+
+        //TODO:IGNITE-17378 Check replica is alive.
+
+        ReplicaResponse response;
+
+        try {
+            if (request instanceof CompleteOperationRequest) {
+                var opsRequest = (CompleteOperationRequest) request;
+
+                List<UUID> opIds = opsRequest.operationIds();
+
+                HashMap<UUID, Object> opRes = null;
+
+                if (opIds != null && !opIds.isEmpty()) {
+                    opRes = new HashMap<>(opIds.size());
+
+                    for (Entry<UUID, CompletableFuture> op : ops.entrySet()) {
+                        if (opIds.contains(op.getKey())) {
+                            opRes.put(op.getKey(), op.getValue().join());

Review Comment:
   What will happen if CompleteOperationRequest network timeout is less than 
future await time?



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java:
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.replicator;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.internal.replicator.exception.ReplicationError;
+import org.apache.ignite.internal.replicator.message.CompleteOperationRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaMessagesFactory;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.lang.IgniteStringFormatter;
+
+/**
+ * Replica server.
+ * TODO:IGNITE-17257 Implement Replica server-side logic.
+ */
+public class Replica {
+    /** Replicator network message factory. */
+    private static final ReplicaMessagesFactory REPLICA_MESSAGES_FACTORY = new 
ReplicaMessagesFactory();
+
+    /** Replica group identity, this id is the same as the considered 
partition's id. */
+    private final String replicaGrpId;
+
+    /** Replica listener. */
+    private final ReplicaListener listener;
+
+    /**
+     * The map matches an operation id to the future.
+     */
+    private final ConcurrentHashMap<UUID, CompletableFuture> ops = new 
ConcurrentHashMap<>();
+
+    /**
+     * The constructor of replica server.
+     *
+     * @param replicaGrpId Replication group id.
+     * @param listener Replica listener.
+     */
+    public Replica(
+            String replicaGrpId,
+            ReplicaListener listener
+    ) {
+        this.replicaGrpId = replicaGrpId;
+        this.listener = listener;
+    }
+
+    /**
+     * Process a replication request on the replica.
+     *
+     * @param request Request to replication.
+     * @return Response.
+     */
+    public ReplicaResponse processRequest(ReplicaRequest request) { // define 
proper set of exceptions that might be thrown.
+        assert replicaGrpId.equals(request.replicationGroupId()) : 
IgniteStringFormatter.format(
+                "Partition mismatch: request does not match the replica 
[reqPartId={}, replicaGrpId={}]", request.replicationGroupId(),
+                replicaGrpId);
+
+        //TODO:IGNITE-17378 Check replica is alive.
+
+        ReplicaResponse response;
+
+        try {
+            if (request instanceof CompleteOperationRequest) {
+                var opsRequest = (CompleteOperationRequest) request;
+
+                List<UUID> opIds = opsRequest.operationIds();
+
+                HashMap<UUID, Object> opRes = null;
+
+                if (opIds != null && !opIds.isEmpty()) {
+                    opRes = new HashMap<>(opIds.size());
+
+                    for (Entry<UUID, CompletableFuture> op : ops.entrySet()) {
+                        if (opIds.contains(op.getKey())) {
+                            opRes.put(op.getKey(), op.getValue().join());
+
+                            ops.remove(op.getKey());

Review Comment:
   Who and how will remove operation futures in case of coordinator failure?



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java:
##########
@@ -0,0 +1,200 @@
+/*
+ * 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.replicator;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.internal.manager.IgniteComponent;
+import 
org.apache.ignite.internal.replicator.exception.ReplicaAlreadyIsStartedException;
+import org.apache.ignite.internal.replicator.message.ReplicaMessageGroup;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.internal.util.IgniteSpinBusyLock;
+import org.apache.ignite.lang.IgniteException;
+import org.apache.ignite.lang.IgniteStringFormatter;
+import org.apache.ignite.lang.NodeStoppingException;
+import org.apache.ignite.network.ClusterService;
+import org.apache.ignite.network.NetworkAddress;
+import org.apache.ignite.network.NetworkMessage;
+import org.apache.ignite.network.NetworkMessageHandler;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Manager to rule replicas.
+ * Only a single instance of the class exists in Ignite node.
+ * This class allow to start/stop/get a replica.
+ */
+public class ReplicaManager implements IgniteComponent {
+    /** Busy lock to stop synchronously. */
+    private final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+    /** Prevents double stopping the component. */
+    private final AtomicBoolean stopGuard = new AtomicBoolean();
+
+    /** Cluster network service. */
+    private final ClusterService clusterNetSvc;
+
+    /** Replicas. */
+    private final ConcurrentHashMap<String, Replica> replicas = new 
ConcurrentHashMap<>();
+
+    /**
+     * Constructor for replica service.
+     *
+     * @param clusterNetSvc                 Cluster network service.
+     */
+    public ReplicaManager(ClusterService clusterNetSvc) {
+        this.clusterNetSvc = clusterNetSvc;
+    }
+
+    /**
+     * Gets a replica by its partition id.
+     *
+     * @param replicaGrpId Replication group id.
+     * @return Instance of the replica or {@code null} if the replica is not 
started.
+     * @throws NodeStoppingException Is thrown when the node is stopping.
+     */
+    public Replica replica(String replicaGrpId) throws NodeStoppingException {
+        if (!busyLock.enterBusy()) {
+            throw new NodeStoppingException();
+        }
+
+        try {
+            return replicas.get(replicaGrpId);
+        } finally {
+            busyLock.leaveBusy();
+        }
+    }
+
+    /**
+     * Starts a replica. If a replica with the same partition id is already 
exist the method throws an exception.
+     *
+     * @param replicaGrpId   Replication group id.
+     * @param listener Replica listener.
+     * @return Replica.
+     * @throws NodeStoppingException Is thrown when the node is stopping.
+     * @throws ReplicaAlreadyIsStartedException Is thrown when a replica with 
the same replication group id is started.

Review Comment:
   IsAlreadyStarted or just AlreadyStarted without is.



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java:
##########
@@ -0,0 +1,200 @@
+/*
+ * 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.replicator;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.internal.manager.IgniteComponent;
+import 
org.apache.ignite.internal.replicator.exception.ReplicaAlreadyIsStartedException;
+import org.apache.ignite.internal.replicator.message.ReplicaMessageGroup;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.internal.util.IgniteSpinBusyLock;
+import org.apache.ignite.lang.IgniteException;
+import org.apache.ignite.lang.IgniteStringFormatter;
+import org.apache.ignite.lang.NodeStoppingException;
+import org.apache.ignite.network.ClusterService;
+import org.apache.ignite.network.NetworkAddress;
+import org.apache.ignite.network.NetworkMessage;
+import org.apache.ignite.network.NetworkMessageHandler;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Manager to rule replicas.
+ * Only a single instance of the class exists in Ignite node.
+ * This class allow to start/stop/get a replica.
+ */
+public class ReplicaManager implements IgniteComponent {
+    /** Busy lock to stop synchronously. */
+    private final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+    /** Prevents double stopping the component. */
+    private final AtomicBoolean stopGuard = new AtomicBoolean();
+
+    /** Cluster network service. */
+    private final ClusterService clusterNetSvc;
+
+    /** Replicas. */
+    private final ConcurrentHashMap<String, Replica> replicas = new 
ConcurrentHashMap<>();
+
+    /**
+     * Constructor for replica service.
+     *
+     * @param clusterNetSvc                 Cluster network service.
+     */
+    public ReplicaManager(ClusterService clusterNetSvc) {
+        this.clusterNetSvc = clusterNetSvc;
+    }
+
+    /**
+     * Gets a replica by its partition id.

Review Comment:
   javadoc: partitionId -> replica group id



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java:
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.replicator;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.internal.replicator.exception.ReplicationError;
+import org.apache.ignite.internal.replicator.message.CompleteOperationRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaMessagesFactory;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.lang.IgniteStringFormatter;
+
+/**
+ * Replica server.
+ * TODO:IGNITE-17257 Implement Replica server-side logic.
+ */
+public class Replica {
+    /** Replicator network message factory. */
+    private static final ReplicaMessagesFactory REPLICA_MESSAGES_FACTORY = new 
ReplicaMessagesFactory();
+
+    /** Replica group identity, this id is the same as the considered 
partition's id. */
+    private final String replicaGrpId;
+
+    /** Replica listener. */
+    private final ReplicaListener listener;
+
+    /**
+     * The map matches an operation id to the future.

Review Comment:
   Let's add more detailed explanation



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaService.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * 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.replicator;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.internal.replicator.exception.ReplicationError;
+import org.apache.ignite.internal.replicator.exception.ReplicationException;
+import 
org.apache.ignite.internal.replicator.exception.ReplicationTimeoutException;
+import org.apache.ignite.internal.replicator.message.ReplicaRequest;
+import org.apache.ignite.internal.replicator.message.ReplicaResponse;
+import org.apache.ignite.lang.IgniteStringFormatter;
+import org.apache.ignite.lang.NodeStoppingException;
+import org.apache.ignite.network.ClusterNode;
+import org.apache.ignite.network.MessagingService;
+import org.apache.ignite.network.TopologyService;
+
+/**
+ * The service is intended to execute requests on replicas.
+ * TODO:IGNITE-17255 Implement ReplicaService.
+ */
+public class ReplicaService {
+    /** Network timeout. */
+    private static final int RPC_TIMEOUT = 3000;
+
+    /** Replica manager. */
+    private final ReplicaManager replicaManager;
+
+    /** Message service. */
+    private final MessagingService messagingService;
+
+    /** Local node. */
+    private final ClusterNode localNode;
+
+    /**
+     * The constructor of replica client.
+     *
+     * @param replicaManager Replica manager.
+     * @param messagingService Cluster message service.
+     * @param topologyService Topology service.
+     */
+    public ReplicaService(
+            ReplicaManager replicaManager,
+            MessagingService messagingService,
+            TopologyService topologyService
+    ) {
+        this.replicaManager = replicaManager;
+        this.messagingService = messagingService;
+
+        this.localNode = topologyService.localMember();
+    }
+
+    /**
+     * Sends request to the replica node.
+     *
+     * @param node Cluster node which holds a replica.
+     * @param req  Replica request.
+     * @return Response future.
+     * @throws NodeStoppingException Is thrown when the node is stopping.
+     */
+    private CompletableFuture<ReplicaResponse> sendToReplica(ClusterNode node, 
ReplicaRequest req) throws NodeStoppingException {
+        if (localNode.equals(node)) {
+            Replica replica = replicaManager.replica(req.replicationGroupId());
+
+            if (replica == null) {
+                //TODO:IGNITE-17255 Provide an exceptional response when the 
replica is absent.
+            }
+
+            return 
CompletableFuture.completedFuture(replica.processRequest(req));
+        }
+
+        return messagingService.invoke(node.address(), req, 
RPC_TIMEOUT).thenApply(msg -> {
+            assert msg instanceof ReplicaResponse : 
IgniteStringFormatter.format("Unexpected message response [resp={}]", msg);
+
+            return (ReplicaResponse) msg;
+        }).whenComplete((response, throwable) -> {
+            if (throwable != null) {
+                if (throwable instanceof TimeoutException) {

Review Comment:
   what if it's not TimeoutException?



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/message/ReplicaResponse.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.internal.replicator.message;
+
+import java.util.UUID;
+import org.apache.ignite.network.NetworkMessage;
+
+/**
+ * Replica response interface.
+ * TODO:IGNITE-17258 Add a specific response type for a replica listener. 
(@Transferable(ReplicaMessageGroup.TYPE_RESPONSE))
+ */
+public interface ReplicaResponse extends NetworkMessage {
+
+    /**
+     * Operation id in the replica with which the response is sent.
+     *
+     * @return Operation id.
+     */
+    UUID operationId();

Review Comment:
   Mmm, I'd actually expected that you will provide client side result awaiting 
logic. I mean that within clientSide ReplicaResponse there will be instant 
response and replication awaiting logic.



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/exception/ReplicationError.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.replicator.exception;
+
+import java.util.HashMap;
+
+/**
+ * Codes of replication errors.
+ */
+public enum ReplicationError {

Review Comment:
   Please consolidate new exceptions with ErrorGroups related logic.



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/message/CompleteOperationRequest.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.replicator.message;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.network.annotations.Marshallable;
+import org.apache.ignite.network.annotations.Transferable;
+
+/**
+ * The request is sent from a coordinator to wait  operations complete.
+ */
+@Transferable(ReplicaMessageGroup.COMPLETE_OP_REQUEST)
+public interface CompleteOperationRequest extends ReplicaRequest {
+
+    /**
+     * Ids of operations that were started before, to wait to complete.
+     *
+     * @return List of operation ids.
+     */
+    @Marshallable
+    List<UUID> operationIds();

Review Comment:
   Order matters?



-- 
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]

Reply via email to