Search in sources :

Example 1 with IgfsClientMkdirsCallable

use of org.apache.ignite.internal.processors.igfs.client.IgfsClientMkdirsCallable in project ignite by apache.

the class IgfsImpl method mkdirs.

/** {@inheritDoc} */
@Override
public void mkdirs(final IgfsPath path, @Nullable final Map<String, String> props) {
    A.notNull(path, "path");
    if (meta.isClient()) {
        meta.runClientTask(new IgfsClientMkdirsCallable(cfg.getName(), IgfsUserContext.currentUser(), path, props));
        return;
    }
    safeOp(new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            if (log.isDebugEnabled())
                log.debug("Make directories: " + path);
            IgfsMode mode = resolveMode(path);
            switch(mode) {
                case PRIMARY:
                    meta.mkdirs(path, props == null ? DFLT_DIR_META : new HashMap<>(props));
                    break;
                case DUAL_ASYNC:
                case DUAL_SYNC:
                    await(path);
                    meta.mkdirsDual(secondaryFs, path, props);
                    break;
                case PROXY:
                    secondaryFs.mkdirs(path, props);
                    break;
            }
            return null;
        }
    });
}
Also used : IgfsMode(org.apache.ignite.igfs.IgfsMode) IgfsClientMkdirsCallable(org.apache.ignite.internal.processors.igfs.client.IgfsClientMkdirsCallable) IgfsPathIsDirectoryException(org.apache.ignite.igfs.IgfsPathIsDirectoryException) IgfsInvalidPathException(org.apache.ignite.igfs.IgfsInvalidPathException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) IgfsException(org.apache.ignite.igfs.IgfsException) IgfsPathNotFoundException(org.apache.ignite.igfs.IgfsPathNotFoundException)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1 IgfsException (org.apache.ignite.igfs.IgfsException)1 IgfsInvalidPathException (org.apache.ignite.igfs.IgfsInvalidPathException)1 IgfsMode (org.apache.ignite.igfs.IgfsMode)1 IgfsPathIsDirectoryException (org.apache.ignite.igfs.IgfsPathIsDirectoryException)1 IgfsPathNotFoundException (org.apache.ignite.igfs.IgfsPathNotFoundException)1 IgfsClientMkdirsCallable (org.apache.ignite.internal.processors.igfs.client.IgfsClientMkdirsCallable)1