This is an automated email from the ASF dual-hosted git repository.
apolovtsev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 8d5aef596f IGNITE-22826 Remove gaps from error codes (#4496)
8d5aef596f is described below
commit 8d5aef596fe4925287906a4996584b181d5c1bc2
Author: Alexander Polovtcev <[email protected]>
AuthorDate: Thu Oct 3 14:20:41 2024 +0300
IGNITE-22826 Remove gaps from error codes (#4496)
---
.../java/org/apache/ignite/lang/ErrorGroups.java | 8 ++++++-
.../network/file/exception/ErrorCodes.java | 28 ----------------------
.../file/exception/FileTransferException.java | 2 +-
.../file/exception/FileValidationException.java | 2 +-
modules/platforms/cpp/ignite/common/error_codes.h | 2 ++
modules/platforms/cpp/ignite/odbc/common_types.cpp | 2 ++
.../platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs | 6 +++++
7 files changed, 19 insertions(+), 31 deletions(-)
diff --git a/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
b/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
index 3ddd9434a5..8a73029ff4 100755
--- a/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
+++ b/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
@@ -174,7 +174,7 @@ public class ErrorGroups {
public static final int COLUMN_NOT_FOUND_ERR =
TABLE_ERR_GROUP.registerErrorCode((short) 4);
/** Table is stopping. */
- public static final int TABLE_STOPPING_ERR =
TABLE_ERR_GROUP.registerErrorCode((short) (5));
+ public static final int TABLE_STOPPING_ERR =
TABLE_ERR_GROUP.registerErrorCode((short) 5);
/** Table definition is incorrect. */
public static final int TABLE_DEFINITION_ERR =
TABLE_ERR_GROUP.registerErrorCode((short) 6);
@@ -456,6 +456,12 @@ public class ErrorGroups {
/** Port is in use. */
public static final int PORT_IN_USE_ERR =
NETWORK_ERR_GROUP.registerErrorCode((short) 2);
+ /** File transfer error. */
+ public static final int FILE_TRANSFER_ERR =
NETWORK_ERR_GROUP.registerErrorCode((short) 3);
+
+ /** File validation error. */
+ public static final int FILE_VALIDATION_ERR =
NETWORK_ERR_GROUP.registerErrorCode((short) 4);
+
/** Recipient node has left the physical topology. */
public static final int RECIPIENT_LEFT_ERR =
NETWORK_ERR_GROUP.registerErrorCode((short) 5);
diff --git
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/ErrorCodes.java
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/ErrorCodes.java
deleted file mode 100644
index 5783a2a3f9..0000000000
---
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/ErrorCodes.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.network.file.exception;
-
-import static org.apache.ignite.lang.ErrorGroups.Network.NETWORK_ERR_GROUP;
-
-class ErrorCodes {
- /** File transfer error. */
- static final int FILE_TRANSFER_ERR =
NETWORK_ERR_GROUP.registerErrorCode((short) 3);
-
- /** File validation error. */
- static final int FILE_VALIDATION_ERR =
NETWORK_ERR_GROUP.registerErrorCode((short) 4);
-}
diff --git
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileTransferException.java
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileTransferException.java
index 2caebb293a..b389311c5c 100644
---
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileTransferException.java
+++
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileTransferException.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.network.file.exception;
-import static
org.apache.ignite.internal.network.file.exception.ErrorCodes.FILE_TRANSFER_ERR;
+import static org.apache.ignite.lang.ErrorGroups.Network.FILE_TRANSFER_ERR;
import org.apache.ignite.lang.IgniteException;
diff --git
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileValidationException.java
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileValidationException.java
index 67e110a62a..f8bf6cc632 100644
---
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileValidationException.java
+++
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/exception/FileValidationException.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.network.file.exception;
-import static
org.apache.ignite.internal.network.file.exception.ErrorCodes.FILE_VALIDATION_ERR;
+import static org.apache.ignite.lang.ErrorGroups.Network.FILE_VALIDATION_ERR;
import org.apache.ignite.lang.IgniteException;
diff --git a/modules/platforms/cpp/ignite/common/error_codes.h
b/modules/platforms/cpp/ignite/common/error_codes.h
index 479297a33b..2634c25eb2 100644
--- a/modules/platforms/cpp/ignite/common/error_codes.h
+++ b/modules/platforms/cpp/ignite/common/error_codes.h
@@ -161,6 +161,8 @@ enum class code : underlying_t {
// Network group. Group code: 11
UNRESOLVABLE_CONSISTENT_ID = 0xb0001,
PORT_IN_USE = 0xb0002,
+ FILE_TRANSFER = 0xb0003,
+ FILE_VALIDATION = 0xb0004,
RECIPIENT_LEFT = 0xb0005,
ADDRESS_UNRESOLVED = 0xb0006,
diff --git a/modules/platforms/cpp/ignite/odbc/common_types.cpp
b/modules/platforms/cpp/ignite/odbc/common_types.cpp
index e4feab83ec..73e792d7b9 100644
--- a/modules/platforms/cpp/ignite/odbc/common_types.cpp
+++ b/modules/platforms/cpp/ignite/odbc/common_types.cpp
@@ -240,6 +240,8 @@ sql_state error_code_to_sql_state(error::code code) {
// Network group. Group code: 11
case error::code::UNRESOLVABLE_CONSISTENT_ID:
case error::code::PORT_IN_USE:
+ case error::code::FILE_TRANSFER:
+ case error::code::FILE_VALIDATION:
case error::code::RECIPIENT_LEFT:
case error::code::ADDRESS_UNRESOLVED:
return sql_state::S08001_CANNOT_CONNECT;
diff --git a/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
b/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
index c3f7c7fb09..a9b55c46bd 100644
--- a/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
@@ -401,6 +401,12 @@ namespace Apache.Ignite
/// <summary> PortInUse error. </summary>
public const int PortInUse = (GroupCode << 16) | (2 & 0xFFFF);
+ /// <summary> FileTransfer error. </summary>
+ public const int FileTransfer = (GroupCode << 16) | (3 & 0xFFFF);
+
+ /// <summary> FileValidation error. </summary>
+ public const int FileValidation = (GroupCode << 16) | (4 & 0xFFFF);
+
/// <summary> RecipientLeft error. </summary>
public const int RecipientLeft = (GroupCode << 16) | (5 & 0xFFFF);