You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/06/01 15:44:31 UTC
[24/25] ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-5075' into ignite-5075-pds
Merge remote-tracking branch 'remotes/origin/ignite-5075' into ignite-5075-pds
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/255319e4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/255319e4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/255319e4
Branch: refs/heads/ignite-5075-pds
Commit: 255319e418d4b32b2c62d624760409fe464d0ac4
Parents: 6d3070f f270533
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jun 1 18:42:29 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jun 1 18:42:29 2017 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 12 +-
.../processors/affinity/GridAffinityUtils.java | 2 +-
.../cache/CacheAffinitySharedManager.java | 58 +-
.../CacheClientReconnectDiscoveryData.java | 8 +-
.../internal/processors/cache/CacheData.java | 4 +-
.../processors/cache/CacheGroupContext.java | 964 ++++++++++++++++++
.../processors/cache/CacheGroupData.java | 7 +-
.../cache/CacheGroupInfrastructure.java | 972 -------------------
.../cache/CacheJoinNodeDiscoveryData.java | 4 +-
.../processors/cache/ClusterCachesInfo.java | 180 +++-
.../processors/cache/ExchangeActions.java | 2 +-
.../processors/cache/GridCacheAdapter.java | 5 -
.../cache/GridCacheConcurrentMapImpl.java | 1 +
.../processors/cache/GridCacheContext.java | 7 +-
.../processors/cache/GridCacheEntryInfo.java | 1 +
.../processors/cache/GridCacheIoManager.java | 68 +-
.../processors/cache/GridCacheMapEntry.java | 2 +
.../GridCachePartitionExchangeManager.java | 62 +-
.../cache/GridCachePreloaderAdapter.java | 4 +-
.../processors/cache/GridCacheProcessor.java | 48 +-
.../cache/IgniteCacheOffheapManager.java | 2 +-
.../cache/IgniteCacheOffheapManagerImpl.java | 44 +-
.../cache/database/CacheDataRowAdapter.java | 7 +-
.../processors/cache/database/RowStore.java | 4 +-
.../dht/GridCachePartitionedConcurrentMap.java | 6 +-
.../distributed/dht/GridDhtCacheAdapter.java | 17 +-
.../distributed/dht/GridDhtLocalPartition.java | 24 +-
.../dht/GridDhtPartitionTopologyImpl.java | 19 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 18 +-
.../dht/atomic/GridDhtAtomicCache.java | 48 +-
.../dht/colocated/GridDhtColocatedCache.java | 13 +-
.../dht/preloader/GridDhtPartitionDemander.java | 13 +-
.../dht/preloader/GridDhtPartitionSupplier.java | 5 +-
.../GridDhtPartitionSupplyMessage.java | 4 +-
.../GridDhtPartitionsExchangeFuture.java | 40 +-
.../dht/preloader/GridDhtPreloader.java | 4 +-
.../distributed/near/GridNearAtomicCache.java | 2 +-
.../distributed/near/GridNearCacheAdapter.java | 6 +-
.../near/GridNearTransactionalCache.java | 4 +-
.../processors/cache/local/GridLocalCache.java | 6 +-
.../query/GridCacheDistributedQueryManager.java | 6 +-
.../continuous/CacheContinuousQueryHandler.java | 46 +-
.../CacheContinuousQueryListener.java | 5 +-
.../continuous/CacheContinuousQueryManager.java | 15 +-
.../query/continuous/CounterSkipContext.java | 14 +-
.../cache/transactions/IgniteTxHandler.java | 22 +-
.../cluster/GridClusterStateProcessor.java | 2 +-
.../processors/query/GridQueryProcessor.java | 2 +-
.../processors/cache/IgniteCacheGroupsTest.java | 349 ++++++-
...nuousQueryConcurrentPartitionUpdateTest.java | 106 +-
...ContinuousQueryFailoverAbstractSelfTest.java | 7 +-
.../testframework/junits/GridAbstractTest.java | 4 +-
.../processors/query/h2/IgniteH2Indexing.java | 28 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 2 +-
.../h2/twostep/GridReduceQueryExecutor.java | 15 +-
.../yardstick/config/ignite-db-base-config.xml | 118 +++
.../config/ignite-db-localhost-config.xml | 53 +
.../yardstick/config/ignite-rdbms-config.xml | 70 ++
.../config/sql/benchmark-jdbc-ignite.properties | 64 ++
.../sql/benchmark-mysql-ignite.properties | 66 ++
.../config/sql/benchmark-native.properties | 62 ++
.../sql/benchmark-pgsql-ignite.properties | 66 ++
modules/yardstick/config/sql/db-h2-queries.sql | 9 +
.../yardstick/config/sql/db-mysql-queries.sql | 14 +
.../yardstick/config/sql/db-pgsql-queries.sql | 14 +
.../yardstick/config/sql/h2-insert-query.sql | 1 +
.../yardstick/config/sql/rdbms-mysql-schema.sql | 5 +
.../yardstick/config/sql/rdbms-pgsql-schema.sql | 10 +
.../yardstick/IgniteBenchmarkArguments.java | 59 +-
.../cache/IgniteCacheAbstractBenchmark.java | 60 +-
.../yardstick/cache/IgniteGetBenchmark.java | 17 +-
.../cache/IgnitePutObjectKeyBenchmark.java | 125 ---
.../cache/IgniteScanQueryBenchmark.java | 88 ++
.../cache/jdbc/IgniteNativeTxBenchmark.java | 169 ++++
.../cache/jdbc/JdbcAbstractBenchmark.java | 51 +-
.../yardstick/cache/jdbc/JdbcPutBenchmark.java | 3 -
.../cache/jdbc/JdbcPutGetBenchmark.java | 4 +-
.../yardstick/cache/jdbc/RdbmsBenchmark.java | 220 +++++
.../ignite/yardstick/cache/model/Accounts.java | 62 ++
.../ignite/yardstick/cache/model/Branches.java | 62 ++
.../ignite/yardstick/cache/model/History.java | 69 ++
.../ignite/yardstick/cache/model/Tellers.java | 62 ++
82 files changed, 3313 insertions(+), 1610 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index 24edf5d,dc4a91f..81acdf9
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@@ -396,27 -391,26 +396,32 @@@ public class CacheAffinitySharedManager
U.quietAndWarn(log, "No server nodes found for cache client: " + req.cacheName());
}
}
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to initialize cache. Will try to rollback cache start routine. " +
+ "[cacheName=" + req.cacheName() + ']', e);
+
+ cctx.cache().forceCloseCache(fut.topologyVersion(), action, e);
+ }
}
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to initialize cache. Will try to rollback cache start routine. " +
+ "[cacheName=" + req.cacheName() + ']', e);
+
+ cctx.cache().forceCloseCache(fut.topologyVersion(), action, e);
+ }
}
- Set<Integer> gprs = new HashSet<>();
+ Set<Integer> gprs = new HashSet<>();
- for (ExchangeActions.ActionData action : exchActions.newAndClientCachesStartRequests()) {
- Integer grpId = action.descriptor().groupId();
+ for (ExchangeActions.ActionData action : exchActions.newAndClientCachesStartRequests()) {
+ Integer grpId = action.descriptor().groupId();
- if (gprs.add(grpId)) {
- if (crd && lateAffAssign)
- initStartedGroupOnCoordinator(fut, action.descriptor().groupDescriptor());
- else {
- CacheGroupInfrastructure grp = cctx.cache().cacheGroup(grpId);
+ if (gprs.add(grpId)) {
+ if (crd && lateAffAssign)
+ initStartedGroupOnCoordinator(fut, action.descriptor().groupDescriptor());else {
+ CacheGroupContext grp = cctx.cache().cacheGroup(grpId);
- if (grp != null && !grp.isLocal() && grp.localStartVersion().equals(fut.topologyVersion())) {
+ if (grp != null && !grp.isLocal() && grp.localStartVersion().equals(fut.topologyVersion())) {
assert grp.affinity().lastVersion().equals(AffinityTopologyVersion.NONE) : grp.affinity().lastVersion();
initAffinity(registeredGrps.get(grp.groupId()), grp.affinity(), fut);
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
index 0000000,4844a55..b85c41d
mode 000000,100644..100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
@@@ -1,0 -1,943 +1,964 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package org.apache.ignite.internal.processors.cache;
+
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collection;
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Set;
+ import java.util.UUID;
+ import org.apache.ignite.IgniteCheckedException;
+ import org.apache.ignite.IgniteLogger;
+ import org.apache.ignite.cache.affinity.AffinityFunction;
+ import org.apache.ignite.cluster.ClusterNode;
+ import org.apache.ignite.configuration.CacheConfiguration;
+ import org.apache.ignite.configuration.DataPageEvictionMode;
+ import org.apache.ignite.configuration.TopologyValidator;
+ import org.apache.ignite.events.CacheRebalancingEvent;
+ import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
+ import org.apache.ignite.internal.IgniteInternalFuture;
+ import org.apache.ignite.internal.processors.affinity.AffinityAssignment;
+ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+ import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache;
+ import org.apache.ignite.internal.processors.cache.database.MemoryPolicy;
+ import org.apache.ignite.internal.processors.cache.database.freelist.FreeList;
+ import org.apache.ignite.internal.processors.cache.database.tree.reuse.ReuseList;
+ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentRequest;
+ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentResponse;
+ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
+ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl;
+ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader;
+ import org.apache.ignite.internal.processors.cache.query.continuous.CounterSkipContext;
+ import org.apache.ignite.internal.processors.query.QueryUtils;
+ import org.apache.ignite.internal.util.typedef.CI1;
+ import org.apache.ignite.internal.util.typedef.internal.CU;
+ import org.apache.ignite.internal.util.typedef.internal.LT;
+ import org.apache.ignite.internal.util.typedef.internal.U;
+ import org.apache.ignite.lang.IgniteBiInClosure;
+ import org.apache.ignite.lang.IgniteFuture;
+ import org.apache.ignite.lang.IgnitePredicate;
+ import org.apache.ignite.lang.IgniteUuid;
+ import org.jetbrains.annotations.Nullable;
+
+ import static org.apache.ignite.cache.CacheMode.LOCAL;
+ import static org.apache.ignite.cache.CacheRebalanceMode.NONE;
+ import static org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_PART_UNLOADED;
+ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
+
+ /**
+ *
+ */
+ public class CacheGroupContext {
+ /**
+ * Unique group ID. Currently for shared group it is generated as group name hash,
+ * for non-shared as cache name hash (see {@link ClusterCachesInfo#checkCacheConflict}).
+ */
+ private final int grpId;
+
+ /** Node ID cache group was received from. */
+ private final UUID rcvdFrom;
+
+ /** Flag indicating that this cache group is in a recovery mode due to partitions loss. */
+ private boolean needsRecovery;
+
+ /** */
+ private final AffinityTopologyVersion locStartVer;
+
+ /** */
+ private final CacheConfiguration<?, ?> ccfg;
+
+ /** */
+ private final GridCacheSharedContext ctx;
+
+ /** */
+ private final boolean affNode;
+
+ /** */
+ private final CacheType cacheType;
+
+ /** */
+ private final byte ioPlc;
+
+ /** */
+ private final boolean depEnabled;
+
+ /** */
+ private final boolean storeCacheId;
+
+ /** */
+ private volatile List<GridCacheContext> caches;
+
+ /** */
+ private volatile List<GridCacheContext> contQryCaches;
+
+ /** */
+ private final IgniteLogger log;
+
+ /** */
+ private GridAffinityAssignmentCache aff;
+
+ /** */
+ private GridDhtPartitionTopologyImpl top;
+
+ /** */
+ private IgniteCacheOffheapManager offheapMgr;
+
+ /** */
+ private GridCachePreloader preldr;
+
+ /** */
+ private final MemoryPolicy memPlc;
+
+ /** */
+ private final CacheObjectContext cacheObjCtx;
+
+ /** */
+ private final FreeList freeList;
+
+ /** */
+ private final ReuseList reuseList;
+
+ /** */
+ private boolean drEnabled;
+
+ /** */
+ private boolean qryEnabled;
+
+ /**
+ * @param grpId Group ID.
+ * @param ctx Context.
+ * @param rcvdFrom Node ID cache group was received from.
+ * @param cacheType Cache type.
+ * @param ccfg Cache configuration.
+ * @param affNode Affinity node flag.
+ * @param memPlc Memory policy.
+ * @param cacheObjCtx Cache object context.
+ * @param freeList Free list.
+ * @param reuseList Reuse list.
+ * @param locStartVer Topology version when group was started on local node.
+ */
+ CacheGroupContext(
+ GridCacheSharedContext ctx,
+ int grpId,
+ UUID rcvdFrom,
+ CacheType cacheType,
+ CacheConfiguration ccfg,
+ boolean affNode,
+ MemoryPolicy memPlc,
+ CacheObjectContext cacheObjCtx,
+ FreeList freeList,
+ ReuseList reuseList,
+ AffinityTopologyVersion locStartVer) {
+ assert ccfg != null;
+ assert memPlc != null || !affNode;
+ assert grpId != 0 : "Invalid group ID [cache=" + ccfg.getName() + ", grpName=" + ccfg.getGroupName() + ']';
+
+ this.grpId = grpId;
+ this.rcvdFrom = rcvdFrom;
+ this.ctx = ctx;
+ this.ccfg = ccfg;
+ this.affNode = affNode;
+ this.memPlc = memPlc;
+ this.cacheObjCtx = cacheObjCtx;
+ this.freeList = freeList;
+ this.reuseList = reuseList;
+ this.locStartVer = locStartVer;
+ this.cacheType = cacheType;
+
+ ioPlc = cacheType.ioPolicy();
+
+ depEnabled = ctx.kernalContext().deploy().enabled() && !ctx.kernalContext().cacheObjects().isBinaryEnabled(ccfg);
+
+ storeCacheId = affNode && memPlc.config().getPageEvictionMode() != DataPageEvictionMode.DISABLED;
+
+ log = ctx.kernalContext().log(getClass());
+
+ caches = new ArrayList<>();
+ }
+
+ /**
+ * @return {@code True} if this is cache group for one of system caches.
+ */
+ public boolean systemCache() {
+ return !sharedGroup() && CU.isSystemCache(ccfg.getName());
+ }
+
+ /**
+ * @return Node ID initiated cache group start.
+ */
+ public UUID receivedFrom() {
+ return rcvdFrom;
+ }
+
+ /**
+ * @return {@code True} if cacheId should be stored in data pages.
+ */
+ public boolean storeCacheIdInDataPage() {
+ return storeCacheId;
+ }
+
+ /**
+ * @return {@code True} if deployment is enabled.
+ */
+ public boolean deploymentEnabled() {
+ return depEnabled;
+ }
+
+ /**
+ * @return Preloader.
+ */
+ public GridCachePreloader preloader() {
+ return preldr;
+ }
+
+ /**
+ * @return IO policy for the given cache group.
+ */
+ public byte ioPolicy() {
+ return ioPlc;
+ }
+
+ /**
+ * @param cctx Cache context.
+ * @throws IgniteCheckedException If failed.
+ */
+ void onCacheStarted(GridCacheContext cctx) throws IgniteCheckedException {
+ addCacheContext(cctx);
+
+ offheapMgr.onCacheStarted(cctx);
+ }
+
+ /**
+ * @param cacheName Cache name.
+ * @return {@code True} if group contains cache with given name.
+ */
+ public boolean hasCache(String cacheName) {
+ List<GridCacheContext> caches = this.caches;
+
+ for (int i = 0; i < caches.size(); i++) {
+ if (caches.get(i).name().equals(cacheName))
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param cctx Cache context.
+ */
+ private void addCacheContext(GridCacheContext cctx) {
+ assert cacheType.userCache() == cctx.userCache() : cctx.name();
+ assert grpId == cctx.groupId() : cctx.name();
+
+ ArrayList<GridCacheContext> caches = new ArrayList<>(this.caches);
+
+ assert sharedGroup() || caches.isEmpty();
+
+ boolean add = caches.add(cctx);
+
+ assert add : cctx.name();
+
+ if (!qryEnabled && QueryUtils.isEnabled(cctx.config()))
+ qryEnabled = true;
+
+ if (!drEnabled && cctx.isDrEnabled())
+ drEnabled = true;
+
+ this.caches = caches;
+ }
+
+ /**
+ * @param cctx Cache context.
+ */
+ private void removeCacheContext(GridCacheContext cctx) {
+ ArrayList<GridCacheContext> caches = new ArrayList<>(this.caches);
+
+ // It is possible cache was not added in case of errors on cache start.
+ for (Iterator<GridCacheContext> it = caches.iterator(); it.hasNext();) {
+ GridCacheContext next = it.next();
+
+ if (next == cctx) {
+ assert sharedGroup() || caches.size() == 1 : caches.size();
+
+ it.remove();
+
+ break;
+ }
+ }
+
+ if (QueryUtils.isEnabled(cctx.config())) {
+ boolean qryEnabled = false;
+
+ for (int i = 0; i < caches.size(); i++) {
+ if (QueryUtils.isEnabled(caches.get(i).config())) {
+ qryEnabled = true;
+
+ break;
+ }
+ }
+
+ this.qryEnabled = qryEnabled;
+ }
+
+ if (cctx.isDrEnabled()) {
+ boolean drEnabled = false;
+
+ for (int i = 0; i < caches.size(); i++) {
+ if (caches.get(i).isDrEnabled()) {
+ drEnabled = true;
+
+ break;
+ }
+ }
+
+ this.drEnabled = drEnabled;
+ }
+
+ this.caches = caches;
+ }
+
+ /**
+ * @return Cache context if group contains single cache.
+ */
+ public GridCacheContext singleCacheContext() {
+ List<GridCacheContext> caches = this.caches;
+
+ assert !sharedGroup() && caches.size() == 1;
+
+ return caches.get(0);
+ }
+
+ /**
+ *
+ */
+ public void unwindUndeploys() {
+ List<GridCacheContext> caches = this.caches;
+
+ for (int i = 0; i < caches.size(); i++) {
+ GridCacheContext cctx = caches.get(i);
+
+ cctx.deploy().unwind(cctx);
+ }
+ }
+
+ /**
+ * @param type Event type to check.
+ * @return {@code True} if given event type should be recorded.
+ */
+ public boolean eventRecordable(int type) {
+ return cacheType.userCache() && ctx.gridEvents().isRecordable(type);
+ }
+
+ /**
+ * Adds rebalancing event.
+ *
+ * @param part Partition.
+ * @param type Event type.
+ * @param discoNode Discovery node.
+ * @param discoType Discovery event type.
+ * @param discoTs Discovery event timestamp.
+ */
+ public void addRebalanceEvent(int part, int type, ClusterNode discoNode, int discoType, long discoTs) {
+ assert discoNode != null;
+ assert type > 0;
+ assert discoType > 0;
+ assert discoTs > 0;
+
+ if (!eventRecordable(type))
+ LT.warn(log, "Added event without checking if event is recordable: " + U.gridEventName(type));
+
+ List<GridCacheContext> caches = this.caches;
+
+ for (int i = 0; i < caches.size(); i++) {
+ GridCacheContext cctx = caches.get(i);
+
+ if (cctx.recordEvent(type)) {
+ cctx.gridEvents().record(new CacheRebalancingEvent(cctx.name(),
+ cctx.localNode(),
+ "Cache rebalancing event.",
+ type,
+ part,
+ discoNode,
+ discoType,
+ discoTs));
+ }
+ }
+ }
+ /**
+ * Adds partition unload event.
+ *
+ * @param part Partition.
+ */
+ public void addUnloadEvent(int part) {
+ if (!eventRecordable(EVT_CACHE_REBALANCE_PART_UNLOADED))
+ LT.warn(log, "Added event without checking if event is recordable: " +
+ U.gridEventName(EVT_CACHE_REBALANCE_PART_UNLOADED));
+
+ List<GridCacheContext> caches = this.caches;
+
+ for (int i = 0; i < caches.size(); i++) {
+ GridCacheContext cctx = caches.get(i);
+
+ cctx.gridEvents().record(new CacheRebalancingEvent(cctx.name(),
+ cctx.localNode(),
+ "Cache unloading event.",
+ EVT_CACHE_REBALANCE_PART_UNLOADED,
+ part,
+ null,
+ 0,
+ 0));
+ }
+ }
+
+ /**
+ * @param part Partition.
+ * @param key Key.
+ * @param evtNodeId Event node ID.
+ * @param type Event type.
+ * @param newVal New value.
+ * @param hasNewVal Has new value flag.
+ * @param oldVal Old values.
+ * @param hasOldVal Has old value flag.
+ * @param keepBinary Keep binary flag.
+ */
+ public void addCacheEvent(
+ int part,
+ KeyCacheObject key,
+ UUID evtNodeId,
+ int type,
+ @Nullable CacheObject newVal,
+ boolean hasNewVal,
+ @Nullable CacheObject oldVal,
+ boolean hasOldVal,
+ boolean keepBinary
+ ) {
+ List<GridCacheContext> caches = this.caches;
+
+ for (int i = 0; i < caches.size(); i++) {
+ GridCacheContext cctx = caches.get(i);
+
+ cctx.events().addEvent(part,
+ key,
+ evtNodeId,
+ (IgniteUuid)null,
+ null,
+ type,
+ newVal,
+ hasNewVal,
+ oldVal,
+ hasOldVal,
+ null,
+ null,
+ null,
+ keepBinary);
+ }
+ }
+
+ /**
+ * @return {@code True} if contains cache with query indexing enabled.
+ */
+ public boolean queriesEnabled() {
+ return qryEnabled;
+ }
+
+ /**
+ * @return {@code True} if fast eviction is allowed.
+ */
+ public boolean allowFastEviction() {
+ return ctx.database().persistenceEnabled() && !queriesEnabled();
+ }
+
+ /**
+ * @return {@code True} in case replication is enabled.
+ */
+ public boolean isDrEnabled() {
+ return drEnabled;
+ }
+
+ /**
+ * @return Free List.
+ */
+ public FreeList freeList() {
+ return freeList;
+ }
+
+ /**
+ * @return Reuse List.
+ */
+ public ReuseList reuseList() {
+ return reuseList;
+ }
+
+ /**
+ * @return Cache object context.
+ */
+ public CacheObjectContext cacheObjectContext() {
+ return cacheObjCtx;
+ }
+
+ /**
+ * @return Cache shared context.
+ */
+ public GridCacheSharedContext shared() {
+ return ctx;
+ }
+
+ /**
+ * @return Memory policy.
+ */
+ public MemoryPolicy memoryPolicy() {
+ return memPlc;
+ }
+
+ /**
+ * @return {@code True} if local node is affinity node.
+ */
+ public boolean affinityNode() {
+ return affNode;
+ }
+
+ /**
+ * @return Topology.
+ */
+ public GridDhtPartitionTopology topology() {
+ if (top == null)
+ throw new IllegalStateException("Topology is not initialized: " + name());
+
+ return top;
+ }
+
+ /**
+ * @return Offheap manager.
+ */
+ public IgniteCacheOffheapManager offheap() {
+ return offheapMgr;
+ }
+
+ /**
+ * @return Current cache state. Must only be modified during exchange.
+ */
+ public boolean needsRecovery() {
+ return needsRecovery;
+ }
+
+ /**
+ * @param needsRecovery Needs recovery flag.
+ */
+ public void needsRecovery(boolean needsRecovery) {
+ this.needsRecovery = needsRecovery;
+ }
+
+ /**
+ * @return Topology version when group was started on local node.
+ */
+ public AffinityTopologyVersion localStartVersion() {
+ return locStartVer;
+ }
+
+ /**
+ * @return {@code True} if cache is local.
+ */
+ public boolean isLocal() {
+ return ccfg.getCacheMode() == LOCAL;
+ }
+
+ /**
+ * @return Cache configuration.
+ */
+ public CacheConfiguration config() {
+ return ccfg;
+ }
+
+ /**
+ * @return Cache node filter.
+ */
+ public IgnitePredicate<ClusterNode> nodeFilter() {
+ return ccfg.getNodeFilter();
+ }
+
+ /**
+ * @return Configured user objects which should be initialized/stopped on group start/stop.
+ */
+ Collection<?> configuredUserObjects() {
+ return Arrays.asList(ccfg.getAffinity(), ccfg.getNodeFilter(), ccfg.getTopologyValidator());
+ }
+
+ /**
+ * @return Configured topology validator.
+ */
+ @Nullable public TopologyValidator topologyValidator() {
+ return ccfg.getTopologyValidator();
+ }
+
+ /**
+ * @return Configured affinity function.
+ */
+ public AffinityFunction affinityFunction() {
+ return ccfg.getAffinity();
+ }
+
+ /**
+ * @return Affinity.
+ */
+ public GridAffinityAssignmentCache affinity() {
+ return aff;
+ }
+
+ /**
+ * @return Group name or {@code null} if group name was not specified for cache.
+ */
+ @Nullable public String name() {
+ return ccfg.getGroupName();
+ }
+
+ /**
+ * @return Group name if it is specified, otherwise cache name.
+ */
+ public String cacheOrGroupName() {
+ return ccfg.getGroupName() != null ? ccfg.getGroupName() : ccfg.getName();
+ }
+
+ /**
+ * @return Group ID.
+ */
+ public int groupId() {
+ return grpId;
+ }
+
+ /**
+ * @return {@code True} if group can contain multiple caches.
+ */
+ public boolean sharedGroup() {
+ return ccfg.getGroupName() != null;
+ }
+
+ /**
+ *
+ */
+ public void onKernalStop() {
+ aff.cancelFutures(new IgniteCheckedException("Failed to wait for topology update, node is stopping."));
+
+ preldr.onKernalStop();
+
+ offheapMgr.onKernalStop();
+ }
+
+ /**
+ * @param cctx Cache context.
+ * @param destroy Destroy flag.
+ */
+ void stopCache(GridCacheContext cctx, boolean destroy) {
+ if (top != null)
+ top.onCacheStopped(cctx.cacheId());
+
+ offheapMgr.stopCache(cctx.cacheId(), destroy);
+
+ removeCacheContext(cctx);
+ }
+
+ /**
+ *
+ */
+ void stopGroup() {
+ IgniteCheckedException err =
+ new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping.");
+
+ aff.cancelFutures(err);
+
+ offheapMgr.stop();
+
+ ctx.io().removeCacheGroupHandlers(grpId);
+ }
+
+ /**
+ * @return IDs of caches in this group.
+ */
+ public Set<Integer> cacheIds() {
+ List<GridCacheContext> caches = this.caches;
+
+ Set<Integer> ids = U.newHashSet(caches.size());
+
+ for (int i = 0; i < caches.size(); i++)
+ ids.add(caches.get(i).cacheId());
+
+ return ids;
+ }
+
+ /**
++ * @return Caches in this group.
++ */
++ public List<GridCacheContext> caches() {
++ return this.caches;
++ }
++
++ /**
+ * @return {@code True} if group contains caches.
+ */
+ boolean hasCaches() {
+ List<GridCacheContext> caches = this.caches;
+
+ return !caches.isEmpty();
+ }
+
+ /**
+ * @param part Partition ID.
+ */
+ public void onPartitionEvicted(int part) {
+ List<GridCacheContext> caches = this.caches;
+
+ for (int i = 0; i < caches.size(); i++) {
+ GridCacheContext cctx = caches.get(i);
+
+ if (cctx.isDrEnabled())
+ cctx.dr().partitionEvicted(part);
+
+ cctx.continuousQueries().onPartitionEvicted(part);
+
+ cctx.dataStructures().onPartitionEvicted(part);
+ }
+ }
+
+ /**
+ * @param cctx Cache context.
+ */
+ public void addCacheWithContinuousQuery(GridCacheContext cctx) {
+ assert sharedGroup() : cacheOrGroupName();
+ assert cctx.group() == this : cctx.name();
+ assert !cctx.isLocal() : cctx.name();
+
+ synchronized (this) {
+ List<GridCacheContext> contQryCaches = this.contQryCaches;
+
+ if (contQryCaches == null)
+ contQryCaches = new ArrayList<>();
+
+ contQryCaches.add(cctx);
+
+ this.contQryCaches = contQryCaches;
+ }
+ }
+
+ /**
+ * @param cctx Cache context.
+ */
+ public void removeCacheWithContinuousQuery(GridCacheContext cctx) {
+ assert sharedGroup() : cacheOrGroupName();
+ assert cctx.group() == this : cctx.name();
+ assert !cctx.isLocal() : cctx.name();
+
+ synchronized (this) {
+ List<GridCacheContext> contQryCaches = this.contQryCaches;
+
+ if (contQryCaches == null)
+ return;
+
+ contQryCaches.remove(cctx);
+
+ if (contQryCaches.isEmpty())
+ contQryCaches = null;
+
+ this.contQryCaches = contQryCaches;
+ }
+ }
+
+ /**
+ * @param cacheId ID of cache initiated counter update.
+ * @param part Partition number.
+ * @param cntr Counter.
+ * @param topVer Topology version for current operation.
+ */
+ public void onPartitionCounterUpdate(int cacheId,
+ int part,
+ long cntr,
+ AffinityTopologyVersion topVer,
+ boolean primary) {
+ assert sharedGroup();
+
+ if (isLocal())
+ return;
+
+ List<GridCacheContext> contQryCaches = this.contQryCaches;
+
+ if (contQryCaches == null)
+ return;
+
+ CounterSkipContext skipCtx = null;
+
+ for (int i = 0; i < contQryCaches.size(); i++) {
+ GridCacheContext cctx = contQryCaches.get(i);
+
+ if (cacheId != cctx.cacheId())
+ skipCtx = cctx.continuousQueries().skipUpdateCounter(skipCtx, part, cntr, topVer, primary);
+ }
+
+ final List<Runnable> procC = skipCtx != null ? skipCtx.processClosures() : null;
+
+ if (procC != null) {
+ ctx.kernalContext().closure().runLocalSafe(new Runnable() {
+ @Override public void run() {
+ for (Runnable c : procC)
+ c.run();
+ }
+ });
+ }
+ }
+
+ /**
+ * @throws IgniteCheckedException If failed.
+ */
+ public void start() throws IgniteCheckedException {
+ aff = new GridAffinityAssignmentCache(ctx.kernalContext(),
+ cacheOrGroupName(),
+ grpId,
+ ccfg.getAffinity(),
+ ccfg.getNodeFilter(),
+ ccfg.getBackups(),
+ ccfg.getCacheMode() == LOCAL);
+
+ if (ccfg.getCacheMode() != LOCAL) {
+ top = new GridDhtPartitionTopologyImpl(ctx, this);
+
+ if (!ctx.kernalContext().clientNode()) {
+ ctx.io().addCacheGroupHandler(groupId(), GridDhtAffinityAssignmentRequest.class,
+ new IgniteBiInClosure<UUID, GridDhtAffinityAssignmentRequest>() {
+ @Override public void apply(UUID nodeId, GridDhtAffinityAssignmentRequest msg) {
+ processAffinityAssignmentRequest(nodeId, msg);
+ }
+ });
+ }
+
+ preldr = new GridDhtPreloader(this);
+
+ preldr.start();
+ }
+ else
+ preldr = new GridCachePreloaderAdapter(this);
+
- offheapMgr = new IgniteCacheOffheapManagerImpl();
++ if (ctx.kernalContext().config().getPersistentStoreConfiguration() != null) {
++ ClassLoader clsLdr = U.gridClassLoader();
++
++ try {
++ offheapMgr = (IgniteCacheOffheapManager) clsLdr
++ .loadClass("org.apache.ignite.internal.processors.cache.database.GridCacheOffheapManager")
++ .getConstructor()
++ .newInstance();
++ }
++ catch (Exception e) {
++ throw new IgniteCheckedException("Failed to initialize offheap manager", e);
++ }
++ }
++ else
++ offheapMgr = new IgniteCacheOffheapManagerImpl();
+
+ offheapMgr.start(ctx, this);
+
+ ctx.affinity().onCacheGroupCreated(this);
+ }
+
+ /**
+ * @param nodeId Node ID.
+ * @param req Request.
+ */
+ private void processAffinityAssignmentRequest(final UUID nodeId,
+ final GridDhtAffinityAssignmentRequest req) {
+ if (log.isDebugEnabled())
+ log.debug("Processing affinity assignment request [node=" + nodeId + ", req=" + req + ']');
+
+ IgniteInternalFuture<AffinityTopologyVersion> fut = aff.readyFuture(req.topologyVersion());
+
+ if (fut != null) {
+ fut.listen(new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
+ @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> fut) {
+ processAffinityAssignmentRequest0(nodeId, req);
+ }
+ });
+ }
+ else
+ processAffinityAssignmentRequest0(nodeId, req);
+ }
+
+ /**
+ * @param nodeId Node ID.
+ * @param req Request.
+ */
+ private void processAffinityAssignmentRequest0(UUID nodeId, final GridDhtAffinityAssignmentRequest req) {
+ AffinityTopologyVersion topVer = req.topologyVersion();
+
+ if (log.isDebugEnabled())
+ log.debug("Affinity is ready for topology version, will send response [topVer=" + topVer +
+ ", node=" + nodeId + ']');
+
+ AffinityAssignment assignment = aff.cachedAffinity(topVer);
+
+ GridDhtAffinityAssignmentResponse res = new GridDhtAffinityAssignmentResponse(
+ req.futureId(),
+ grpId,
+ topVer,
+ assignment.assignment());
+
+ if (aff.centralizedAffinityFunction()) {
+ assert assignment.idealAssignment() != null;
+
+ res.idealAffinityAssignment(assignment.idealAssignment());
+ }
+
+ try {
+ ctx.io().send(nodeId, res, AFFINITY_POOL);
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to send affinity assignment response to remote node [node=" + nodeId + ']', e);
+ }
+ }
+
+ /**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture reconnectFut) {
+ IgniteCheckedException err = new IgniteClientDisconnectedCheckedException(reconnectFut,
+ "Failed to wait for topology update, client disconnected.");
+
+ if (aff != null)
+ aff.cancelFutures(err);
+ }
+
+ /**
+ * @return {@code True} if rebalance is enabled.
+ */
+ public boolean rebalanceEnabled() {
+ return ccfg.getRebalanceMode() != NONE;
+ }
+
+ /**
+ *
+ */
+ public void onReconnected() {
+ aff.onReconnected();
+
+ if (top != null)
+ top.onReconnected();
+
+ preldr.onReconnected();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return "CacheGroupContext [grp=" + cacheOrGroupName() + ']';
+ }
+ }
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index d1b1375,ad83b14..7a6d043
--- 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
@@@ -1886,15 -1894,12 +1887,15 @@@ public class GridCacheProcessor extend
ccfg.setNearConfiguration(reqNearCfg);
}
+ if (sharedCtx.pageStore() != null && affNode)
+ sharedCtx.pageStore().initializeForCache(grpDesc, startCfg);
+
String grpName = startCfg.getGroupName();
- CacheGroupInfrastructure grp = null;
+ CacheGroupContext grp = null;
if (grpName != null) {
- for (CacheGroupInfrastructure grp0 : cacheGrps.values()) {
+ for (CacheGroupContext grp0 : cacheGrps.values()) {
if (grp0.sharedGroup() && grpName.equals(grp0.name())) {
grp = grp0;
@@@ -2175,21 -2134,9 +2176,20 @@@
}
}
+ // TODO IGNITE-5075 group descriptors.
+ if (stopCtx != null) {
+ if (stopped == null)
+ stopped = new ArrayList<>();
+
+ stopped.add(F.t(stopCtx.group(), destroy));
+ }
+
if (forceClose)
completeCacheStartFuture(req.request(), false, err);
-
}
+
+ if (stopped != null && !sharedCtx.kernalContext().clientNode())
+ sharedCtx.database().onCacheGroupsStopped(stopped);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/RowStore.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 311374e,a1b45df..cda24e5
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@@ -41,8 -40,7 +40,8 @@@ import org.apache.ignite.internal.clust
import org.apache.ignite.internal.processors.affinity.AffinityAssignment;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
- import org.apache.ignite.internal.processors.cache.CacheGroupInfrastructure;
+ import org.apache.ignite.internal.processors.cache.CacheGroupContext;
+import org.apache.ignite.internal.processors.cache.CacheMetricsImpl;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
index 6196746,afdeb8c..98ae667
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
@@@ -27,7 -27,7 +27,8 @@@ import org.apache.ignite.IgniteLogger
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.CacheGroupInfrastructure;
+ import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
import org.apache.ignite.internal.processors.cache.IgniteRebalanceIterator;
import org.apache.ignite.internal.processors.cache.database.CacheDataRow;
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index ee5b190,f8d4344..ef14a90
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@@ -28,9 -28,10 +28,9 @@@ import java.util.Map
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.GridDirectCollection;
import org.apache.ignite.internal.GridDirectMap;
-import org.apache.ignite.internal.GridDirectTransient;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection;
- import org.apache.ignite.internal.processors.cache.CacheGroupInfrastructure;
+ import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
import org.apache.ignite.internal.processors.cache.GridCacheDeployable;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 7a6fb05,0c5cdd9..6238354
--- 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
@@@ -57,8 -55,7 +57,8 @@@ import org.apache.ignite.internal.pagem
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache;
import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
+import org.apache.ignite.internal.processors.cache.CacheGroupDescriptor;
- import org.apache.ignite.internal.processors.cache.CacheGroupInfrastructure;
+ import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.CacheInvalidStateException;
import org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask;
import org.apache.ignite.internal.processors.cache.ClusterState;
@@@ -1866,10 -1611,8 +1866,10 @@@ public class GridDhtPartitionsExchangeF
try {
assert crd.isLocal();
+ assert partHistSuppliers.isEmpty();
+
if (!crd.equals(discoCache.serverNodes().get(0))) {
- for (CacheGroupInfrastructure grp : cctx.cache().cacheGroups()) {
+ for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (!grp.isLocal())
grp.topology().beforeExchange(this, !centralizedAff);
}
@@@ -2101,11 -1840,10 +2101,11 @@@
Map<Integer, T2<Long, Long>> cntrMap = msg.partitionUpdateCounters(grpId);
- CacheGroupInfrastructure grp = cctx.cache().cacheGroup(grpId);
+ CacheGroupContext grp = cctx.cache().cacheGroup(grpId);
if (grp != null)
- grp.topology().update(exchId, entry.getValue(), cntrMap);
+ grp.topology().update(this, entry.getValue(), cntrMap,
+ msg.partsToReload(cctx.localNodeId(), grpId));
else {
ClusterNode oldest = cctx.discovery().oldestAliveCacheServerNode(AffinityTopologyVersion.NONE);
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index c700ab0,a931ef4..82eafc1
--- 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
@@@ -30,10 -29,9 +30,10 @@@ import org.apache.ignite.IgniteCheckedE
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.NodeStoppingException;
import org.apache.ignite.internal.processors.affinity.AffinityAssignment;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
- import org.apache.ignite.internal.processors.cache.CacheGroupInfrastructure;
+ import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
import org.apache.ignite.internal.processors.cache.GridCachePreloaderAdapter;
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 723c13a,522be55..04df14c
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -1540,8 -1546,8 +1540,8 @@@ private IgniteInternalFuture<Object> re
fut.onDone(e);
}
catch (Throwable e) {
- U.error(log, "Failed to rebuild indexes for type [cacheName=" + cacheName +
+ U.error(log, "Failed to rebuild indexes for type [cache=" + cacheName +
- ", type=" + typeName + ']', e);
+ ", name=" + desc.name() + ']', e);
fut.onDone(e);
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/255319e4/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
----------------------------------------------------------------------
diff --cc modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
index 882d220,3ba39c1..602b227
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
@@@ -192,20 -202,9 +203,20 @@@ public class IgniteBenchmarkArguments
private String cacheGrp;
/** */
- @Parameter(names = {"-cig", "--cachesInGrp"}, description = "Number of caches to create in configured group")
- private int cachesInGrp = 1;
+ @Parameter(names = {"-cc", "--cachesCnt"}, description = "Number of caches to create")
+ private int cachesCnt = 1;
+ /** */
+ @Parameter(names = {"-pds", "--persistentStore"}, description = "Persistent store flag")
+ private boolean persistentStoreEnabled;
+
+ /**
+ * @return {@code True} if need set {@link PersistentStoreConfiguration}.
+ */
+ public boolean persistentStoreEnabled() {
+ return persistentStoreEnabled;
+ }
+
/**
* @return List of enabled load test operations.
*/