ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [8/8] incubator-ignite git commit: # IGNITE-414: Finalization.
Date Tue, 10 Mar 2015 14:20:35 GMT
# IGNITE-414: Finalization.


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

Branch: refs/heads/ignite-414
Commit: 8310d07dc462525b9dcc50d57b3beb252dcfcad9
Parents: 6dacd4e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Mar 10 17:20:31 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Mar 10 17:20:31 2015 +0300

----------------------------------------------------------------------
 .../igfs/IgfsParentNotDirectoryException.java   |  2 +-
 .../igfs/IgfsPathAlreadyExistsException.java    |  3 +-
 .../ignite/igfs/IgfsPathNotFoundException.java  |  2 +-
 .../internal/processors/igfs/IgfsUtils.java     |  2 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   | 31 +++++++-------------
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |  2 ++
 6 files changed, 18 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8310d07d/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
index 86e1167..c2e4eca 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsParentNotDirectoryException.java
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.*;
 /**
  * Exception thrown when parent supposed to be a directory is a file.
  */
-public class IgfsParentNotDirectoryException extends IgfsInvalidPathException {
+public class IgfsParentNotDirectoryException extends IgfsException {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8310d07d/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
index f8a39ca..939f6ba 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathAlreadyExistsException.java
@@ -17,12 +17,13 @@
 
 package org.apache.ignite.igfs;
 
+import org.apache.ignite.internal.processors.igfs.*;
 import org.jetbrains.annotations.*;
 
 /**
  * Exception thrown when target path supposed to be created already exists.
  */
-public class IgfsPathAlreadyExistsException extends IgfsInvalidPathException {
+public class IgfsPathAlreadyExistsException extends IgfsException {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8310d07d/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
index 46ada9a..4172be7 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.*;
 /**
  * {@code IGFS} exception indicating that target resource is not found.
  */
-public class IgfsPathNotFoundException extends IgfsInvalidPathException {
+public class IgfsPathNotFoundException extends IgfsException {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8310d07d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 0264e64..2a915ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -39,7 +39,7 @@ public class IgfsUtils {
 
         IgfsException igfsErr = X.cause(err, IgfsException.class);
 
-        while (igfsErr != null) {
+        while (igfsErr != null && igfsErr != err0) {
             err0 = igfsErr;
 
             igfsErr = X.cause(err, IgfsException.class);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8310d07d/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
index c6eabde..9dde005 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
@@ -47,6 +47,7 @@ import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;
 /**
  * Test fo regular igfs operations.
  */
+@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
 public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
     /** IGFS block size. */
     protected static final int IGFS_BLOCK_SIZE = 512 * 1024;
@@ -692,25 +693,14 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest
{
     public void testDeleteDirectoryNotEmpty() throws Exception {
         create(igfs, paths(DIR, SUBDIR, SUBSUBDIR), paths(FILE));
 
-        // We have different results for dual and non-dual modes.
-        if (dual)
-            GridTestUtils.assertThrows(log, new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    igfs.delete(SUBDIR, false);
-
-                    return null;
-                }
-            }, IgniteCheckedException.class, "Failed to delete the path due to secondary
file system exception:");
-        else {
-            GridTestUtils.assertThrows(log, new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    igfs.delete(SUBDIR, false);
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                igfs.delete(SUBDIR, false);
 
-                    return null;
-                }
-            }, IgfsDirectoryNotEmptyException.class, "Failed to remove directory (directory
is not empty and " +
-                   "recursive flag is not set)");
-        }
+                return null;
+            }
+        }, IgfsDirectoryNotEmptyException.class, "Failed to remove directory (directory is
not empty and " +
+            "recursive flag is not set)");
 
         checkExist(igfs, igfsSecondary, SUBDIR, SUBSUBDIR, FILE);
     }
@@ -1911,6 +1901,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest
{
      * @param createCnt How many file creations to perform.
      * @throws Exception If failed.
      */
+    @SuppressWarnings("ConstantConditions")
     public void checkDeadlocks(final int lvlCnt, final int childrenDirPerLvl, final int childrenFilePerLvl,
         int primaryLvlCnt, int renCnt, int delCnt,
         int updateCnt, int mkdirsCnt, int createCnt) throws Exception {
@@ -2444,14 +2435,14 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest
{
      * @param igfs IGFS.
      * @throws Exception If failed.
      */
+    @SuppressWarnings("unchecked")
     public static void clear(IgniteFileSystem igfs) throws Exception {
         Field workerMapFld = IgfsImpl.class.getDeclaredField("workerMap");
 
         workerMapFld.setAccessible(true);
 
         // Wait for all workers to finish.
-        Map<IgfsPath, IgfsFileWorker> workerMap =
-            (Map<IgfsPath, IgfsFileWorker>)workerMapFld.get(igfs);
+        Map<IgfsPath, IgfsFileWorker> workerMap = (Map<IgfsPath, IgfsFileWorker>)workerMapFld.get(igfs);
 
         for (Map.Entry<IgfsPath, IgfsFileWorker> entry : workerMap.entrySet()) {
             entry.getValue().cancel();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8310d07d/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index cea510a..e67e661 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -58,6 +58,8 @@ public class IgniteIgfsTestSuite extends TestSuite {
         suite.addTest(new TestSuite(IgfsPrimarySelfTest.class));
         suite.addTest(new TestSuite(IgfsPrimaryOffheapTieredSelfTest.class));
         suite.addTest(new TestSuite(IgfsPrimaryOffheapValuesSelfTest.class));
+        suite.addTest(new TestSuite(IgfsDualSyncSelfTest.class));
+        suite.addTest(new TestSuite(IgfsDualAsyncSelfTest.class));
 
         suite.addTest(new TestSuite(IgfsModeResolverSelfTest.class));
 


Mime
View raw message