/** <inheritDoc /> */ public Task <TRes> InvokeAsync <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { IgniteArgumentCheck.NotNull(key, "key"); IgniteArgumentCheck.NotNull(processor, "processor"); StartTx(); var holder = new CacheEntryProcessorHolder(processor, arg, (e, a) => processor.Process((IMutableCacheEntry <TK, TV>)e, (TArg)a), typeof(TK), typeof(TV)); return(DoOutOpAsync(CacheOp.InvokeAsync, writer => { writer.Write(key); writer.Write(holder); }, r => { if (r == null) { return default(TRes); } var hasError = r.ReadBoolean(); if (hasError) { throw ReadException(r); } return r.ReadObject <TRes>(); })); }
/** <inheritDoc /> */ public TR Invoke <TR, TA>(TK key, ICacheEntryProcessor <TK, TV, TA, TR> processor, TA arg) { var result = _cache.Invoke(key, processor, arg); SetLastAsyncOp(CacheOp.Invoke); return(result); }
/** <inheritDoc /> */ public IDictionary <TK, ICacheEntryProcessorResult <TR> > InvokeAll <TR, TA>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TA, TR> processor, TA arg) { var result = _cache.InvokeAll(keys, processor, arg); SetLastAsyncOp(CacheOp.InvokeAll); return(result); }
/** <inheritdoc /> */ public TRes Invoke <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { IgniteArgumentCheck.NotNull(key, "key"); IgniteArgumentCheck.NotNull(processor, "processor"); var holder = new CacheEntryProcessorHolder(processor, arg, (e, a) => processor.Process((IMutableCacheEntry <TK, TV>)e, (TArg)a), typeof(TK), typeof(TV)); return(DoOutInOp((int)CacheOp.Invoke, writer => { writer.Write(key); writer.Write(holder); }, input => GetResultOrThrow <TRes>(Unmarshal <object>(input)))); }
/** <inheritdoc /> */ public TRes Invoke <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { IgniteArgumentCheck.NotNull(key, "key"); IgniteArgumentCheck.NotNull(processor, "processor"); var holder = new CacheEntryProcessorHolder(processor, arg, (e, a) => processor.Process((IMutableCacheEntry <TK, TV>)e, (TArg)a), typeof(TK), typeof(TV)); return(DoOutInOpX((int)CacheOp.Invoke, writer => { writer.Write(key); writer.Write(holder); }, (input, res) => res == True ? Unmarshal <TRes>(input) : default(TRes), ReadException)); }
/** <inheritDoc /> */ public Task <TRes> InvokeAsync <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { AsyncInstance.Invoke(key, processor, arg); return(AsyncInstance.GetTask(CacheOp.Invoke, r => { if (r == null) { return default(TRes); } var hasError = r.ReadBoolean(); if (hasError) { throw ReadException(r.Stream); } return r.ReadObject <TRes>(); })); }
/** <inheritDoc /> */ public TRes Invoke <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { return(_cache.InvokeAsync(key, processor, arg).GetResult()); }
/** <inheritDoc /> */ public Task <ICollection <ICacheEntryProcessorResult <TK, TRes> > > InvokeAllAsync <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { IgniteArgumentCheck.NotNull(keys, "keys"); IgniteArgumentCheck.NotNull(processor, "processor"); StartTx(); var holder = new CacheEntryProcessorHolder(processor, arg, (e, a) => processor.Process((IMutableCacheEntry <TK, TV>)e, (TArg)a), typeof(TK), typeof(TV)); return(DoOutOpAsync(CacheOp.InvokeAllAsync, writer => { writer.WriteEnumerable(keys); writer.Write(holder); }, input => ReadInvokeAllResults <TRes>(input))); }
/** <inheritdoc /> */ public ICollection <ICacheEntryProcessorResult <TK, TRes> > InvokeAll <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { IgniteArgumentCheck.NotNull(keys, "keys"); IgniteArgumentCheck.NotNull(processor, "processor"); StartTx(); var holder = new CacheEntryProcessorHolder(processor, arg, (e, a) => processor.Process((IMutableCacheEntry <TK, TV>)e, (TArg)a), typeof(TK), typeof(TV)); return(DoOutInOpX((int)CacheOp.InvokeAll, writer => { writer.WriteEnumerable(keys); writer.Write(holder); }, (input, res) => res == True ? ReadInvokeAllResults <TRes>(Marshaller.StartUnmarshal(input, IsKeepBinary)) : null, _readException)); }
/** <inheritDoc /> */ public IDictionary <TK, ICacheEntryProcessorResult <TRes> > InvokeAll <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { return(GetResult(_cache.InvokeAllAsync(keys, processor, arg))); }
/** <inheritDoc /> */ public Task <IDictionary <TK, ICacheEntryProcessorResult <TRes> > > InvokeAllAsync <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { AsyncInstance.InvokeAll(keys, processor, arg); return(AsyncInstance.GetTask(CacheOp.InvokeAll, reader => ReadInvokeAllResults <TRes>(reader.Stream))); }
/** <inheritDoc /> */ public TR Invoke <TR, TA>(TK key, ICacheEntryProcessor <TK, TV, TA, TR> processor, TA arg) { _cache.Invoke(key, processor, arg); return(GetResult <TR>()); }
/** <inheritDoc /> */ public Task <TRes> InvokeAsync <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { return(_cache.InvokeAsync(key, processor, arg)); }
/// <summary> /// Initializes a new instance of the <see cref="StreamTransformer{K, V, A, R}"/> class. /// </summary> /// <param name="proc">Entry processor.</param> public StreamTransformer(ICacheEntryProcessor <TK, TV, TArg, TRes> proc) { IgniteArgumentCheck.NotNull(proc, "proc"); _proc = proc; }
public Task <ICollection <ICacheEntryProcessorResult <int, TRes> > > InvokeAllAsync <TArg, TRes>(IEnumerable <int> keys, ICacheEntryProcessor <int, int, TArg, TRes> processor, TArg arg) { throw new NotImplementedException(); }
public Task <TRes> InvokeAsync <TArg, TRes>(int key, ICacheEntryProcessor <int, int, TArg, TRes> processor, TArg arg) { throw new NotImplementedException(); }
public IDictionary <int, ICacheEntryProcessorResult <TRes> > InvokeAll <TArg, TRes>(IEnumerable <int> keys, ICacheEntryProcessor <int, int, TArg, TRes> processor, TArg arg) { throw new NotImplementedException(); }
/** <inheritDoc /> */ public Task <ICollection <ICacheEntryProcessorResult <TK, TRes> > > InvokeAllAsync <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { return(_cache.InvokeAllAsync(keys, processor, arg)); }
/** <inheritdoc /> */ public IDictionary <TK, ICacheEntryProcessorResult <TRes> > InvokeAll <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { IgniteArgumentCheck.NotNull(keys, "keys"); IgniteArgumentCheck.NotNull(processor, "processor"); var holder = new CacheEntryProcessorHolder(processor, arg, (e, a) => processor.Process((IMutableCacheEntry <TK, TV>)e, (TArg)a), typeof(TK), typeof(TV)); return(DoOutInOp((int)CacheOp.InvokeAll, writer => { WriteEnumerable(writer, keys); writer.Write(holder); }, input => ReadInvokeAllResults <TRes>(input))); }