Search in sources :

Example 26 with EntryProcessor

use of javax.cache.processor.EntryProcessor 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

EntryProcessor (javax.cache.processor.EntryProcessor)26 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)12 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)9 CacheObject (org.apache.ignite.internal.processors.cache.CacheObject)9 KeyCacheObject (org.apache.ignite.internal.processors.cache.KeyCacheObject)9 LinkedHashMap (java.util.LinkedHashMap)8 GridCacheEntryRemovedException (org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException)7 CacheInvokeEntry (org.apache.ignite.internal.processors.cache.CacheInvokeEntry)6 GridCacheVersion (org.apache.ignite.internal.processors.cache.version.GridCacheVersion)6 GridCacheContext (org.apache.ignite.internal.processors.cache.GridCacheContext)5 Map (java.util.Map)4 EntryProcessorResult (javax.cache.processor.EntryProcessorResult)4 MutableEntry (javax.cache.processor.MutableEntry)4 IgniteException (org.apache.ignite.IgniteException)4 StorageException (org.apache.ignite.internal.pagemem.wal.StorageException)4 CacheOperationContext (org.apache.ignite.internal.processors.cache.CacheOperationContext)4 IgniteTxTimeoutCheckedException (org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException)4 GridClosureException (org.apache.ignite.internal.util.lang.GridClosureException)4 SQLException (java.sql.SQLException)3