Cosmetic changes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/114c42e1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/114c42e1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/114c42e1 Branch: refs/heads/ignite-2.1.2-exchange Commit: 114c42e14013fe5b7bd6f186f7db59a533d61f68 Parents: 2e7adbf Author: Alexey Goncharuk <[email protected]> Authored: Tue Jul 4 19:35:06 2017 +0300 Committer: Alexey Goncharuk <[email protected]> Committed: Tue Jul 4 19:35:06 2017 +0300 ---------------------------------------------------------------------- .../processors/cache/ClusterCachesInfo.java | 3 ++- .../processors/cache/GridCacheProcessor.java | 16 +++++++++++----- .../cache/persistence/tree/io/TrackingPageIO.java | 12 ++++++------ 3 files changed, 19 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/114c42e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 4e9dcf1..8f124b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -43,6 +43,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.query.QuerySchema; import org.apache.ignite.internal.processors.query.QueryUtils; import org.apache.ignite.internal.processors.query.schema.SchemaOperationException; +import org.apache.ignite.internal.util.GridConcurrentHashSet; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.T2; import org.apache.ignite.internal.util.typedef.internal.CU; @@ -74,7 +75,7 @@ class ClusterCachesInfo { private final ConcurrentMap<String, DynamicCacheDescriptor> registeredTemplates = new ConcurrentHashMap<>(); /** Caches currently being restarted. */ - private final Collection<String> restartingCaches = new HashSet<>(); + private final Collection<String> restartingCaches = new GridConcurrentHashSet<>(); /** */ private final IgniteLogger log; http://git-wip-us.apache.org/repos/asf/ignite/blob/114c42e1/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 402d874..0f859eb 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 @@ -831,8 +831,6 @@ public class GridCacheProcessor extends GridProcessorAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public void onKernalStart() throws IgniteCheckedException { - ClusterNode locNode = ctx.discovery().localNode(); - boolean active = ctx.state().active(); try { @@ -881,7 +879,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { final List<IgniteInternalFuture> syncFuts = new ArrayList<>(caches.size()); sharedCtx.forAllCaches(new CIX1<GridCacheContext>() { - @Override public void applyx(GridCacheContext cctx) throws IgniteCheckedException { + @Override public void applyx(GridCacheContext cctx) { CacheConfiguration cfg = cctx.config(); if (cctx.affinityNode() && @@ -3015,13 +3013,20 @@ public class GridCacheProcessor extends GridProcessorAdapter { } /** + * Reset restarting caches. + */ + public void resetRestartingCaches(){ + cachesInfo.restartingCaches().clear(); + } + + /** * @param node Joining node to validate. * @return Node validation result if there was an issue with the joining node, {@code null} otherwise. */ private IgniteNodeValidationResult validateRestartingCaches(ClusterNode node) { if (cachesInfo.hasRestartingCaches()) { String msg = "Joining node during caches restart is not allowed [joiningNodeId=" + node.id() + - ", restartingCaches=" + new HashSet<String>(cachesInfo.restartingCaches()) + ']'; + ", restartingCaches=" + new HashSet<>(cachesInfo.restartingCaches()) + ']'; return new IgniteNodeValidationResult(node.id(), msg, msg); } @@ -3984,7 +3989,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { */ RemovedItemsCleanupTask(long timeout) { this.timeout = timeout; - this.endTime = U.currentTimeMillis() + timeout; + + endTime = U.currentTimeMillis() + timeout; } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/114c42e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/TrackingPageIO.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/TrackingPageIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/TrackingPageIO.java index bbf452d..2263130 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/TrackingPageIO.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/TrackingPageIO.java @@ -110,12 +110,12 @@ public class TrackingPageIO extends PageIO { /** * @param buf Buffer. * @param nextSnapshotTag Next snapshot id. - * @param lastSuccessfulSnapshotId Last successful snapshot id. + * @param lastSuccessfulSnapshotTag Last successful snapshot id. * @param pageSize Page size. */ - private void validateSnapshotId(ByteBuffer buf, long nextSnapshotTag, long lastSuccessfulSnapshotId, int pageSize) { - assert nextSnapshotTag != lastSuccessfulSnapshotId : "nextSnapshotTag = " + nextSnapshotTag + - ", lastSuccessfulSnapshotId = " + lastSuccessfulSnapshotId; + private void validateSnapshotId(ByteBuffer buf, long nextSnapshotTag, long lastSuccessfulSnapshotTag, int pageSize) { + assert nextSnapshotTag != lastSuccessfulSnapshotTag : "nextSnapshotTag = " + nextSnapshotTag + + ", lastSuccessfulSnapshotId = " + lastSuccessfulSnapshotTag; long last = getLastSnapshotTag(buf); @@ -126,7 +126,7 @@ public class TrackingPageIO extends PageIO { int cntOfPage = countOfPageToTrack(pageSize); - if (last <= lastSuccessfulSnapshotId) { //we can drop our data + if (last <= lastSuccessfulSnapshotTag) { //we can drop our data buf.putLong(LAST_SNAPSHOT_TAG_OFFSET, nextSnapshotTag); PageHandler.zeroMemory(buf, SIZE_FIELD_OFFSET, buf.capacity() - SIZE_FIELD_OFFSET); @@ -136,7 +136,7 @@ public class TrackingPageIO extends PageIO { int sizeOff = useLeftHalf(nextSnapshotTag) ? SIZE_FIELD_OFFSET : BITMAP_OFFSET + len; int sizeOff2 = !useLeftHalf(nextSnapshotTag) ? SIZE_FIELD_OFFSET : BITMAP_OFFSET + len; - if (last - lastSuccessfulSnapshotId == 1) { //we should keep only data in last half + if (last - lastSuccessfulSnapshotTag == 1) { //we should keep only data in last half //new data will be written in the same half, we should move old data to another half if ((nextSnapshotTag - last) % 2 == 0) PageHandler.copyMemory(buf, sizeOff, buf, sizeOff2, len + SIZE_FIELD_SIZE);
