futures: api cleanup
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/65e6ad60 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/65e6ad60 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/65e6ad60 Branch: refs/heads/ignite-47 Commit: 65e6ad60b6d0d942e409980cbd0b2b51a5982797 Parents: 401835c Author: Yakov Zhdanov <yzhda...@gridgain.com> Authored: Thu Mar 5 13:25:31 2015 +0300 Committer: Yakov Zhdanov <yzhda...@gridgain.com> Committed: Thu Mar 5 13:25:31 2015 +0300 ---------------------------------------------------------------------- .../internal/ComputeTaskInternalFuture.java | 2 - .../ignite/internal/GridJobContextImpl.java | 6 +- .../internal/cluster/IgniteClusterImpl.java | 1 - .../affinity/GridAffinityAssignmentCache.java | 17 +--- .../cache/GridCacheEvictionManager.java | 25 +----- .../processors/cache/GridCacheMapEntry.java | 14 +++- .../processors/cache/GridCacheMvcc.java | 3 +- .../processors/cache/GridCacheMvccManager.java | 9 +-- .../processors/cache/GridCacheProcessor.java | 2 +- .../cache/GridCacheSharedContext.java | 2 +- ...ridCacheOptimisticCheckPreparedTxFuture.java | 25 ++---- .../dht/GridDhtAssignmentFetchFuture.java | 14 ++-- .../distributed/dht/GridDhtCacheAdapter.java | 7 +- .../distributed/dht/GridDhtEmbeddedFuture.java | 11 --- .../distributed/dht/GridDhtFinishedFuture.java | 18 +---- .../cache/distributed/dht/GridDhtGetFuture.java | 22 ++---- .../distributed/dht/GridDhtLockFuture.java | 33 ++------ .../dht/GridDhtTransactionalCacheAdapter.java | 12 +-- .../distributed/dht/GridDhtTxFinishFuture.java | 32 ++------ .../distributed/dht/GridDhtTxPrepareFuture.java | 31 +++----- .../dht/GridPartitionedGetFuture.java | 32 ++------ .../dht/atomic/GridDhtAtomicUpdateFuture.java | 5 -- .../dht/atomic/GridNearAtomicUpdateFuture.java | 5 -- .../dht/colocated/GridDhtColocatedCache.java | 4 +- .../colocated/GridDhtColocatedLockFuture.java | 33 ++------ .../dht/preloader/GridDhtForceKeysFuture.java | 25 ------ .../preloader/GridDhtPartitionDemandPool.java | 5 -- .../GridDhtPartitionsExchangeFuture.java | 22 ------ .../dht/preloader/GridDhtPreloader.java | 2 +- .../distributed/near/GridNearCacheAdapter.java | 4 +- .../distributed/near/GridNearGetFuture.java | 27 ++----- .../distributed/near/GridNearLockFuture.java | 33 ++------ .../near/GridNearTxFinishFuture.java | 32 ++------ .../cache/distributed/near/GridNearTxLocal.java | 60 -------------- .../near/GridNearTxPrepareFuture.java | 32 ++------ .../cache/local/GridLocalLockFuture.java | 23 ++---- .../cache/local/GridLocalTxFuture.java | 59 ++------------ .../GridCacheDistributedFieldsQueryFuture.java | 8 -- .../query/GridCacheDistributedQueryFuture.java | 11 --- .../query/GridCacheLocalFieldsQueryFuture.java | 8 -- .../cache/query/GridCacheLocalQueryFuture.java | 8 -- .../query/GridCacheQueryFutureAdapter.java | 14 ++-- .../cache/transactions/IgniteTxHandler.java | 2 +- .../cache/transactions/IgniteTxManager.java | 2 +- .../closure/GridClosureProcessor.java | 10 +-- .../continuous/GridContinuousProcessor.java | 16 ---- .../dataload/GridDataLoaderFuture.java | 14 ---- .../dataload/IgniteDataLoaderImpl.java | 13 ++-- .../processors/igfs/IgfsDataManager.java | 17 +--- .../processors/igfs/IgfsDeleteWorker.java | 2 +- .../internal/processors/igfs/IgfsImpl.java | 2 +- .../processors/query/GridQueryProcessor.java | 2 +- .../processors/rest/GridRestProcessor.java | 2 +- .../service/GridServiceDeploymentFuture.java | 9 +-- .../service/GridServiceProcessor.java | 2 +- .../GridStreamerStageExecutionFuture.java | 20 +---- .../processors/streamer/IgniteStreamerImpl.java | 16 +--- .../internal/util/GridSerializableFuture.java | 28 ------- .../util/future/GridCompoundFuture.java | 33 +------- .../util/future/GridCompoundIdentityFuture.java | 18 +---- .../util/future/GridEmbeddedFuture.java | 17 ++-- .../internal/util/future/GridFutureAdapter.java | 19 +++-- .../internal/util/io/GridFilenameUtils.java | 2 +- .../ignite/internal/util/lang/GridFunc.java | 82 -------------------- .../internal/util/worker/GridWorkerFuture.java | 17 ---- ...dCacheAtomicUsersAffinityMapperSelfTest.java | 7 +- .../GridCachePartitionedLocalStoreSelfTest.java | 7 -- ...chePartitionedOffHeapLocalStoreSelfTest.java | 7 -- .../GridCacheReplicatedLocalStoreSelfTest.java | 7 -- ...heReplicatedUsersAffinityMapperSelfTest.java | 7 +- ...ridCacheTxPartitionedLocalStoreSelfTest.java | 7 -- .../GridCacheTxUsersAffinityMapperSelfTest.java | 7 +- .../distributed/GridCacheEventAbstractTest.java | 17 +--- .../util/future/GridCompoundFutureSelfTest.java | 16 +--- .../util/future/GridFutureAdapterSelfTest.java | 76 ------------------ .../cache/jta/GridCacheXAResource.java | 9 ++- .../processors/schedule/ScheduleFutureImpl.java | 8 -- 77 files changed, 184 insertions(+), 1074 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java index 16ef37e..219cf1b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java @@ -51,8 +51,6 @@ public class ComputeTaskInternalFuture<R> extends GridFutureAdapter<R> { * @param ctx Kernal context. */ public ComputeTaskInternalFuture(ComputeTaskSession ses, GridKernalContext ctx) { - super(); - assert ses != null; assert ctx != null; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java index 4c9992e..81f75a4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobContextImpl.java @@ -41,6 +41,9 @@ public class GridJobContextImpl implements ComputeJobContext, Externalizable { /** */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Kernal context ({@code null} for job result context). */ private GridKernalContext ctx; @@ -50,9 +53,6 @@ public class GridJobContextImpl implements ComputeJobContext, Externalizable { /** Job worker. */ private GridJobWorker job; - /** Logger. */ - private IgniteLogger log; - /** Attributes mux. Do not use this as object is exposed to user. */ private final Object mux = new Object(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java index e42e186..ce5431f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java @@ -416,7 +416,6 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus // Exceeding max line width for readability. GridCompoundFuture<GridTuple3<String, Boolean, String>, Collection<GridTuple3<String, Boolean, String>>> fut = new GridCompoundFuture<>( - ctx, CU.<GridTuple3<String, Boolean, String>>objectsReducer() ); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java index ce7df9a..d06bcf3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java @@ -263,7 +263,7 @@ public class GridAffinityAssignmentCache { } GridFutureAdapter<Long> fut = F.addIfAbsent(readyFuts, topVer, - new AffinityReadyFuture(ctx.kernalContext(), topVer)); + new AffinityReadyFuture(topVer)); aff = head.get(); @@ -430,24 +430,11 @@ public class GridAffinityAssignmentCache { */ private class AffinityReadyFuture extends GridFutureAdapter<Long> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private long reqTopVer; /** - * Empty constructor required by {@link Externalizable}. */ - public AffinityReadyFuture() { - // No-op. - } - - /** - * @param ctx Kernal context. - */ - private AffinityReadyFuture(GridKernalContext ctx, long reqTopVer) { - super(); - + private AffinityReadyFuture(long reqTopVer) { this.reqTopVer = reqTopVer; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java index 8a642f3..2652843 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java @@ -1061,7 +1061,7 @@ public class GridCacheEvictionManager<K, V> extends GridCacheManagerAdapter<K, V EvictionFuture fut = curEvictFut.get(); if (fut == null) { - curEvictFut.compareAndSet(null, new EvictionFuture(cctx.kernalContext())); + curEvictFut.compareAndSet(null, new EvictionFuture()); continue; } @@ -1112,11 +1112,11 @@ public class GridCacheEvictionManager<K, V> extends GridCacheManagerAdapter<K, V } else // Infos were not added, create another future for next iteration. - curEvictFut.compareAndSet(fut, new EvictionFuture(cctx.kernalContext())); + curEvictFut.compareAndSet(fut, new EvictionFuture()); } else // Future has not been locked, create another future for next iteration. - curEvictFut.compareAndSet(fut, new EvictionFuture(cctx.kernalContext())); + curEvictFut.compareAndSet(fut, new EvictionFuture()); } } @@ -1512,10 +1512,7 @@ public class GridCacheEvictionManager<K, V> extends GridCacheManagerAdapter<K, V * Future for synchronized eviction. Result is a tuple: {evicted entries, rejected entries}. */ private class EvictionFuture extends GridFutureAdapter<IgniteBiTuple<Collection<EvictionInfo>, - Collection<EvictionInfo>>> { - /** */ - private static final long serialVersionUID = 0L; - + Collection<EvictionInfo>>> { /** */ private final long id = idGen.incrementAndGet(); @@ -1565,20 +1562,6 @@ public class GridCacheEvictionManager<K, V> extends GridCacheManagerAdapter<K, V private long topVer; /** - * @param ctx Context. - */ - EvictionFuture(GridKernalContext ctx) { - super(); - } - - /** - * Required by {@code Externalizable}. - */ - public EvictionFuture() { - assert false : "This should never happen."; - } - - /** * @return {@code True} if prepare lock was acquired. */ boolean prepareLock() { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index 608970d..c13d199 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -153,9 +153,17 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V> * @param ttl Time to live. * @param hdrId Header id. */ - protected GridCacheMapEntry(GridCacheContext<K, V> cctx, K key, int hash, V val, - GridCacheMapEntry<K, V> next, long ttl, int hdrId) { - log = U.logger(cctx.kernalContext(), logRef, GridCacheMapEntry.class); + protected GridCacheMapEntry( + GridCacheContext<K, V> cctx, + K key, + int hash, + V val, + GridCacheMapEntry<K, V> next, + long ttl, + int hdrId + ) { + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridCacheMapEntry.class); if (cctx.portableEnabled()) key = (K)cctx.kernalContext().portable().detachPortable(key); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java index 116bf0d..38eec0c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvcc.java @@ -63,7 +63,8 @@ public final class GridCacheMvcc<K> { this.cctx = cctx; - log = U.logger(cctx.kernalContext(), logRef, GridCacheMvcc.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridCacheMvcc.class); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java index 5190c7e..3bc5f3e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java @@ -932,7 +932,7 @@ public class GridCacheMvccManager<K, V> extends GridCacheSharedManagerAdapter<K, * @return Explicit locks release future. */ public IgniteInternalFuture<?> finishExplicitLocks(long topVer) { - GridCompoundFuture<Object, Object> res = new GridCompoundFuture<>(cctx.kernalContext()); + GridCompoundFuture<Object, Object> res = new GridCompoundFuture<>(); for (GridCacheExplicitLockSpan<K> span : pendingExplicit.values()) { GridDiscoveryTopologySnapshot snapshot = span.topologySnapshot(); @@ -952,7 +952,7 @@ public class GridCacheMvccManager<K, V> extends GridCacheSharedManagerAdapter<K, * @return Finish update future. */ public IgniteInternalFuture<?> finishAtomicUpdates(long topVer) { - GridCompoundFuture<Object, Object> res = new GridCompoundFuture<>(cctx.kernalContext()); + GridCompoundFuture<Object, Object> res = new GridCompoundFuture<>(); res.ignoreChildFailures(ClusterTopologyCheckedException.class, CachePartialUpdateCheckedException.class); @@ -1040,9 +1040,6 @@ public class GridCacheMvccManager<K, V> extends GridCacheSharedManagerAdapter<K, * */ private class FinishLockFuture extends GridFutureAdapter<Object> { - /** */ - private static final long serialVersionUID = 0L; - /** Topology version. Instance field for toString method only. */ @GridToStringInclude private final long topVer; @@ -1066,8 +1063,6 @@ public class GridCacheMvccManager<K, V> extends GridCacheSharedManagerAdapter<K, * @param entries Entries. */ FinishLockFuture(Iterable<GridDistributedCacheEntry<K, V>> entries, long topVer) { - super(); - assert topVer > 0; this.topVer = topVer; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index 72c2b49..2636474 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -1306,7 +1306,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { .get(order); if (fut == null) { - fut = new GridCompoundFuture<>(ctx); + fut = new GridCompoundFuture<>(); preloadFuts.put(order, fut); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java index 6b17038..292839f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java @@ -383,7 +383,7 @@ public class GridCacheSharedContext<K, V> { */ @SuppressWarnings({"unchecked"}) public IgniteInternalFuture<?> partitionReleaseFuture(long topVer) { - GridCompoundFuture f = new GridCompoundFuture(kernalCtx); + GridCompoundFuture f = new GridCompoundFuture(); f.add(mvcc().finishExplicitLocks(topVer)); f.add(tm().finishTxs(topVer)); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java index 759474c..42b4e97 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java @@ -30,7 +30,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -40,12 +39,12 @@ import java.util.concurrent.atomic.*; */ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompoundIdentityFuture<Boolean> implements GridCacheFuture<Boolean> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Trackable flag. */ private boolean trackable = true; @@ -64,9 +63,6 @@ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompound /** ID of failed node started transaction. */ private final UUID failedNodeId; - /** Logger. */ - private final IgniteLogger log; - /** Transaction nodes mapping. */ private final Map<UUID, Collection<UUID>> txNodes; @@ -86,7 +82,8 @@ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompound this.txNodes = txNodes; this.failedNodeId = failedNodeId; - log = U.logger(cctx.kernalContext(), logRef, GridCacheOptimisticCheckPreparedTxFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridCacheOptimisticCheckPreparedTxFuture.class); nodes = new GridLeanMap<>(); @@ -318,9 +315,6 @@ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompound * */ private class MiniFuture extends GridFutureAdapter<Boolean> { - /** */ - private static final long serialVersionUID = 0L; - /** Mini future ID. */ private final IgniteUuid futId = IgniteUuid.randomUuid(); @@ -328,18 +322,9 @@ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompound private UUID nodeId; /** - * Empty constructor required by {@link Externalizable} - */ - public MiniFuture() { - // No-op. - } - - /** * @param nodeId Node ID. */ private MiniFuture(UUID nodeId) { - super(); - this.nodeId = nodeId; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java index bd4b264..7805487 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java @@ -36,21 +36,18 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*; * Future that fetches affinity assignment from remote cache nodes. */ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<List<ClusterNode>>> { - /** */ - private static final long serialVersionUID = 0L; - /** Nodes order comparator. */ private static final Comparator<ClusterNode> CMP = new GridNodeOrderComparator(); /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Cache context. */ private final GridCacheContext<K, V> ctx; - /** Logger. */ - private IgniteLogger log; - /** List of available nodes this future can fetch data from. */ private Queue<ClusterNode> availableNodes; @@ -69,8 +66,6 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L long topVer, Collection<ClusterNode> availableNodes ) { - super(); - this.ctx = ctx; this.topVer = topVer; @@ -80,7 +75,8 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L this.availableNodes = tmp; - log = U.logger(ctx.kernalContext(), logRef, GridDhtAssignmentFetchFuture.class); + if (log == null) + log = U.logger(ctx.kernalContext(), logRef, GridDhtAssignmentFetchFuture.class); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index 365b884..04ae561 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -266,7 +266,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap for (MultiUpdateFuture multiFut : multiTxFuts.values()) { if (multiFut.topologyVersion() <= topVer) { if (fut == null) - fut = new GridCompoundFuture<>(ctx.kernalContext()); + fut = new GridCompoundFuture<>(); fut.add(multiFut); } @@ -1077,9 +1077,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap * Multi update future. */ private static class MultiUpdateFuture extends GridFutureAdapter<IgniteUuid> { - /** */ - private static final long serialVersionUID = 0L; - /** Topology version. */ private long topVer; @@ -1095,8 +1092,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap * @param topVer Topology version. */ private MultiUpdateFuture(GridKernalContext ctx, long topVer) { - super(); - this.topVer = topVer; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java index 6749491..54633cd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java @@ -23,28 +23,17 @@ import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; -import java.io.*; import java.util.*; /** * Embedded DHT future. */ public class GridDhtEmbeddedFuture<A, B> extends GridEmbeddedFuture<A, B> implements GridDhtFuture<A> { - /** */ - private static final long serialVersionUID = 0L; - /** Retries. */ @GridToStringInclude private Collection<Integer> invalidParts; /** - * Empty constructor required for {@link Externalizable}. - */ - public GridDhtEmbeddedFuture() { - // No-op. - } - - /** * @param embedded Embedded. * @param c Closure. * @param fake Fake. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java index c66336d..659c924 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java @@ -17,40 +17,26 @@ package org.apache.ignite.internal.processors.cache.distributed.dht; -import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.future.*; import org.apache.ignite.internal.util.typedef.internal.*; -import java.io.*; import java.util.*; /** * Finished DHT future. */ public class GridDhtFinishedFuture<T> extends GridFinishedFuture<T> implements GridDhtFuture<T> { - /** */ - private static final long serialVersionUID = 0L; - - /** - * Empty constructor required by {@link Externalizable}. - */ - public GridDhtFinishedFuture() { - // No-op. - } - /** - * @param ctx Context. * @param t Result. */ - public GridDhtFinishedFuture(GridKernalContext ctx, T t) { + public GridDhtFinishedFuture(T t) { super(t); } /** - * @param ctx Context. * @param err Error. */ - public GridDhtFinishedFuture(GridKernalContext ctx, Throwable err) { + public GridDhtFinishedFuture(Throwable err) { super(err); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index c594d36..da797b0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -30,7 +30,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -39,12 +38,12 @@ import java.util.concurrent.atomic.*; */ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Collection<GridCacheEntryInfo<K, V>>> implements GridDhtFuture<Collection<GridCacheEntryInfo<K, V>>> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Message ID. */ private long msgId; @@ -78,9 +77,6 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col /** Transaction. */ private IgniteTxLocalEx<K, V> tx; - /** Logger. */ - private IgniteLogger log; - /** Retries because ownership changed. */ private Collection<Integer> retries = new GridLeanSet<>(); @@ -100,13 +96,6 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col private boolean skipVals; /** - * Empty constructor required for {@link Externalizable}. - */ - public GridDhtGetFuture() { - // No-op. - } - - /** * @param cctx Context. * @param msgId Message ID. * @param reader Reader. @@ -159,7 +148,8 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col ver = tx == null ? cctx.versions().next() : tx.xidVersion(); - log = U.logger(cctx.kernalContext(), logRef, GridDhtGetFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridDhtGetFuture.class); } /** @@ -326,7 +316,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col if (f != null) { if (txFut == null) - txFut = new GridCompoundFuture<>(cctx.kernalContext(), CU.boolReducer()); + txFut = new GridCompoundFuture<>(CU.boolReducer()); txFut.add(f); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java index ad5923c..bef6468 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java @@ -37,7 +37,6 @@ import org.jdk8.backport.*; import org.jetbrains.annotations.*; import javax.cache.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -49,12 +48,12 @@ import static org.apache.ignite.internal.processors.dr.GridDrType.*; */ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Boolean> implements GridCacheMvccFuture<K, V, Boolean>, GridDhtFuture<Boolean>, GridCacheMappedVersion { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Cache registry. */ @GridToStringExclude private GridCacheContext<K, V> cctx; @@ -102,10 +101,6 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo /** Lock timeout. */ private long timeout; - /** Logger. */ - @GridToStringExclude - private IgniteLogger log; - /** Filter. */ private IgnitePredicate<Cache.Entry<K, V>>[] filter; @@ -131,13 +126,6 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo private long accessTtl; /** - * Empty constructor required by {@link Externalizable}. - */ - public GridDhtLockFuture() { - // No-op. - } - - /** * @param cctx Cache context. * @param nearNodeId Near node ID. * @param nearLockVer Near lock version. @@ -198,7 +186,8 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo entries = new ArrayList<>(cnt); - log = U.logger(cctx.kernalContext(), logRef, GridDhtLockFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridDhtLockFuture.class); if (timeout > 0) { timeoutObj = new LockTimeoutObject(); @@ -966,9 +955,6 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo */ private class MiniFuture extends GridFutureAdapter<Boolean> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Node. */ @@ -980,19 +966,10 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo private List<GridDhtCacheEntry<K, V>> dhtMapping; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param node Node. * @param dhtMapping Mapping. */ MiniFuture(ClusterNode node, List<GridDhtCacheEntry<K, V>> dhtMapping) { - super(); - assert node != null; this.node = node; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java index 9057319..dd70681 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java @@ -591,7 +591,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach long accessTtl, IgnitePredicate<Cache.Entry<K, V>>[] filter) { if (keys == null || keys.isEmpty()) - return new GridDhtFinishedFuture<>(ctx.kernalContext(), true); + return new GridDhtFinishedFuture<>(true); GridDhtTxLocalAdapter<K, V> tx = (GridDhtTxLocalAdapter<K, V>)txx; @@ -635,7 +635,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach if (log.isDebugEnabled()) log.debug("Got lock request for cancelled lock (will fail): " + entry); - return new GridDhtFinishedFuture<>(ctx.kernalContext(), e); + return new GridDhtFinishedFuture<>(e); } } } @@ -690,7 +690,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach new C2<Object, Exception, IgniteInternalFuture<GridNearLockResponse<K,V>>>() { @Override public IgniteInternalFuture<GridNearLockResponse<K, V>> apply(Object o, Exception exx) { if (exx != null) - return new GridDhtFinishedFuture<>(ctx.kernalContext(), exx); + return new GridDhtFinishedFuture<>(exx); IgnitePredicate<Cache.Entry<K, V>>[] filter = filter0; @@ -772,7 +772,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach fut.onError(e); - return new GridDhtFinishedFuture<>(ctx.kernalContext(), e); + return new GridDhtFinishedFuture<>(e); } } } @@ -815,7 +815,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach if (tx != null) tx.rollback(); - return new GridDhtFinishedFuture<>(ctx.kernalContext(), new IgniteCheckedException(msg)); + return new GridDhtFinishedFuture<>(new IgniteCheckedException(msg)); } tx.topologyVersion(req.topologyVersion()); @@ -928,7 +928,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach } } - return new GridDhtFinishedFuture<>(ctx.kernalContext(), + return new GridDhtFinishedFuture<>( new IgniteCheckedException(err, e)); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java index 41f235a..631e466 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java @@ -33,7 +33,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -44,12 +43,12 @@ import static org.apache.ignite.transactions.TransactionState.*; */ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFuture<IgniteInternalTx> implements GridCacheFuture<IgniteInternalTx> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Context. */ private GridCacheSharedContext<K, V> cctx; @@ -63,9 +62,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur /** Commit flag. */ private boolean commit; - /** Logger. */ - private IgniteLogger log; - /** Error. */ @GridToStringExclude private AtomicReference<Throwable> err = new AtomicReference<>(null); @@ -80,13 +76,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur private boolean trackable = true; /** - * Empty constructor required for {@link Externalizable}. - */ - public GridDhtTxFinishFuture() { - // No-op. - } - - /** * @param cctx Context. * @param tx Transaction. * @param commit Commit flag. @@ -103,7 +92,8 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur futId = IgniteUuid.randomUuid(); - log = U.logger(cctx.kernalContext(), logRef, GridDhtTxFinishFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridDhtTxFinishFuture.class); } /** {@inheritDoc} */ @@ -416,9 +406,6 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur */ private class MiniFuture extends GridFutureAdapter<IgniteInternalTx> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** DHT mapping. */ @@ -430,19 +417,10 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur private GridDistributedTxMapping<K, V> nearMapping; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param dhtMapping Mapping. * @param nearMapping nearMapping. */ MiniFuture(GridDistributedTxMapping<K, V> dhtMapping, GridDistributedTxMapping<K, V> nearMapping) { - super(); - assert dhtMapping == null || nearMapping == null || dhtMapping.node() == nearMapping.node(); this.dhtMapping = dhtMapping; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java index 58338a8..19b52c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java @@ -37,7 +37,6 @@ import org.jetbrains.annotations.*; import javax.cache.expiry.*; import javax.cache.processor.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -51,12 +50,12 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*; */ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFuture<IgniteInternalTx<K, V>> implements GridCacheMvccFuture<K, V, IgniteInternalTx<K, V>> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Context. */ private GridCacheSharedContext<K, V> cctx; @@ -73,9 +72,6 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu /** DHT mappings. */ private Map<UUID, GridDistributedTxMapping<K, V>> dhtMap; - /** Logger. */ - private IgniteLogger log; - /** Error. */ private AtomicReference<Throwable> err = new AtomicReference<>(null); @@ -166,7 +162,8 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu this.nearMiniId = nearMiniId; - log = U.logger(cctx.kernalContext(), logRef, GridDhtTxPrepareFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridDhtTxPrepareFuture.class); dhtMap = tx.dhtMap(); nearMap = tx.nearMap(); @@ -1106,9 +1103,6 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu */ private class MiniFuture extends GridFutureAdapter<IgniteInternalTx<K, V>> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Node ID. */ @@ -1123,20 +1117,15 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu private GridDistributedTxMapping<K, V> nearMapping; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - super(); - } - - /** * @param nodeId Node ID. * @param dhtMapping Mapping. * @param nearMapping nearMapping. */ - MiniFuture(UUID nodeId, GridDistributedTxMapping<K, V> dhtMapping, GridDistributedTxMapping<K, V> nearMapping) { - super(); - + MiniFuture( + UUID nodeId, + GridDistributedTxMapping<K, V> dhtMapping, + GridDistributedTxMapping<K, V> nearMapping + ) { assert dhtMapping == null || nearMapping == null || dhtMapping.node() == nearMapping.node(); this.nodeId = nodeId; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 511b3c2..824bd40 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -32,7 +32,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -43,15 +42,15 @@ import static org.apache.ignite.IgniteSystemProperties.*; */ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<Map<K, V>> implements GridCacheFuture<Map<K, V>> { - /** */ - private static final long serialVersionUID = 0L; - /** Default max remap count value. */ public static final int DFLT_MAX_REMAP_CNT = 3; /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Maximum number of attempts to remap key to the same primary node. */ private static final int MAX_REMAP_CNT = IgniteSystemProperties.getInteger(IGNITE_NEAR_GET_MAX_REMAPS, DFLT_MAX_REMAP_CNT); @@ -80,9 +79,6 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M /** Version. */ private GridCacheVersion ver; - /** Logger. */ - private IgniteLogger log; - /** Trackable flag. */ private volatile boolean trackable; @@ -105,13 +101,6 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M private boolean skipVals; /** - * Empty constructor required for {@link Externalizable}. - */ - public GridPartitionedGetFuture() { - // No-op. - } - - /** * @param cctx Context. * @param keys Keys. * @param topVer Topology version. @@ -158,7 +147,8 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M ver = cctx.versions().next(); - log = U.logger(cctx.kernalContext(), logRef, GridPartitionedGetFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridPartitionedGetFuture.class); } /** @@ -576,9 +566,6 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M */ private class MiniFuture extends GridFutureAdapter<Map<K, V>> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Node ID. */ @@ -592,20 +579,11 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M private long topVer; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param node Node. * @param keys Keys. * @param topVer Topology version. */ MiniFuture(ClusterNode node, LinkedHashMap<K, Boolean> keys, long topVer) { - super(); - this.node = node; this.keys = keys; this.topVer = topVer; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java index b284b79..4caf543 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java @@ -44,9 +44,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; */ public class GridDhtAtomicUpdateFuture<K, V> extends GridFutureAdapter<Void> implements GridCacheAtomicFuture<K, Void> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); @@ -102,8 +99,6 @@ public class GridDhtAtomicUpdateFuture<K, V> extends GridFutureAdapter<Void> GridNearAtomicUpdateRequest<K, V> updateReq, GridNearAtomicUpdateResponse<K, V> updateRes ) { - super(); - this.cctx = cctx; this.writeVer = writeVer; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java index bf3ec95..f099aa5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java @@ -54,9 +54,6 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*; */ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object> implements GridCacheAtomicFuture<K, Object>{ - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); @@ -179,8 +176,6 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object> UUID subjId, int taskNameHash ) { - super(); - this.rawRetval = rawRetval; assert vals == null || vals.size() == keys.size(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java index f15c66e..dbbac1b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java @@ -633,7 +633,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte new C2<Object, Exception, IgniteInternalFuture<Exception>>() { @Override public IgniteInternalFuture<Exception> apply(Object o, Exception exx) { if (exx != null) - return new GridDhtFinishedFuture<>(ctx.kernalContext(), exx); + return new GridDhtFinishedFuture<>(exx); return lockAllAsync0(cacheCtx, tx, @@ -722,7 +722,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte fut.onError(e); - return new GridDhtFinishedFuture<>(ctx.kernalContext(), e); + return new GridDhtFinishedFuture<>(e); } } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java index 88c7f63..fc83a5a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java @@ -40,7 +40,6 @@ import org.jdk8.backport.*; import org.jetbrains.annotations.*; import javax.cache.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -51,12 +50,12 @@ import static org.apache.ignite.events.EventType.*; */ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentityFuture<Boolean> implements GridCacheFuture<Boolean> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Cache registry. */ @GridToStringExclude private GridCacheContext<K, V> cctx; @@ -90,10 +89,6 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity /** Lock timeout. */ private long timeout; - /** Logger. */ - @GridToStringExclude - private IgniteLogger log; - /** Filter. */ private IgnitePredicate<Cache.Entry<K, V>>[] filter; @@ -115,13 +110,6 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity private long accessTtl; /** - * Empty constructor required by {@link Externalizable}. - */ - public GridDhtColocatedLockFuture() { - // No-op. - } - - /** * @param cctx Registry. * @param keys Keys to lock. * @param tx Transaction. @@ -159,7 +147,8 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity futId = IgniteUuid.randomUuid(); - log = U.logger(cctx.kernalContext(), logRef, GridDhtColocatedLockFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridDhtColocatedLockFuture.class); if (timeout > 0) { timeoutObj = new LockTimeoutObject(); @@ -1086,9 +1075,6 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity */ private class MiniFuture extends GridFutureAdapter<Boolean> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Node ID. */ @@ -1107,21 +1093,12 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity private AtomicBoolean rcvRes = new AtomicBoolean(false); /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param node Node. * @param keys Keys. * @param mappings Mappings to proceed. */ MiniFuture(ClusterNode node, Collection<K> keys, Deque<GridNearLockMapping<K, V>> mappings) { - super(); - this.node = node; this.keys = keys; this.mappings = mappings; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java index 7f655df..40459af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java @@ -31,7 +31,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; @@ -46,9 +45,6 @@ import static org.apache.ignite.internal.processors.dr.GridDrType.*; */ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Object, Collection<K>> implements GridDhtFuture<Collection<K>> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); @@ -96,8 +92,6 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec long topVer, Collection<? extends K> keys, GridDhtPreloader<K, V> preloader ) { - super(cctx.kernalContext()); - assert topVer != 0 : topVer; assert !F.isEmpty(keys) : keys; @@ -113,13 +107,6 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec } /** - * Empty constructor required for {@link Externalizable}. - */ - public GridDhtForceKeysFuture() { - // No-op. - } - - /** * @return Future ID. */ public IgniteUuid futureId() { @@ -372,9 +359,6 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec * node as opposed to multiple nodes. */ private class MiniFuture extends GridFutureAdapter<Object> { - /** */ - private static final long serialVersionUID = 0L; - /** Mini-future ID. */ private IgniteUuid miniId = IgniteUuid.randomUuid(); @@ -394,21 +378,12 @@ public final class GridDhtForceKeysFuture<K, V> extends GridCompoundFuture<Objec private Collection<ClusterNode> exc; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param node Node. * @param keys Keys. * @param curTopVer Topology version for this mini-future. * @param exc Exclude node list. */ MiniFuture(ClusterNode node, Collection<K> keys, int curTopVer, Collection<ClusterNode> exc) { - super(); - assert node != null; assert curTopVer > 0; assert exc != null; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java index 941ffb7..feb6021 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java @@ -1041,9 +1041,6 @@ public class GridDhtPartitionDemandPool<K, V> { * */ private class SyncFuture extends GridFutureAdapter<Object> { - /** */ - private static final long serialVersionUID = 0L; - /** Remaining workers. */ private Collection<DemandWorker> remaining; @@ -1051,8 +1048,6 @@ public class GridDhtPartitionDemandPool<K, V> { * @param workers List of workers. */ private SyncFuture(Collection<DemandWorker> workers) { - super(); - assert workers.size() == poolSize(); remaining = Collections.synchronizedList(new LinkedList<>(workers)); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index ef77cce..b33d426 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -36,7 +36,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.jdk8.backport.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; @@ -49,9 +48,6 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*; */ public class GridDhtPartitionsExchangeFuture<K, V> extends GridFutureAdapter<Long> implements Comparable<GridDhtPartitionsExchangeFuture<K, V>>, GridDhtTopologyFuture { - /** */ - private static final long serialVersionUID = 0L; - /** Dummy flag. */ private final boolean dummy; @@ -156,7 +152,6 @@ public class GridDhtPartitionsExchangeFuture<K, V> extends GridFutureAdapter<Lon DiscoveryEvent discoEvt, GridDhtPartitionExchangeId exchId ) { - super(); dummy = true; forcePreload = false; @@ -178,7 +173,6 @@ public class GridDhtPartitionsExchangeFuture<K, V> extends GridFutureAdapter<Lon */ public GridDhtPartitionsExchangeFuture(GridCacheSharedContext<K, V> cctx, DiscoveryEvent discoEvt, GridDhtPartitionExchangeId exchId) { - super(); dummy = false; forcePreload = true; @@ -198,8 +192,6 @@ public class GridDhtPartitionsExchangeFuture<K, V> extends GridFutureAdapter<Lon */ public GridDhtPartitionsExchangeFuture(GridCacheSharedContext<K, V> cctx, ReadWriteLock busyLock, GridDhtPartitionExchangeId exchId) { - super(); - assert busyLock != null; assert exchId != null; @@ -225,20 +217,6 @@ public class GridDhtPartitionsExchangeFuture<K, V> extends GridFutureAdapter<Lon ", fut=" + this + ']'); } - /** - * Empty constructor required for {@link Externalizable}. - */ - public GridDhtPartitionsExchangeFuture() { - assert false; - - dummy = true; - forcePreload = false; - reassign = false; - - exchId = null; - cctx = null; - } - /** {@inheritDoc} */ @Override public GridDiscoveryTopologySnapshot topologySnapshot() throws IgniteCheckedException { get(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java index ae28dba..c77580a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java @@ -508,7 +508,7 @@ public class GridDhtPreloader<K, V> extends GridCachePreloaderAdapter<K, V> { } }); else { - GridCompoundFuture<Object, Object> compound = new GridCompoundFuture<>(cctx.kernalContext()); + GridCompoundFuture<Object, Object> compound = new GridCompoundFuture<>(); compound.add((IgniteInternalFuture<Object>)startFut); compound.add((IgniteInternalFuture<Object>)topReadyFut); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java index 6555865..fa6fbd9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java @@ -207,7 +207,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public IgniteInternalFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys) { - GridCompoundFuture fut = new GridCompoundFuture(ctx.kernalContext()); + GridCompoundFuture fut = new GridCompoundFuture(); fut.add(super.reloadAllAsync(keys)); fut.add(dht().reloadAllAsync(keys)); @@ -245,7 +245,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda /** {@inheritDoc} */ @SuppressWarnings({"unchecked"}) @Override public IgniteInternalFuture<?> reloadAllAsync() { - GridCompoundFuture fut = new GridCompoundFuture(ctx.kernalContext()); + GridCompoundFuture fut = new GridCompoundFuture(); fut.add(super.reloadAllAsync()); fut.add(dht().reloadAllAsync()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java index ca07dec..1398f69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java @@ -34,7 +34,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -47,15 +46,15 @@ import static org.apache.ignite.transactions.TransactionIsolation.*; */ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Map<K, V>> implements GridCacheFuture<Map<K, V>> { - /** */ - private static final long serialVersionUID = 0L; - /** Default max remap count value. */ public static final int DFLT_MAX_REMAP_CNT = 3; /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Maximum number of attempts to remap key to the same primary node. */ private static final int MAX_REMAP_CNT = getInteger(IGNITE_NEAR_GET_MAX_REMAPS, DFLT_MAX_REMAP_CNT); @@ -83,9 +82,6 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma /** Transaction. */ private IgniteTxLocalEx<K, V> tx; - /** Logger. */ - private IgniteLogger log; - /** Trackable flag. */ private boolean trackable; @@ -108,13 +104,6 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma private IgniteCacheExpiryPolicy expiryPlc; /** - * Empty constructor required for {@link Externalizable}. - */ - public GridNearGetFuture() { - // No-op. - } - - /** * @param cctx Context. * @param keys Keys. * @param readThrough Read through flag. @@ -161,7 +150,8 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma ver = tx == null ? cctx.versions().next() : tx.xidVersion(); - log = U.logger(cctx.kernalContext(), logRef, GridNearGetFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridNearGetFuture.class); } /** @@ -691,13 +681,6 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma private long topVer; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param node Node. * @param keys Keys. * @param savedVers Saved entry versions. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java index f7f7e41..e204f05 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java @@ -39,7 +39,6 @@ import org.jdk8.backport.*; import org.jetbrains.annotations.*; import javax.cache.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -50,12 +49,12 @@ import static org.apache.ignite.events.EventType.*; */ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<Boolean> implements GridCacheMvccFuture<K, V, Boolean> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** */ + private static IgniteLogger log; + /** Cache registry. */ @GridToStringExclude private GridCacheContext<K, V> cctx; @@ -92,10 +91,6 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B /** Lock timeout. */ private long timeout; - /** Logger. */ - @GridToStringExclude - private IgniteLogger log; - /** Filter. */ private IgnitePredicate<Cache.Entry<K, V>>[] filter; @@ -125,13 +120,6 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B private long accessTtl; /** - * Empty constructor required by {@link Externalizable}. - */ - public GridNearLockFuture() { - // No-op. - } - - /** * @param cctx Registry. * @param keys Keys to lock. * @param tx Transaction. @@ -171,7 +159,8 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B entries = new ArrayList<>(keys.size()); - log = U.logger(cctx.kernalContext(), logRef, GridNearLockFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridNearLockFuture.class); if (timeout > 0) { timeoutObj = new LockTimeoutObject(); @@ -1225,9 +1214,6 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B */ private class MiniFuture extends GridFutureAdapter<Boolean> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Node ID. */ @@ -1246,21 +1232,12 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B private AtomicBoolean rcvRes = new AtomicBoolean(false); /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param node Node. * @param keys Keys. * @param mappings Mappings to proceed. */ MiniFuture(ClusterNode node, Collection<K> keys, ConcurrentLinkedDeque8<GridNearLockMapping<K, V>> mappings) { - super(); - this.node = node; this.keys = keys; this.mappings = mappings; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java index 08b6a58..dd5d07d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java @@ -33,7 +33,6 @@ import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; -import java.io.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; @@ -46,12 +45,12 @@ import static org.apache.ignite.transactions.TransactionState.*; */ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFuture<IgniteInternalTx> implements GridCacheFuture<IgniteInternalTx> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Context. */ private GridCacheSharedContext<K, V> cctx; @@ -65,9 +64,6 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu /** Commit flag. */ private boolean commit; - /** Logger. */ - private IgniteLogger log; - /** Error. */ private AtomicReference<Throwable> err = new AtomicReference<>(null); @@ -78,13 +74,6 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu private boolean trackable = true; /** - * Empty constructor required for {@link Externalizable}. - */ - public GridNearTxFinishFuture() { - // No-op. - } - - /** * @param cctx Context. * @param tx Transaction. * @param commit Commit flag. @@ -102,7 +91,8 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu futId = IgniteUuid.randomUuid(); - log = U.logger(cctx.kernalContext(), logRef, GridNearTxFinishFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridNearTxFinishFuture.class); } /** {@inheritDoc} */ @@ -414,9 +404,6 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu */ private class MiniFuture extends GridFutureAdapter<IgniteInternalTx> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Keys. */ @@ -424,18 +411,9 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu private GridDistributedTxMapping<K, V> m; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param m Mapping. */ MiniFuture(GridDistributedTxMapping<K, V> m) { - super(); - this.m = m; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java index 7cad8cc..8f07892 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java @@ -1228,64 +1228,4 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { @Override public String toString() { return S.toString(GridNearTxLocal.class, this, "mappings", mappings.keySet(), "super", super.toString()); } - - /** - * - */ - private static class PessimisticPrepareFuture<K, V> extends GridFutureAdapter<IgniteInternalTx<K, V>> { - /** */ - private static final long serialVersionUID = 0L; - - /** Transaction. */ - @GridToStringExclude - private IgniteInternalTx<K, V> tx; - - /** - * Empty constructor required by {@link Externalizable}. - */ - public PessimisticPrepareFuture() { - // No-op. - } - - /** - * @param ctx Kernal context. - * @param tx Transaction. - */ - private PessimisticPrepareFuture(GridKernalContext ctx, IgniteInternalTx<K, V> tx) { - super(); - this.tx = tx; - } - - /** - * @param e Exception. - */ - void onError(Throwable e) { - boolean marked = tx.setRollbackOnly(); - - if (e instanceof IgniteTxRollbackCheckedException) { - if (marked) { - try { - tx.rollback(); - } - catch (IgniteCheckedException ex) { - U.error(log, "Failed to automatically rollback transaction: " + tx, ex); - } - } - } - - onDone(tx, e); - } - - /** - * Completes future. - */ - void complete() { - onDone(tx); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return "PessimisticPrepareFuture[xidVer=" + tx.xidVersion() + ", done=" + isDone() + ']'; - } - } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65e6ad60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java index ad61f13..a430e48 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java @@ -41,7 +41,6 @@ import org.jdk8.backport.*; import org.jetbrains.annotations.*; import javax.cache.expiry.*; -import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -53,12 +52,12 @@ import static org.apache.ignite.transactions.TransactionState.*; */ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFuture<IgniteInternalTx<K, V>> implements GridCacheMvccFuture<K, V, IgniteInternalTx<K, V>> { - /** */ - private static final long serialVersionUID = 0L; - /** Logger reference. */ private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>(); + /** Logger. */ + private static IgniteLogger log; + /** Context. */ private GridCacheSharedContext<K, V> cctx; @@ -69,9 +68,6 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut @GridToStringExclude private GridNearTxLocal<K, V> tx; - /** Logger. */ - private IgniteLogger log; - /** Error. */ @GridToStringExclude private AtomicReference<Throwable> err = new AtomicReference<>(null); @@ -86,13 +82,6 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut private Collection<IgniteTxKey<K>> lockKeys = new GridConcurrentHashSet<>(); /** - * Empty constructor required for {@link Externalizable}. - */ - public GridNearTxPrepareFuture() { - // No-op. - } - - /** * @param cctx Context. * @param tx Transaction. */ @@ -116,7 +105,8 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut futId = IgniteUuid.randomUuid(); - log = U.logger(cctx.kernalContext(), logRef, GridNearTxPrepareFuture.class); + if (log == null) + log = U.logger(cctx.kernalContext(), logRef, GridNearTxPrepareFuture.class); } /** {@inheritDoc} */ @@ -833,9 +823,6 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut */ private class MiniFuture extends GridFutureAdapter<IgniteInternalTx<K, V>> { /** */ - private static final long serialVersionUID = 0L; - - /** */ private final IgniteUuid futId = IgniteUuid.randomUuid(); /** Keys. */ @@ -849,20 +836,11 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut private ConcurrentLinkedDeque8<GridDistributedTxMapping<K, V>> mappings; /** - * Empty constructor required for {@link Externalizable}. - */ - public MiniFuture() { - // No-op. - } - - /** * @param m Mapping. * @param mappings Queue of mappings to proceed with. */ MiniFuture(GridDistributedTxMapping<K, V> m, ConcurrentLinkedDeque8<GridDistributedTxMapping<K, V>> mappings) { - super(); - this.m = m; this.mappings = mappings; }