Search in sources :

Example 1 with IgfsMetaDirectoryListingRenameProcessor

use of org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingRenameProcessor in project ignite by apache.

the class IgfsMetaManager method transferEntry.

/**
     * Transfer entry from one directory to another.
     *
     * @param entry Entry to be transferred.
     * @param srcId Source ID.
     * @param srcName Source name.
     * @param destId Destination ID.
     * @param destName Destination name.
     * @throws IgniteCheckedException If failed.
     */
private void transferEntry(IgfsListingEntry entry, IgniteUuid srcId, String srcName, IgniteUuid destId, String destName) throws IgniteCheckedException {
    validTxState(true);
    if (F.eq(srcId, destId))
        id2InfoPrj.invoke(srcId, new IgfsMetaDirectoryListingRenameProcessor(srcName, destName));
    else {
        Map<IgniteUuid, EntryProcessor<IgniteUuid, IgfsEntryInfo, Void>> procMap = new HashMap<>();
        procMap.put(srcId, new IgfsMetaDirectoryListingRemoveProcessor(srcName, entry.fileId()));
        procMap.put(destId, new IgfsMetaDirectoryListingAddProcessor(destName, entry));
        id2InfoPrj.invokeAll(procMap);
    }
}
Also used : IgfsMetaDirectoryListingAddProcessor(org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingAddProcessor) EntryProcessor(javax.cache.processor.EntryProcessor) HashMap(java.util.HashMap) IgniteUuid(org.apache.ignite.lang.IgniteUuid) IgfsMetaDirectoryListingRemoveProcessor(org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingRemoveProcessor) IgfsMetaDirectoryListingRenameProcessor(org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingRenameProcessor)

Aggregations

HashMap (java.util.HashMap)1 EntryProcessor (javax.cache.processor.EntryProcessor)1 IgfsMetaDirectoryListingAddProcessor (org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingAddProcessor)1 IgfsMetaDirectoryListingRemoveProcessor (org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingRemoveProcessor)1 IgfsMetaDirectoryListingRenameProcessor (org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryListingRenameProcessor)1 IgniteUuid (org.apache.ignite.lang.IgniteUuid)1