You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/08/15 07:38:45 UTC
[16/30] ignite git commit: IGNITE-3676: IGFS: Removed
IgfsDualAbstractSelfTest#testOpenNoPrefetch, This closes #948.
IGNITE-3676: IGFS: Removed IgfsDualAbstractSelfTest#testOpenNoPrefetch, This closes #948.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c132a7a3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c132a7a3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c132a7a3
Branch: refs/heads/ignite-1926
Commit: c132a7a3c1fa50953e0193cbf3f311243f6be8c2
Parents: d15f65c
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Thu Aug 11 16:27:01 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Aug 11 16:27:01 2016 +0300
----------------------------------------------------------------------
.../igfs/IgfsDualAbstractSelfTest.java | 80 --------------------
1 file changed, 80 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c132a7a3/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
index abc39ef..aea0e97 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
@@ -27,9 +27,7 @@ import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.GridTestUtils;
-import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Iterator;
@@ -1166,84 +1164,6 @@ public abstract class IgfsDualAbstractSelfTest extends IgfsAbstractSelfTest {
}
/**
- * Ensure that no prefetch occurs in case not enough block are read sequentially.
- *
- * @throws Exception If failed.
- */
- @SuppressWarnings({"ResultOfMethodCallIgnored", "ThrowableResultOfMethodCallIgnored"})
- public void testOpenNoPrefetch() throws Exception {
- create(igfsSecondary, paths(DIR, SUBDIR), paths(FILE));
-
- // Write enough data to the secondary file system.
- final int blockSize = IGFS_BLOCK_SIZE;
-
- int totalWritten = 0;
- try (OutputStream out = igfsSecondary.openOutputStream(FILE.toString(), false)) {
-
- while (totalWritten < blockSize * 2 + chunk.length) {
- out.write(chunk);
-
- totalWritten += chunk.length;
- }
- }
-
- awaitFileClose(igfsSecondaryFileSystem, FILE);
-
- // Read the first block.
- int totalRead = 0;
-
- IgfsInputStream in = igfs.open(FILE, blockSize);
-
- final byte[] readBuf = new byte[1024];
-
- while (totalRead + readBuf.length <= blockSize) {
- in.read(readBuf);
-
- totalRead += readBuf.length;
- }
-
- // Now perform seek.
- in.seek(blockSize * 2);
-
- // Read the third block.
- totalRead = 0;
-
- while (totalRead < totalWritten - blockSize * 2) {
- in.read(readBuf);
-
- totalRead += readBuf.length;
- }
-
- // Let's wait for a while because prefetch occurs asynchronously.
- U.sleep(300);
-
- // Remove the file from the secondary file system.
- igfsSecondary.delete(FILE.toString(), false);
-
- // Let's wait for file will be deleted.
- U.sleep(300);
-
- final IgfsInputStream in0 = in;
-
- // Try reading the second block. Should fail.
- GridTestUtils.assertThrows(log, new Callable<Object>() {
- @Override
- public Object call() throws Exception {
- in0.seek(blockSize);
-
- try {
- in0.read(readBuf);
- }
- finally {
- U.closeQuiet(in0);
- }
-
- return null;
- }
- }, IOException.class, "Failed to read data due to secondary file system exception: ");
- }
-
- /**
* Ensure that prefetch occurs in case several blocks are read sequentially.
*
* @throws Exception If failed.