@Override public Boolean onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception { fs.mkdirs(path, props); assert !infos.isEmpty(); // Now perform synchronization again starting with the last created parent. GridGgfsPath parentPath = null; for (GridGgfsPath curPath : infos.keySet()) { if (parentPath == null || curPath.isSubDirectoryOf(parentPath)) parentPath = curPath; } assert parentPath != null; GridGgfsFileInfo parentPathInfo = infos.get(parentPath); synchronize(fs, parentPath, parentPathInfo, path, true, null); if (evts.isRecordable(EVT_GGFS_DIR_CREATED)) { GridGgfsPath evtPath = path; while (!parentPath.equals(evtPath)) { pendingEvts.addFirst(new GridGgfsEvent(evtPath, locNode, EVT_GGFS_DIR_CREATED)); evtPath = evtPath.parent(); assert evtPath != null; // If this fails, then ROOT does not exist. } } return true; }
@Override public Boolean onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception { fs.mkdirs(path, props); assert !infos.isEmpty(); // Now perform synchronization again starting with the last created parent. GridGgfsPath parentPath = null; for (GridGgfsPath curPath : infos.keySet()) { if (parentPath == null || curPath.isSubDirectoryOf(parentPath)) parentPath = curPath; } assert parentPath != null; GridGgfsFileInfo parentPathInfo = infos.get(parentPath); synchronize(fs, parentPath, parentPathInfo, path, true, null); if (evts.isRecordable(EVT_GGFS_DIR_CREATED)) { GridGgfsPath evtPath = path; while (!parentPath.equals(evtPath)) { pendingEvts.addFirst(new GridGgfsEvent(evtPath, locNode, EVT_GGFS_DIR_CREATED)); evtPath = evtPath.parent(); assert evtPath != null; // If this fails, then ROOT does not exist. } } return true; }
/** {@inheritDoc} */ @SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod") @Override public void close() throws IOException { if (closeGuard.compareAndSet(false, true)) { super.close(); metrics.decrementFilesOpenedForRead(); if (evts.isRecordable(EVT_GGFS_FILE_CLOSED_READ)) evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_CLOSED_READ, bytes())); } } }
/** {@inheritDoc} */ @SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod") @Override protected void onClose() throws IOException { if (closeGuard.compareAndSet(false, true)) { super.onClose(); metrics.decrementFilesOpenedForWrite(); if (evts.isRecordable(EVT_GGFS_FILE_CLOSED_WRITE)) evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_CLOSED_WRITE, bytes())); } } }
/** {@inheritDoc} */ @SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod") @Override protected void onClose() throws IOException { if (closeGuard.compareAndSet(false, true)) { super.onClose(); metrics.decrementFilesOpenedForWrite(); if (evts.isRecordable(EVT_GGFS_FILE_CLOSED_WRITE)) evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_CLOSED_WRITE, bytes())); } } }
/** {@inheritDoc} */ @SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod") @Override public void close() throws IOException { if (closeGuard.compareAndSet(false, true)) { super.close(); metrics.decrementFilesOpenedForRead(); if (evts.isRecordable(EVT_GGFS_FILE_CLOSED_READ)) evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_CLOSED_READ, bytes())); } } }
evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_META_UPDATED, props));
pendingEvts.add(new GridGgfsEvent( src, destInfo == null ? dest : new GridGgfsPath(dest, src.name()), pendingEvts.add(new GridGgfsEvent(src, dest, locNode, EVT_GGFS_DIR_RENAMED));
if (desc.isFile) { if (evts.isRecordable(EVT_GGFS_FILE_DELETED)) evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_DELETED)); evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_DIR_DELETED));
pendingEvts.add(new GridGgfsEvent( src, destInfo == null ? dest : new GridGgfsPath(dest, src.name()), pendingEvts.add(new GridGgfsEvent(src, dest, locNode, EVT_GGFS_DIR_RENAMED));
evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_META_UPDATED, props));
if (desc.isFile) { if (evts.isRecordable(EVT_GGFS_FILE_DELETED)) evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_DELETED)); evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_DIR_DELETED));
evts.record(new GridGgfsEvent(curPath, localNode(), EVT_GGFS_DIR_CREATED));
evts.record(new GridGgfsEvent(curPath, localNode(), EVT_GGFS_DIR_CREATED));
evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_CREATED)); evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_OPENED_WRITE));
evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_CREATED)); evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_OPENED_WRITE));
evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_OPENED_READ)); evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_OPENED_READ));
evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_OPENED_READ)); evts.record(new GridGgfsEvent(path, localNode(), EVT_GGFS_FILE_OPENED_READ));
evts.record(new GridGgfsEvent(info.path(), ggfsCtx.kernalContext().discovery().localNode(), EVT_GGFS_FILE_PURGED)); else
evts.record(new GridGgfsEvent(info.path(), ggfsCtx.kernalContext().discovery().localNode(), EVT_GGFS_FILE_PURGED)); else