/** {@inheritDoc} */ @Override protected List<IgniteUuid> call0(IgfsContext ctx) throws Exception { IgfsMetaManager meta = ctx.meta(); return meta.idsForPath(path); }
/** * Gets next file for fragmentizer to be processed. * * @param exclude File IDs to exclude (the ones that are currently being processed). * @return File ID to process or {@code null} if there are no such files. * @throws IgniteCheckedException In case of error. */ @Nullable private IgfsEntryInfo fileForFragmentizer(Collection<IgniteUuid> exclude) throws IgniteCheckedException { return fragmentizerEnabled ? igfsCtx.meta().fileForFragmentizer(exclude) : null; }
/** {@inheritDoc} */ @Override protected IgfsEntryInfo call0(IgfsContext ctx) throws Exception { IgfsMetaManager meta = ctx.meta(); return meta.infoForPath(path); }
/** {@inheritDoc} */ @Override protected Void call0(IgfsContext ctx) throws Exception { ctx.meta().unlock(fileId, lockId, modificationTime, updateSpace, space, affRange); return null; }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { IgfsEx igfs = (IgfsEx)grid(0).fileSystem("igfs"); mgr = igfs.context().meta(); }
/** * Flushes this output stream and forces any buffered output bytes to be written out. * * @throws IOException if an I/O error occurs. */ @Override public void flush() throws IOException { synchronized (mux) { checkClosed(null, 0); sendBufferIfNotEmpty(); flushRemainder(); awaitAcks(); // Update file length if needed. if (igfsCtx.configuration().isUpdateFileLengthOnFlush() && space > 0) { try { IgfsEntryInfo fileInfo0 = igfsCtx.meta().reserveSpace(fileInfo.id(), space, streamRange); if (fileInfo0 == null) throw new IOException("File was concurrently deleted: " + path); else fileInfo = fileInfo0; streamRange = initialStreamRange(fileInfo); space = 0; } catch (IgniteCheckedException e) { throw new IOException("Failed to update file length data [path=" + path + ", space=" + space + ']', e); } } } }
/** * Constructor. * * @param igfsCtx IGFS context. */ IgfsDeleteWorker(IgfsContext igfsCtx) { super("igfs-delete-worker%" + igfsCtx.igfs().name() + "%" + igfsCtx.kernalContext().localNodeId() + "%"); this.igfsCtx = igfsCtx; meta = igfsCtx.meta(); data = igfsCtx.data(); assert meta != null; assert data != null; log = igfsCtx.kernalContext().log(IgfsDeleteWorker.class); }
IgfsEntryInfo newInfo = igfsCtx.meta().info(fileInfo.id());
log = igfsCtx.kernalContext().log(IgfsImpl.class); evts = igfsCtx.kernalContext().event(); meta = igfsCtx.meta(); data = igfsCtx.data(); secondaryFs = cfg.getSecondaryFileSystem();
IgniteUuid fileId = req.fileId(); IgfsEntryInfo fileInfo = igfsCtx.meta().info(fileId); case RANGE_STATUS_INITIAL: { updated = igfsCtx.meta().updateInfo( fileId, new IgfsMetaFileRangeUpdateProcessor(range, RANGE_STATUS_MOVING)); updated = igfsCtx.meta().updateInfo( fileId, new IgfsMetaFileRangeUpdateProcessor(range, RANGE_STATUS_MOVED)); updated = igfsCtx.meta().updateInfo(fileId, new IgfsMetaFileRangeDeleteProcessor(range));
IgfsMetaManager meta = igfs(0).context().meta();
/** * @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); }
IgfsMetaManager meta = igfs.context().meta();
/** * 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); } } }
/** * Gets next file for fragmentizer to be processed. * * @param exclude File IDs to exclude (the ones that are currently being processed). * @return File ID to process or {@code null} if there are no such files. * @throws IgniteCheckedException In case of error. */ @Nullable private IgfsEntryInfo fileForFragmentizer(Collection<IgniteUuid> exclude) throws IgniteCheckedException { return fragmentizerEnabled ? igfsCtx.meta().fileForFragmentizer(exclude) : null; }
/** {@inheritDoc} */ @Override protected Void call0(IgfsContext ctx) throws Exception { ctx.meta().unlock(fileId, lockId, modificationTime, updateSpace, space, affRange); return null; }
/** {@inheritDoc} */ @Override protected IgfsEntryInfo call0(IgfsContext ctx) throws Exception { IgfsMetaManager meta = ctx.meta(); return meta.infoForPath(path); }
/** {@inheritDoc} */ @Override protected List<IgniteUuid> call0(IgfsContext ctx) throws Exception { IgfsMetaManager meta = ctx.meta(); return meta.idsForPath(path); }
/** * Constructor. * * @param igfsCtx IGFS context. */ IgfsDeleteWorker(IgfsContext igfsCtx) { super("igfs-delete-worker%" + igfsCtx.igfs().name() + "%" + igfsCtx.kernalContext().localNodeId() + "%"); this.igfsCtx = igfsCtx; meta = igfsCtx.meta(); data = igfsCtx.data(); assert meta != null; assert data != null; log = igfsCtx.kernalContext().log(IgfsDeleteWorker.class); }