IGNITE-8950 More informative file validation check message - Fixes #4322.

Signed-off-by: Dmitriy Pavlov <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/66acc566
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/66acc566
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/66acc566

Branch: refs/heads/ignite-5797
Commit: 66acc566a939e1e7c051b73f1525c7f23dd7ea1d
Parents: b12d738
Author: Evgeny Stanilovskiy <[email protected]>
Authored: Fri Sep 28 10:04:45 2018 +0300
Committer: Dmitriy Pavlov <[email protected]>
Committed: Fri Sep 28 10:04:45 2018 +0300

----------------------------------------------------------------------
 .../cache/persistence/file/FilePageStore.java           | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/66acc566/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
index 4bb7513..110807c 100755
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
@@ -194,29 +194,31 @@ public class FilePageStore implements PageStore {
 
         long signature = hdr.getLong();
 
+        String prefix = "Failed to verify, file=" + cfgFile.getAbsolutePath() 
+ "\" ";
+
         if (SIGNATURE != signature)
-            throw new IOException("Failed to verify store file (invalid file 
signature)" +
+            throw new IOException(prefix + "(invalid file signature)" +
                 " [expectedSignature=" + U.hexLong(SIGNATURE) +
                 ", actualSignature=" + U.hexLong(signature) + ']');
 
         int ver = hdr.getInt();
 
         if (version() != ver)
-            throw new IOException("Failed to verify store file (invalid file 
version)" +
+            throw new IOException(prefix + "(invalid file version)" +
                 " [expectedVersion=" + version() +
                 ", fileVersion=" + ver + "]");
 
         byte type = hdr.get();
 
         if (this.type != type)
-            throw new IOException("Failed to verify store file (invalid file 
type)" +
+            throw new IOException(prefix + "(invalid file type)" +
                 " [expectedFileType=" + this.type +
                 ", actualFileType=" + type + "]");
 
         int pageSize = hdr.getInt();
 
         if (dbCfg.getPageSize() != pageSize)
-            throw new IOException("Failed to verify store file (invalid page 
size)" +
+            throw new IOException(prefix + "(invalid page size)" +
                 " [expectedPageSize=" + dbCfg.getPageSize() +
                 ", filePageSize=" + pageSize + "]");
 
@@ -226,7 +228,7 @@ public class FilePageStore implements PageStore {
             fileSize = pageSize + headerSize();
 
         if ((fileSize - headerSize()) % pageSize != 0)
-            throw new IOException("Failed to verify store file (invalid file 
size)" +
+            throw new IOException(prefix + "(invalid file size)" +
                 " [fileSize=" + U.hexLong(fileSize) +
                 ", pageSize=" + U.hexLong(pageSize) + ']');
 

Reply via email to