ascherbakoff commented on code in PR #7950:
URL: https://github.com/apache/ignite-3/pull/7950#discussion_r3071321790


##########
modules/core/src/main/java/org/apache/ignite/internal/lang/ReplicaOverloadedException.java:
##########
@@ -15,31 +15,19 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.jdbc.util;
+package org.apache.ignite.internal.lang;
 
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
+import static 
org.apache.ignite.lang.ErrorGroups.Replicator.GROUP_OVERLOADED_ERR;
 
 /**
- * Functional interface for extracting a value from the current row of a 
{@link ResultSet}.
- *
- * @param <T> Type of the extracted value.
+ * Thrown when the node has reached the maximum number of in-flight partition 
operations
+ * ({@code replication.maxInFlightPartitionOperationsPerCore}) and cannot 
accept new requests.
  */
-@FunctionalInterface
-public interface RowColumnProjection<T> {
-    /** Extracts a value from the current row of {@code rs}. */
-    T extract(ResultSet rs) throws SQLException;
-
-    /** Drains result set to list by projecting each record with provided 
extractor. */
-    static <T> List<T> projectRowsColumn(ResultSet rs, RowColumnProjection<T> 
extractor) throws SQLException {
-        List<T> result = new ArrayList<>();
-
-        while (rs.next()) {
-            result.add(extractor.extract(rs));
-        }
+public class ReplicaOverloadedException extends IgniteInternalException {
+    private static final long serialVersionUID = -6023736883539658779L;
 
-        return result;
+    /** Constructor. */
+    public ReplicaOverloadedException() {
+        super(GROUP_OVERLOADED_ERR, "Node is overloaded: max in-flight 
partition operations limit reached.");

Review Comment:
   A separate error code is needed: REPLICA_OVERLOADED_ERR



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