@Override public IgniteFileSystem apply(IgfsContext igfsCtx) { return igfsCtx.igfs(); } };
/** {@inheritDoc} */ @Override @Nullable public IgniteFileSystem igfs(String name) { if (name == null) throw new IllegalArgumentException("IGFS name cannot be null"); IgfsContext igfsCtx = igfsCache.get(name); return igfsCtx == null ? null : igfsCtx.igfs(); }
/** {@inheritDoc} */ @Override protected Void call0(IgfsContext ctx) throws Exception { ctx.igfs().rename(path, destPath); return null; }
/** {@inheritDoc} */ @Override protected Void call0(IgfsContext ctx) throws Exception { ctx.igfs().mkdirs(path, props); return null; }
/** {@inheritDoc} */ @Override protected Collection<IgfsBlockLocation> call0(IgfsContext ctx) throws Exception { return ctx.igfs().affinity(path, start, len, maxLen); }
/** {@inheritDoc} */ @Override protected Void call0(IgfsContext ctx) throws Exception { ctx.igfs().setTimes(path, modificationTime, accessTime); return null; }
/** {@inheritDoc} */ @Override protected Long call0(IgfsContext ctx) throws Exception { return ctx.igfs().size(path); }
/** {@inheritDoc} */ @Override protected IgfsPathSummary call0(IgfsContext ctx) throws Exception { return ctx.igfs().summary(path); }
/** {@inheritDoc} */ @Override protected IgfsFile call0(IgfsContext ctx) throws Exception { return ctx.igfs().update(path, props); }
/** {@inheritDoc} */ @Override protected IgfsFile call0(IgfsContext ctx) throws Exception { return ctx.igfs().info(path); }
/** {@inheritDoc} */ @Override protected Collection<IgfsFile> call0(IgfsContext ctx) throws Exception { return ctx.igfs().listFiles(path); }
/** {@inheritDoc} */ @Override protected Collection<IgfsPath> call0(IgfsContext ctx) throws Exception { return ctx.igfs().listPaths(path); }
/** {@inheritDoc} */ @Override protected Boolean call0(IgfsContext ctx) throws Exception { return ctx.igfs().exists(path); }
/** {@inheritDoc} */ @Override protected Boolean call0(IgfsContext ctx) throws Exception { return ctx.igfs().delete(path, recursive); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { mgr.igfsCtx.igfs().clear(); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) { // Stop IGFS instances. for (IgfsContext igfsCtx : igfsCache.values()) { if (log.isDebugEnabled()) log.debug("Stopping igfs: " + igfsCtx.configuration().getName()); List<IgfsManager> mgrs = igfsCtx.managers(); for (ListIterator<IgfsManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) { IgfsManager mgr = it.previous(); mgr.stop(cancel); } igfsCtx.igfs().stop(cancel); } igfsCache.clear(); if (log.isDebugEnabled()) log.debug("IGFS processor stopped."); }
/** * Constructs IGFS IPC handler. * * @param igfsCtx Context. * @param endpointCfg Endpoint configuration. * @param mgmt Management flag. */ IgfsIpcHandler(IgfsContext igfsCtx, IgfsIpcEndpointConfiguration endpointCfg, boolean mgmt) { assert igfsCtx != null; ctx = igfsCtx.kernalContext(); igfs = igfsCtx.igfs(); // Keep buffer size multiple of block size so no extra byte array copies is performed. bufSize = igfsCtx.configuration().getBlockSize() * 2; // Create thread pool for request handling. int threadCnt = endpointCfg.getThreadCount(); String prefix = "igfs-" + igfsCtx.igfs().name() + (mgmt ? "mgmt-" : "") + "-ipc"; pool = new IgniteThreadPoolExecutor(prefix, igfsCtx.kernalContext().igniteInstanceName(), threadCnt, threadCnt, Long.MAX_VALUE, new LinkedBlockingQueue<Runnable>()); log = ctx.log(IgfsIpcHandler.class); }
/** * 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); }
null, null, igfsCtx.igfs().evictExclude(curPath, false), status.properties(), status.accessTime(),
affKey, createFileLockId(false), igfsCtx.igfs().evictExclude(path, false), status.properties(), status.accessTime(),