Examples of GridGgfsMode


Examples of org.gridgain.grid.ggfs.GridGgfsMode

            boolean initSecondary = paths.defaultMode() == PROXY;

            if (paths.pathModes() != null) {
                for (T2<GridGgfsPath, GridGgfsMode> pathMode : paths.pathModes()) {
                    GridGgfsMode mode = pathMode.getValue();

                    initSecondary |= mode == PROXY;
                }
            }
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        enterBusy();

        try {
            GridGgfsPath path = convert(f);
            GridGgfsMode mode = modeRslvr.resolveMode(path);

            if (mode == PROXY) {
                FSDataInputStream is = secondaryFs.open(toSecondary(f), bufSize);

                if (clientLog.isLogEnabled()) {
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        OutputStream out = null;

        try {
            GridGgfsPath path = convert(f);
            GridGgfsMode mode = modeRslvr.resolveMode(path);

            if (LOG.isDebugEnabled())
                LOG.debug("Opening output stream in create [thread=" + Thread.currentThread().getName() + "path=" +
                    path + ", overwrite=" + overwrite + ", bufSize=" + bufSize + ']');
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        enterBusy();

        try {
            GridGgfsPath path = convert(f);
            GridGgfsMode mode = modeRslvr.resolveMode(path);
            Set<GridGgfsMode> childrenModes = modeRslvr.resolveChildrenModes(path);

            if (childrenModes.contains(PROXY)) {
                if (clientLog.isLogEnabled())
                    clientLog.logDelete(path, PROXY, recursive);
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        enterBusy();

        try {
            GridGgfsPath path = convert(f);
            GridGgfsMode mode = modeRslvr.resolveMode(path);

            if (mode == PROXY) {
                FileStatus[] arr = secondaryFs.listStatus(toSecondary(f));

                if (arr == null)
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        enterBusy();

        try {
            GridGgfsPath path = convert(f);
            GridGgfsMode mode = modeRslvr.resolveMode(path);

            if (mode == PROXY) {
                if (clientLog.isLogEnabled())
                    clientLog.logMakeDirectory(path, PROXY);
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        GridGgfsPath path = new GridGgfsPath(pathStr);

        GridGgfsModeResolver rslvr = ggfs.modeResolver();

        GridGgfsMode mode = rslvr.resolveMode(path);

        assertEquals(expMode, mode);
    }
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        meta = ggfsCtx.meta();
        data = ggfsCtx.data();
        secondaryFs = cfg.getSecondaryFileSystem();

        /* Default GGFS mode. */
        GridGgfsMode dfltMode;

        if (secondaryFs == null) {
            if (cfg.getDefaultMode() == PROXY)
                throw new GridException("Mode cannot be PROXY if secondary file system hasn't been defined.");

            dfltMode = PRIMARY;
        }
        else
            dfltMode = cfg.getDefaultMode();

        Map<String, GridGgfsMode> cfgModes = new LinkedHashMap<>();
        Map<String, GridGgfsMode> dfltModes = new LinkedHashMap<>(4, 1.0f);

        dfltModes.put("/gridgain/primary", PRIMARY);

        if (secondaryFs != null) {
            dfltModes.put("/gridgain/proxy", PROXY);
            dfltModes.put("/gridgain/sync", DUAL_SYNC);
            dfltModes.put("/gridgain/async", DUAL_ASYNC);
        }

        cfgModes.putAll(dfltModes);

        if (ggfsCtx.configuration().getPathModes() != null) {
            for (Map.Entry<String, GridGgfsMode> e : ggfsCtx.configuration().getPathModes().entrySet()) {
                if (!dfltModes.containsKey(e.getKey()))
                    cfgModes.put(e.getKey(), e.getValue());
                else
                    U.warn(log, "Ignoring path mode because it conflicts with GridGain reserved path " +
                        "(use another path) [mode=" + e.getValue() + ", path=" + e.getKey() + ']');
            }
        }

        ArrayList<T2<GridGgfsPath, GridGgfsMode>> modes = null;

        if (!cfgModes.isEmpty()) {
            modes = new ArrayList<>(cfgModes.size());

            for (Map.Entry<String, GridGgfsMode> mode : cfgModes.entrySet()) {
                GridGgfsMode mode0 = secondaryFs == null ? mode.getValue() == PROXY ? PROXY : PRIMARY : mode.getValue();

                try {
                    modes.add(new T2<>(new GridGgfsPath(mode.getKey()), mode0));
                }
                catch (IllegalArgumentException e) {
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

        A.notNull(path, "path");

        if (log.isDebugEnabled())
            log.debug("Check file exists: " + path);

        GridGgfsMode mode = modeRslvr.resolveMode(path);

        if (mode == PROXY)
            throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);

        boolean res = false;
View Full Code Here

Examples of org.gridgain.grid.ggfs.GridGgfsMode

                A.notNull(path, "path");

                if (log.isDebugEnabled())
                    log.debug("Get file info: " + path);

                GridGgfsMode mode = modeRslvr.resolveMode(path);

                if (mode == PROXY)
                    throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);

                GridGgfsFileInfo info = resolveFileInfo(path, mode);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.