/** {@inheritDoc} */ @Nullable @Override public String name() { return cfg.getName(); }
/** {@inheritDoc} */ @Nullable @Override public String name() { return cfg.getName(); }
/** {@inheritDoc} */ @Override public <T, R> GridFuture<R> execute(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) { return ggfsCtx.kernalContext().task().execute(task, new GridGgfsTaskArgsImpl<>(cfg.getName(), paths, rslvr, skipNonExistentFiles, maxRangeLen, arg)); }
/** {@inheritDoc} */ @Override public <T, R> GridFuture<R> execute(Class<? extends GridGgfsTask<T, R>> taskCls, @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeSize, @Nullable T arg) { return ggfsCtx.kernalContext().task().execute((Class<GridGgfsTask<T, R>>)taskCls, new GridGgfsTaskArgsImpl<>(cfg.getName(), paths, rslvr, skipNonExistentFiles, maxRangeSize, arg)); }
/** {@inheritDoc} */ @Override public <T, R> GridFuture<R> execute(Class<? extends GridGgfsTask<T, R>> taskCls, @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeSize, @Nullable T arg) { return ggfsCtx.kernalContext().task().execute((Class<GridGgfsTask<T, R>>)taskCls, new GridGgfsTaskArgsImpl<>(cfg.getName(), paths, rslvr, skipNonExistentFiles, maxRangeSize, arg)); }
/** {@inheritDoc} */ @Override public <T, R> GridFuture<R> execute(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) { return ggfsCtx.kernalContext().task().execute(task, new GridGgfsTaskArgsImpl<>(cfg.getName(), paths, rslvr, skipNonExistentFiles, maxRangeLen, arg)); }
/** {@inheritDoc} */ @Override public void onKernalStop(boolean cancel) { for (GridGgfsContext ggfsCtx : ggfsCache.values()) { if (log.isDebugEnabled()) log.debug("Stopping ggfs: " + ggfsCtx.configuration().getName()); List<GridGgfsManager> mgrs = ggfsCtx.managers(); for (ListIterator<GridGgfsManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) { GridGgfsManager mgr = it.previous(); mgr.onKernalStop(cancel); } } if (log.isDebugEnabled()) log.debug("Finished executing GGFS processor onKernalStop() callback."); }
/** * Checks if given node is a GGFS node. * * @param node Node to check. * @return {@code True} if node has GGFS with this name, {@code false} otherwise. */ public boolean ggfsNode(GridNode node) { assert node != null; GridGgfsAttributes[] ggfs = node.attribute(ATTR_GGFS); if (ggfs != null) for (GridGgfsAttributes attrs : ggfs) if (F.eq(cfg.getName(), attrs.ggfsName())) return true; return false; }
/** {@inheritDoc} */ @Override public void onKernalStop(boolean cancel) { for (GridGgfsContext ggfsCtx : ggfsCache.values()) { if (log.isDebugEnabled()) log.debug("Stopping ggfs: " + ggfsCtx.configuration().getName()); List<GridGgfsManager> mgrs = ggfsCtx.managers(); for (ListIterator<GridGgfsManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) { GridGgfsManager mgr = it.previous(); mgr.onKernalStop(cancel); } } if (log.isDebugEnabled()) log.debug("Finished executing GGFS processor onKernalStop() callback."); }
/** * Checks if given node is a GGFS node. * * @param node Node to check. * @return {@code True} if node has GGFS with this name, {@code false} otherwise. */ public boolean ggfsNode(GridNode node) { assert node != null; GridGgfsAttributes[] ggfs = node.attribute(ATTR_GGFS); if (ggfs != null) for (GridGgfsAttributes attrs : ggfs) if (F.eq(cfg.getName(), attrs.ggfsName())) return true; return false; }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) { // Stop GGFS instances. for (GridGgfsContext ggfsCtx : ggfsCache.values()) { if (log.isDebugEnabled()) log.debug("Stopping ggfs: " + ggfsCtx.configuration().getName()); List<GridGgfsManager> mgrs = ggfsCtx.managers(); for (ListIterator<GridGgfsManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) { GridGgfsManager mgr = it.previous(); mgr.stop(cancel); } ggfsCtx.ggfs().stop(); } ggfsCache.clear(); if (log.isDebugEnabled()) log.debug("GGFS processor stopped."); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) { // Stop GGFS instances. for (GridGgfsContext ggfsCtx : ggfsCache.values()) { if (log.isDebugEnabled()) log.debug("Stopping ggfs: " + ggfsCtx.configuration().getName()); List<GridGgfsManager> mgrs = ggfsCtx.managers(); for (ListIterator<GridGgfsManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) { GridGgfsManager mgr = it.previous(); mgr.stop(cancel); } ggfsCtx.ggfs().stop(); } ggfsCache.clear(); if (log.isDebugEnabled()) log.debug("GGFS processor stopped."); }
ggfsCfg.getName(), ggfsCfg.getBlockSize(), ((GridGgfsGroupDataBlocksKeyMapper)affMapper).groupSize(),
/** {@inheritDoc} */ @Override protected void start0() throws GridException { cfg = ggfsCtx.configuration(); metaCache = ggfsCtx.kernalContext().cache().cache(cfg.getMetaCacheName()); if (metaCache.configuration().getAtomicityMode() != TRANSACTIONAL) throw new GridException("Meta cache should be transactional: " + cfg.getMetaCacheName()); evts = ggfsCtx.kernalContext().event(); sampling = new GridGgfsSamplingKey(cfg.getName()); assert metaCache != null; id2InfoPrj = (GridCacheProjectionEx<GridUuid, GridGgfsFileInfo>)metaCache.<GridUuid, GridGgfsFileInfo>cache(); log = ggfsCtx.kernalContext().log(GridGgfsMetaManager.class); }
/** {@inheritDoc} */ @Override protected void start0() throws GridException { if (!ggfsCtx.configuration().isFragmentizerEnabled()) return; // We care only about node leave and fail events. ggfsCtx.kernalContext().event().addLocalEventListener(new GridLocalEventListener() { @Override public void onEvent(GridEvent evt) { assert evt.type() == EVT_NODE_LEFT || evt.type() == EVT_NODE_FAILED; GridDiscoveryEvent discoEvt = (GridDiscoveryEvent)evt; checkLaunchCoordinator(discoEvt); } }, EVT_NODE_LEFT, EVT_NODE_FAILED); fragmentizerWorker = new FragmentizerWorker(); String ggfsName = ggfsCtx.configuration().getName(); topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); ggfsCtx.kernalContext().io().addMessageListener(topic, fragmentizerWorker); new GridThread(fragmentizerWorker).start(); }
/** {@inheritDoc} */ @Override protected void start0() throws GridException { if (!ggfsCtx.configuration().isFragmentizerEnabled()) return; // We care only about node leave and fail events. ggfsCtx.kernalContext().event().addLocalEventListener(new GridLocalEventListener() { @Override public void onEvent(GridEvent evt) { assert evt.type() == EVT_NODE_LEFT || evt.type() == EVT_NODE_FAILED; GridDiscoveryEvent discoEvt = (GridDiscoveryEvent)evt; checkLaunchCoordinator(discoEvt); } }, EVT_NODE_LEFT, EVT_NODE_FAILED); fragmentizerWorker = new FragmentizerWorker(); String ggfsName = ggfsCtx.configuration().getName(); topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); ggfsCtx.kernalContext().io().addMessageListener(topic, fragmentizerWorker); new GridThread(fragmentizerWorker).start(); }
/** {@inheritDoc} */ @Override protected void start0() throws GridException { cfg = ggfsCtx.configuration(); metaCache = ggfsCtx.kernalContext().cache().cache(cfg.getMetaCacheName()); metaCacheStartFut = ggfsCtx.kernalContext().cache().internalCache(cfg.getMetaCacheName()).preloader() .startFuture(); if (metaCache.configuration().getAtomicityMode() != TRANSACTIONAL) throw new GridException("Meta cache should be transactional: " + cfg.getMetaCacheName()); evts = ggfsCtx.kernalContext().event(); sampling = new GridGgfsSamplingKey(cfg.getName()); assert metaCache != null; id2InfoPrj = (GridCacheProjectionEx<GridUuid, GridGgfsFileInfo>)metaCache.<GridUuid, GridGgfsFileInfo>cache(); log = ggfsCtx.kernalContext().log(GridGgfsMetaManager.class); }
String ggfsName = ggfsCtx.configuration().getName();
VisorGgfsConfig cfg = new VisorGgfsConfig(); cfg.name(ggfs.getName()); cfg.metaCacheName(ggfs.getMetaCacheName()); cfg.dataCacheName(ggfs.getDataCacheName());
metaCacheName = cfg.getMetaCacheName(); mgmtPort = cfg.getManagementPort(); name = cfg.getName(); pathModes = cfg.getPathModes(); perNodeBatchSize = cfg.getPerNodeBatchSize();