@Override public T call() throws Exception { return call0(igfs.context()); } });
/** {@inheritDoc} */ @Override public final T call() throws Exception { assert ignite != null; final IgfsEx igfs = (IgfsEx)ignite.fileSystem(igfsName); if (user != null) { return IgfsUserContext.doAs(user, new Callable<T>() { @Override public T call() throws Exception { return call0(igfs.context()); } }); } else return call0(igfs.context()); }
/** {@inheritDoc} */ @Override public void close(boolean force) { notifyListenersOnClose(); String gridName = igfs.context().kernalContext().grid().name(); synchronized (REF_CTR_MUX) { Integer cnt = REF_CTRS.get(gridName); if (cnt != null) { // The node was created by this HadoopIgfsWrapper. // The node must be stopped when there are not opened filesystems that are used one. if (cnt > 1) REF_CTRS.put(gridName, cnt - 1); else { REF_CTRS.remove(gridName); G.stop(gridName, false); } } } }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { IgfsEx igfs = (IgfsEx)grid(0).fileSystem("igfs"); mgr = igfs.context().meta(); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { IgfsEx igfs = (IgfsEx)grid(0).fileSystem("igfs"); mgr = igfs.context().data(); }
G.stop(primary.context().kernalContext().grid().name(), true);
/** * Gets meta cache. * * @param igfs The IGFS instance. * @return The data cache. */ protected static GridCacheAdapter<IgniteUuid, IgfsEntryInfo> getMetaCache(IgniteFileSystem igfs) { String dataCacheName = igfs.configuration().getMetaCacheConfiguration().getName(); IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid(); return ((IgniteKernal)igniteEx).internalCache(dataCacheName); }
/** * Gets the data cache instance for this IGFS instance. * * @param igfs The IGFS unstance. * @return The data cache. */ protected static GridCacheAdapter<IgfsBlockKey, byte[]> getDataCache(IgniteFileSystem igfs) { String dataCacheName = igfs.configuration().getDataCacheConfiguration().getName(); IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid(); return ((IgniteKernal)igniteEx).internalCache(dataCacheName); }
/** * @param gridIdx Grid index. * @param path Path to await. * @throws Exception If failed. */ protected void awaitFileFragmenting(int gridIdx, IgfsPath path) throws Exception { IgfsEx igfs = (IgfsEx)grid(gridIdx).fileSystem("igfs"); IgfsMetaManager meta = igfs.context().meta(); IgniteUuid fileId = meta.fileId(path); if (fileId == null) throw new IgfsPathNotFoundException("File not found: " + path); IgfsEntryInfo fileInfo = meta.info(fileId); do { if (fileInfo == null) throw new IgfsPathNotFoundException("File not found: " + path); if (fileInfo.fileMap().ranges().isEmpty()) return; U.sleep(100); fileInfo = meta.info(fileId); } while (true); }
/** * Create data transfer object for given IGFS metrics. * * @param igfs Source IGFS. */ public VisorIgfsMetrics(IgniteFileSystem igfs) { assert igfs != null; IgfsMetrics m = igfs.metrics(); totalSpaceSz = ((IgfsEx)igfs).context().data().maxSpaceSize(); usedSpaceSz = m.localSpaceSize(); foldersCnt = m.directoriesCount(); filesCnt = m.filesCount(); filesOpenedForRd = m.filesOpenedForRead(); filesOpenedForWrt = m.filesOpenedForWrite(); blocksRd = m.blocksReadTotal(); blocksRdRmt = m.blocksReadRemote(); blocksWrt = m.blocksWrittenTotal(); blocksWrtRmt = m.blocksWrittenRemote(); bytesRd = m.bytesRead(); bytesRdTm = m.bytesReadTime(); bytesWrt = m.bytesWritten(); bytesWrtTm = m.bytesWriteTime(); }
/** * Ensure that the given paths exist in the given IGFS. * * @param uni filesystem. * @param paths Paths. * @throws IgniteCheckedException If failed. */ protected void checkExist(IgfsSecondaryFileSystemTestAdapter uni, IgfsPath... paths) throws IgniteCheckedException { IgfsEx ex = uni.igfs(); for (IgfsPath path : paths) { if (ex != null) assert ex.context().meta().fileId(path) != null : "Path doesn't exist [igfs=" + ex.name() + ", path=" + path + ']'; try { assert uni.exists(path.toString()) : "Path doesn't exist [igfs=" + uni.name() + ", path=" + path + ']'; } catch (IOException ioe) { throw new IgniteCheckedException(ioe); } } }
.getName(); IgfsFragmentizerManager fragmentizer = impl.context().fragmentizer();
assertNotNull(metaCache.get(info.id())); IgfsDataManager dataMgr = ((IgfsEx)igfs).context().data();
@Override public T call() throws Exception { return call0(igfs.context()); } });
/** {@inheritDoc} */ @Override public final T call() throws Exception { assert ignite != null; final IgfsEx igfs = (IgfsEx)ignite.fileSystem(igfsName); if (user != null) { return IgfsUserContext.doAs(user, new Callable<T>() { @Override public T call() throws Exception { return call0(igfs.context()); } }); } else return call0(igfs.context()); }
/** * Create data transfer object for given IGFS metrics. * * @param igfs Source IGFS. */ public VisorIgfsMetrics(IgniteFileSystem igfs) { assert igfs != null; IgfsMetrics m = igfs.metrics(); totalSpaceSz = ((IgfsEx)igfs).context().data().maxSpaceSize(); usedSpaceSz = m.localSpaceSize(); foldersCnt = m.directoriesCount(); filesCnt = m.filesCount(); filesOpenedForRd = m.filesOpenedForRead(); filesOpenedForWrt = m.filesOpenedForWrite(); blocksRd = m.blocksReadTotal(); blocksRdRmt = m.blocksReadRemote(); blocksWrt = m.blocksWrittenTotal(); blocksWrtRmt = m.blocksWrittenRemote(); bytesRd = m.bytesRead(); bytesRdTm = m.bytesReadTime(); bytesWrt = m.bytesWritten(); bytesWrtTm = m.bytesWriteTime(); }