maksaska commented on code in PR #12128:
URL: https://github.com/apache/ignite/pull/12128#discussion_r2160127073


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java:
##########
@@ -1033,69 +1034,63 @@ private <T> IgniteInternalFuture<Map<K, 
EntryProcessorResult<T>>> invokeAll0(
     /**
      * Entry point for all public API put/transform methods.
      *
-     * @param map Put map. Either {@code map}, {@code invokeMap} or {@code 
conflictPutMap} should be passed.
-     * @param invokeMap Invoke map. Either {@code map}, {@code invokeMap} or 
{@code conflictPutMap} should be passed.
+     * @param keys Keys.
+     * @param vals Put values. Either {@code vals}, {@code invokeVals} or 
{@code conflictPutVals} should be passed.
+     * @param invokeVals Invoke values. Either {@code vals}, {@code 
invokeVals} or {@code conflictPutVals} should be passed.
      * @param invokeArgs Optional arguments for EntryProcessor.
-     * @param conflictPutMap Conflict put map.
-     * @param conflictRmvMap Conflict remove map.
+     * @param conflictPutVals Conflict put values.
+     * @param conflictRmvVals Conflict remove values.
      * @param retval Return value required flag.
      * @param async Async operation flag.
      * @return Completion future.
      */
     @SuppressWarnings("ConstantConditions")
     private IgniteInternalFuture updateAll0(
-        @Nullable Map<? extends K, ? extends V> map,
-        @Nullable Map<? extends K, ? extends EntryProcessor> invokeMap,
+        @Nullable Collection<?> keys,
+        @Nullable Collection<? extends V> vals,
+        @Nullable Collection<? extends EntryProcessor> invokeVals,
         @Nullable Object[] invokeArgs,
-        @Nullable Map<KeyCacheObject, GridCacheDrInfo> conflictPutMap,
-        @Nullable Map<KeyCacheObject, GridCacheVersion> conflictRmvMap,
+        @Nullable Collection<GridCacheDrInfo> conflictPutVals,
+        @Nullable Collection<GridCacheVersion> conflictRmvVals,
         final boolean retval,
         final GridCacheOperation op,
         boolean async
     ) {
         assert ctx.updatesAllowed();
 
+        assert keys != null : keys;
+
         ctx.checkSecurity(SecurityPermission.CACHE_PUT);
 
         final CacheOperationContext opCtx = ctx.operationContextPerCall();
 
         if (opCtx != null && opCtx.hasDataCenterId()) {
-            assert conflictPutMap == null : conflictPutMap;
-            assert conflictRmvMap == null : conflictRmvMap;
+            assert conflictPutVals == null : conflictPutVals;
+            assert conflictRmvVals == null : conflictRmvVals;
 
             if (op == GridCacheOperation.TRANSFORM) {
-                assert invokeMap != null : invokeMap;
+                assert invokeVals != null : invokeVals;
 
-                conflictPutMap = F.viewReadOnly((Map)invokeMap,
-                    new IgniteClosure<EntryProcessor, GridCacheDrInfo>() {
-                        @Override public GridCacheDrInfo apply(EntryProcessor 
o) {
-                            return new GridCacheDrInfo(o, 
nextVersion(opCtx.dataCenterId()));
-                        }
-                    });
+                conflictPutVals = F.viewReadOnly(invokeVals, o -> new 
GridCacheDrInfo(o, nextVersion(opCtx.dataCenterId())));
 
-                invokeMap = null;
+                invokeVals = null;
             }
             else if (op == GridCacheOperation.DELETE) {
-                assert map != null : map;
+                assert keys != null : keys;

Review Comment:
   Fixed



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java:
##########
@@ -1033,69 +1034,63 @@ private <T> IgniteInternalFuture<Map<K, 
EntryProcessorResult<T>>> invokeAll0(
     /**
      * Entry point for all public API put/transform methods.
      *
-     * @param map Put map. Either {@code map}, {@code invokeMap} or {@code 
conflictPutMap} should be passed.
-     * @param invokeMap Invoke map. Either {@code map}, {@code invokeMap} or 
{@code conflictPutMap} should be passed.
+     * @param keys Keys.
+     * @param vals Put values. Either {@code vals}, {@code invokeVals} or 
{@code conflictPutVals} should be passed.
+     * @param invokeVals Invoke values. Either {@code vals}, {@code 
invokeVals} or {@code conflictPutVals} should be passed.
      * @param invokeArgs Optional arguments for EntryProcessor.
-     * @param conflictPutMap Conflict put map.
-     * @param conflictRmvMap Conflict remove map.
+     * @param conflictPutVals Conflict put values.
+     * @param conflictRmvVals Conflict remove values.
      * @param retval Return value required flag.
      * @param async Async operation flag.
      * @return Completion future.
      */
     @SuppressWarnings("ConstantConditions")
     private IgniteInternalFuture updateAll0(
-        @Nullable Map<? extends K, ? extends V> map,
-        @Nullable Map<? extends K, ? extends EntryProcessor> invokeMap,
+        @Nullable Collection<?> keys,
+        @Nullable Collection<? extends V> vals,
+        @Nullable Collection<? extends EntryProcessor> invokeVals,
         @Nullable Object[] invokeArgs,
-        @Nullable Map<KeyCacheObject, GridCacheDrInfo> conflictPutMap,
-        @Nullable Map<KeyCacheObject, GridCacheVersion> conflictRmvMap,
+        @Nullable Collection<GridCacheDrInfo> conflictPutVals,
+        @Nullable Collection<GridCacheVersion> conflictRmvVals,
         final boolean retval,
         final GridCacheOperation op,
         boolean async
     ) {
         assert ctx.updatesAllowed();
 
+        assert keys != null : keys;
+
         ctx.checkSecurity(SecurityPermission.CACHE_PUT);
 
         final CacheOperationContext opCtx = ctx.operationContextPerCall();
 
         if (opCtx != null && opCtx.hasDataCenterId()) {
-            assert conflictPutMap == null : conflictPutMap;
-            assert conflictRmvMap == null : conflictRmvMap;
+            assert conflictPutVals == null : conflictPutVals;
+            assert conflictRmvVals == null : conflictRmvVals;
 
             if (op == GridCacheOperation.TRANSFORM) {
-                assert invokeMap != null : invokeMap;
+                assert invokeVals != null : invokeVals;
 
-                conflictPutMap = F.viewReadOnly((Map)invokeMap,
-                    new IgniteClosure<EntryProcessor, GridCacheDrInfo>() {
-                        @Override public GridCacheDrInfo apply(EntryProcessor 
o) {
-                            return new GridCacheDrInfo(o, 
nextVersion(opCtx.dataCenterId()));
-                        }
-                    });
+                conflictPutVals = F.viewReadOnly(invokeVals, o -> new 
GridCacheDrInfo(o, nextVersion(opCtx.dataCenterId())));
 
-                invokeMap = null;
+                invokeVals = null;
             }
             else if (op == GridCacheOperation.DELETE) {
-                assert map != null : map;
+                assert keys != null : keys;
+                assert vals != null : vals;
 
-                conflictRmvMap = F.viewReadOnly((Map)map, new IgniteClosure<V, 
GridCacheVersion>() {
-                    @Override public GridCacheVersion apply(V o) {
-                        return nextVersion(opCtx.dataCenterId());
-                    }
-                });
+                conflictRmvVals = F.viewReadOnly(vals, o -> 
nextVersion(opCtx.dataCenterId()));
 
-                map = null;
+                vals = null;
             }
             else {
-                assert map != null : map;
+                assert keys != null : keys;

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to