Search in sources :

Example 31 with IgfsPath

use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.

the class IgfsDualAbstractSelfTest method testMoveRenameFileDestinationRootSourceMissingPartially.

/**
 * Test file move and rename when destination is the root and source is missing partially.
 *
 * @throws Exception If failed.
 */
public void testMoveRenameFileDestinationRootSourceMissingPartially() throws Exception {
    IgfsPath file = new IgfsPath("/" + FILE.name());
    create(igfsSecondary, paths(DIR, SUBDIR), paths(FILE));
    create(igfs, paths(DIR), null);
    igfs.rename(FILE, file);
    checkExist(igfs, SUBDIR);
    checkExist(igfs, igfsSecondary, file);
    checkNotExist(igfs, igfsSecondary, FILE);
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath)

Example 32 with IgfsPath

use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.

the class IgfsDualAbstractSelfTest method testMoveRenameDirectorySourceParentRootDestinationMissingPartially.

/**
 * Test directory move and rename when source parent is the root and destination is missing partially.
 *
 * @throws Exception If failed.
 */
public void testMoveRenameDirectorySourceParentRootDestinationMissingPartially() throws Exception {
    IgfsPath dir = new IgfsPath("/" + SUBSUBDIR_NEW.name());
    create(igfsSecondary, paths(DIR_NEW, SUBDIR_NEW, dir), null);
    create(igfs, paths(DIR_NEW), null);
    igfs.rename(dir, SUBSUBDIR_NEW);
    checkExist(igfs, SUBDIR_NEW);
    checkExist(igfs, igfsSecondary, SUBSUBDIR_NEW);
    checkNotExist(igfs, igfsSecondary, dir);
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath)

Example 33 with IgfsPath

use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.

the class IgfsDualAbstractSelfTest method testMoveRenameFileSourceParentRootDestinationMissing.

/**
 * Test file move and rename when source parent is the root and destination is missing.
 *
 * @throws Exception If failed.
 */
public void testMoveRenameFileSourceParentRootDestinationMissing() throws Exception {
    IgfsPath file = new IgfsPath("/" + FILE_NEW.name());
    create(igfsSecondary, paths(DIR_NEW, SUBDIR_NEW), paths(file));
    create(igfs, null, null);
    igfs.rename(file, FILE_NEW);
    checkExist(igfs, DIR_NEW, SUBDIR_NEW);
    checkExist(igfs, igfsSecondary, FILE_NEW);
    checkNotExist(igfs, igfsSecondary, file);
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath)

Example 34 with IgfsPath

use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.

the class IgfsDualAbstractSelfTest method testMoveDirectoryDestinationMissingPartially.

/**
 * Test move in case destination exists partially and the path being renamed is a directory.
 *
 * @throws Exception If failed.
 */
public void testMoveDirectoryDestinationMissingPartially() throws Exception {
    create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW, SUBDIR_NEW), null);
    create(igfs, paths(DIR, SUBDIR, SUBSUBDIR, DIR_NEW), null);
    igfs.rename(SUBSUBDIR, SUBDIR_NEW);
    checkExist(igfs, SUBDIR_NEW);
    checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, SUBSUBDIR.name()));
    checkNotExist(igfs, igfsSecondary, SUBSUBDIR);
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath)

Example 35 with IgfsPath

use of org.apache.ignite.igfs.IgfsPath in project ignite by apache.

the class IgfsDualAbstractSelfTest method testMoveFileSourceParentRootDestinationMissingPartially.

/**
 * Test file move when source parent is the root and destination is missing partially.
 *
 * @throws Exception If failed.
 */
public void testMoveFileSourceParentRootDestinationMissingPartially() throws Exception {
    IgfsPath file = new IgfsPath("/" + FILE.name());
    create(igfsSecondary, paths(DIR_NEW, SUBDIR_NEW), paths(file));
    create(igfs, paths(DIR_NEW), null);
    igfs.rename(file, SUBDIR_NEW);
    checkExist(igfs, SUBDIR_NEW);
    checkExist(igfs, igfsSecondary, new IgfsPath(SUBDIR_NEW, FILE.name()));
    checkNotExist(igfs, igfsSecondary, file);
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath)

Aggregations

IgfsPath (org.apache.ignite.igfs.IgfsPath)161 IgfsOutputStream (org.apache.ignite.igfs.IgfsOutputStream)24 IOException (java.io.IOException)22 ArrayList (java.util.ArrayList)15 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)14 HashMap (java.util.HashMap)13 IgniteException (org.apache.ignite.IgniteException)13 IgniteFileSystem (org.apache.ignite.IgniteFileSystem)13 IgfsFile (org.apache.ignite.igfs.IgfsFile)13 IgfsException (org.apache.ignite.igfs.IgfsException)12 IgniteUuid (org.apache.ignite.lang.IgniteUuid)11 IgfsBlockLocation (org.apache.ignite.igfs.IgfsBlockLocation)10 Map (java.util.Map)9 Path (org.apache.hadoop.fs.Path)9 IgfsInputStream (org.apache.ignite.igfs.IgfsInputStream)9 IgfsPathNotFoundException (org.apache.ignite.igfs.IgfsPathNotFoundException)8 FileNotFoundException (java.io.FileNotFoundException)6 OutputStream (java.io.OutputStream)6 IgfsDirectoryNotEmptyException (org.apache.ignite.igfs.IgfsDirectoryNotEmptyException)6 IgfsParentNotDirectoryException (org.apache.ignite.igfs.IgfsParentNotDirectoryException)6