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) {