You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/05/12 10:08:12 UTC
[01/50] [abbrv] incubator-ignite git commit: # ignite-157-2 renamings
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-gg-9614 29da67ce0 -> f6012f1e8
# ignite-157-2 renamings
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f5f95fb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f5f95fb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f5f95fb8
Branch: refs/heads/ignite-gg-9614
Commit: f5f95fb8c952996f4479852b1ca2e086d3d57621
Parents: b141abf
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 6 09:56:30 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 6 09:56:30 2015 +0300
----------------------------------------------------------------------
.../ignite/codegen/MessageCodeGenerator.java | 4 +-
.../communication/GridIoMessageFactory.java | 4 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 508 -------------------
...idCacheOptimisticCheckPreparedTxRequest.java | 261 ----------
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -------
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++++++++++++++++++
.../distributed/GridCacheTxRecoveryRequest.java | 261 ++++++++++
.../GridCacheTxRecoveryResponse.java | 182 +++++++
.../cache/transactions/IgniteTxHandler.java | 30 +-
.../cache/transactions/IgniteTxManager.java | 98 +---
.../resources/META-INF/classnames.properties | 6 +-
11 files changed, 976 insertions(+), 1063 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
index e37b4f3..0540148 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
@@ -165,8 +165,8 @@ public class MessageCodeGenerator {
// gen.generateAndWrite(GridDhtTxFinishRequest.class);
// gen.generateAndWrite(GridDhtTxFinishResponse.class);
//
-// gen.generateAndWrite(GridCacheOptimisticCheckPreparedTxRequest.class);
-// gen.generateAndWrite(GridCacheOptimisticCheckPreparedTxResponse.class);
+// gen.generateAndWrite(GridCacheTxRecoveryRequest.class);
+// gen.generateAndWrite(GridCacheTxRecoveryResponse.class);
// gen.generateAndWrite(GridQueryCancelRequest.class);
// gen.generateAndWrite(GridQueryFailResponse.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
index a395747..7fe8da8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
@@ -166,12 +166,12 @@ public class GridIoMessageFactory implements MessageFactory {
break;
case 16:
- msg = new GridCacheOptimisticCheckPreparedTxRequest();
+ msg = new GridCacheTxRecoveryRequest();
break;
case 17:
- msg = new GridCacheOptimisticCheckPreparedTxResponse();
+ msg = new GridCacheTxRecoveryResponse();
break;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/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
deleted file mode 100644
index bd3e1cc..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * 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.distributed;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.cluster.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.transactions.*;
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.future.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Future verifying that all remote transactions related to some
- * optimistic transaction were prepared.
- */
-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;
-
- /** Context. */
- private final GridCacheSharedContext<K, V> cctx;
-
- /** Future ID. */
- private final IgniteUuid futId = IgniteUuid.randomUuid();
-
- /** Transaction. */
- private final IgniteInternalTx tx;
-
- /** All involved nodes. */
- private final Map<UUID, ClusterNode> nodes;
-
- /** ID of failed node started transaction. */
- private final UUID failedNodeId;
-
- /** Transaction nodes mapping. */
- private final Map<UUID, Collection<UUID>> txNodes;
-
- /** */
- private final boolean nearTxCheck;
-
- /**
- * @param cctx Context.
- * @param tx Transaction.
- * @param failedNodeId ID of failed node started transaction.
- * @param txNodes Transaction mapping.
- */
- @SuppressWarnings("ConstantConditions")
- public GridCacheOptimisticCheckPreparedTxFuture(GridCacheSharedContext<K, V> cctx,
- IgniteInternalTx tx,
- UUID failedNodeId,
- Map<UUID, Collection<UUID>> txNodes)
- {
- super(cctx.kernalContext(), CU.boolReducer());
-
- this.cctx = cctx;
- this.tx = tx;
- this.txNodes = txNodes;
- this.failedNodeId = failedNodeId;
-
- if (log == null)
- log = U.logger(cctx.kernalContext(), logRef, GridCacheOptimisticCheckPreparedTxFuture.class);
-
- nodes = new GridLeanMap<>();
-
- UUID locNodeId = cctx.localNodeId();
-
- for (Map.Entry<UUID, Collection<UUID>> e : tx.transactionNodes().entrySet()) {
- if (!locNodeId.equals(e.getKey()) && !failedNodeId.equals(e.getKey()) && !nodes.containsKey(e.getKey())) {
- ClusterNode node = cctx.discovery().node(e.getKey());
-
- if (node != null)
- nodes.put(node.id(), node);
- else if (log.isDebugEnabled())
- log.debug("Transaction node left (will ignore) " + e.getKey());
- }
-
- for (UUID nodeId : e.getValue()) {
- if (!locNodeId.equals(nodeId) && !failedNodeId.equals(nodeId) && !nodes.containsKey(nodeId)) {
- ClusterNode node = cctx.discovery().node(nodeId);
-
- if (node != null)
- nodes.put(node.id(), node);
- else if (log.isDebugEnabled())
- log.debug("Transaction node left (will ignore) " + e.getKey());
- }
- }
- }
-
- UUID nearNodeId = tx.eventNodeId();
-
- nearTxCheck = !failedNodeId.equals(nearNodeId) && cctx.discovery().alive(nearNodeId);
- }
-
- /**
- * Initializes future.
- */
- @SuppressWarnings("ConstantConditions")
- public void prepare() {
- if (nearTxCheck) {
- UUID nearNodeId = tx.eventNodeId();
-
- if (cctx.localNodeId().equals(nearNodeId)) {
- IgniteInternalFuture<Boolean> fut = cctx.tm().txCommitted(tx.nearXidVersion());
-
- fut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
- @Override public void apply(IgniteInternalFuture<Boolean> fut) {
- try {
- onDone(fut.get());
- }
- catch (IgniteCheckedException e) {
- onDone(e);
- }
- }
- });
- }
- else {
- MiniFuture fut = new MiniFuture(tx.eventNodeId());
-
- add(fut);
-
- GridCacheOptimisticCheckPreparedTxRequest req = new GridCacheOptimisticCheckPreparedTxRequest(
- tx,
- 0,
- true,
- futureId(),
- fut.futureId());
-
- try {
- cctx.io().send(nearNodeId, req, tx.ioPolicy());
- }
- catch (ClusterTopologyCheckedException e) {
- fut.onNodeLeft();
- }
- catch (IgniteCheckedException e) {
- fut.onError(e);
- }
-
- markInitialized();
- }
-
- return;
- }
-
- // First check transactions on local node.
- int locTxNum = nodeTransactions(cctx.localNodeId());
-
- if (locTxNum > 1) {
- IgniteInternalFuture<Boolean> fut = cctx.tm().txsPreparedOrCommitted(tx.nearXidVersion(), locTxNum);
-
- if (fut == null || fut.isDone()) {
- boolean prepared;
-
- try {
- prepared = fut == null ? true : fut.get();
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Check prepared transaction future failed: " + e, e);
-
- prepared = false;
- }
-
- if (!prepared) {
- onDone(false);
-
- markInitialized();
-
- return;
- }
- }
- else {
- fut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
- @Override public void apply(IgniteInternalFuture<Boolean> fut) {
- boolean prepared;
-
- try {
- prepared = fut.get();
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Check prepared transaction future failed: " + e, e);
-
- prepared = false;
- }
-
- if (!prepared) {
- onDone(false);
-
- markInitialized();
- }
- else
- proceedPrepare();
- }
- });
-
- return;
- }
- }
-
- proceedPrepare();
- }
-
- /**
- * Process prepare after local check.
- */
- private void proceedPrepare() {
- for (Map.Entry<UUID, Collection<UUID>> entry : txNodes.entrySet()) {
- UUID nodeId = entry.getKey();
-
- // Skip left nodes and local node.
- if (!nodes.containsKey(nodeId) && nodeId.equals(cctx.localNodeId()))
- continue;
-
- /*
- * If primary node failed then send message to all backups, otherwise
- * send message only to primary node.
- */
-
- if (nodeId.equals(failedNodeId)) {
- for (UUID id : entry.getValue()) {
- // Skip backup node if it is local node or if it is also was mapped as primary.
- if (txNodes.containsKey(id) || id.equals(cctx.localNodeId()))
- continue;
-
- MiniFuture fut = new MiniFuture(id);
-
- add(fut);
-
- GridCacheOptimisticCheckPreparedTxRequest req = new GridCacheOptimisticCheckPreparedTxRequest(tx,
- nodeTransactions(id),
- false,
- futureId(),
- fut.futureId());
-
- try {
- cctx.io().send(id, req, tx.ioPolicy());
- }
- catch (ClusterTopologyCheckedException ignored) {
- fut.onNodeLeft();
- }
- catch (IgniteCheckedException e) {
- fut.onError(e);
-
- break;
- }
- }
- }
- else {
- MiniFuture fut = new MiniFuture(nodeId);
-
- add(fut);
-
- GridCacheOptimisticCheckPreparedTxRequest req = new GridCacheOptimisticCheckPreparedTxRequest(
- tx,
- nodeTransactions(nodeId),
- false,
- futureId(),
- fut.futureId());
-
- try {
- cctx.io().send(nodeId, req, tx.ioPolicy());
- }
- catch (ClusterTopologyCheckedException ignored) {
- fut.onNodeLeft();
- }
- catch (IgniteCheckedException e) {
- fut.onError(e);
-
- break;
- }
- }
- }
-
- markInitialized();
- }
-
- /**
- * @param nodeId Node ID.
- * @return Number of transactions on node.
- */
- private int nodeTransactions(UUID nodeId) {
- int cnt = txNodes.containsKey(nodeId) ? 1 : 0; // +1 if node is primary.
-
- for (Collection<UUID> backups : txNodes.values()) {
- for (UUID backup : backups) {
- if (backup.equals(nodeId)) {
- cnt++; // +1 if node is backup.
-
- break;
- }
- }
- }
-
- return cnt;
- }
-
- /**
- * @param nodeId Node ID.
- * @param res Response.
- */
- public void onResult(UUID nodeId, GridCacheOptimisticCheckPreparedTxResponse res) {
- if (!isDone()) {
- for (IgniteInternalFuture<Boolean> fut : pending()) {
- if (isMini(fut)) {
- MiniFuture f = (MiniFuture)fut;
-
- if (f.futureId().equals(res.miniId())) {
- assert f.nodeId().equals(nodeId);
-
- f.onResult(res);
-
- break;
- }
- }
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override public IgniteUuid futureId() {
- return futId;
- }
-
- /** {@inheritDoc} */
- @Override public GridCacheVersion version() {
- return tx.xidVersion();
- }
-
- /** {@inheritDoc} */
- @Override public Collection<? extends ClusterNode> nodes() {
- return nodes.values();
- }
-
- /** {@inheritDoc} */
- @Override public boolean onNodeLeft(UUID nodeId) {
- for (IgniteInternalFuture<?> fut : futures())
- if (isMini(fut)) {
- MiniFuture f = (MiniFuture)fut;
-
- if (f.nodeId().equals(nodeId)) {
- f.onNodeLeft();
-
- return true;
- }
- }
-
- return false;
- }
-
- /** {@inheritDoc} */
- @Override public boolean trackable() {
- return trackable;
- }
-
- /** {@inheritDoc} */
- @Override public void markNotTrackable() {
- trackable = false;
- }
-
- /** {@inheritDoc} */
- @Override public boolean onDone(@Nullable Boolean res, @Nullable Throwable err) {
- if (super.onDone(res, err)) {
- cctx.mvcc().removeFuture(this);
-
- if (err == null) {
- assert res != null;
-
- cctx.tm().finishOptimisticTxOnRecovery(tx, res);
- }
- else {
- if (err instanceof ClusterTopologyCheckedException && nearTxCheck) {
- if (log.isDebugEnabled())
- log.debug("Failed to check transaction on near node, " +
- "ignoring [err=" + err + ", tx=" + tx + ']');
- }
- else {
- if (log.isDebugEnabled())
- log.debug("Failed to check prepared transactions, " +
- "invalidating transaction [err=" + err + ", tx=" + tx + ']');
-
- cctx.tm().salvageTx(tx);
- }
- }
- }
-
- return false;
- }
-
- /**
- * @param f Future.
- * @return {@code True} if mini-future.
- */
- private boolean isMini(IgniteInternalFuture<?> f) {
- return f.getClass().equals(MiniFuture.class);
- }
-
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridCacheOptimisticCheckPreparedTxFuture.class, this, "super", super.toString());
- }
-
- /**
- *
- */
- private class MiniFuture extends GridFutureAdapter<Boolean> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Mini future ID. */
- private final IgniteUuid futId = IgniteUuid.randomUuid();
-
- /** Node ID. */
- private UUID nodeId;
-
- /**
- * @param nodeId Node ID.
- */
- private MiniFuture(UUID nodeId) {
- this.nodeId = nodeId;
- }
-
- /**
- * @return Node ID.
- */
- private UUID nodeId() {
- return nodeId;
- }
-
- /**
- * @return Future ID.
- */
- private IgniteUuid futureId() {
- return futId;
- }
-
- /**
- * @param e Error.
- */
- private void onError(Throwable e) {
- if (log.isDebugEnabled())
- log.debug("Failed to get future result [fut=" + this + ", err=" + e + ']');
-
- onDone(e);
- }
-
- /**
- */
- private void onNodeLeft() {
- if (log.isDebugEnabled())
- log.debug("Transaction node left grid (will ignore) [fut=" + this + ']');
-
- if (nearTxCheck) {
- // Near and originating nodes left, need initiate tx check.
- cctx.tm().commitIfPrepared(tx);
-
- onDone(new ClusterTopologyCheckedException("Transaction node left grid (will ignore)."));
- }
- else
- onDone(true);
- }
-
- /**
- * @param res Result callback.
- */
- private void onResult(GridCacheOptimisticCheckPreparedTxResponse res) {
- onDone(res.success());
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(MiniFuture.class, this, "done", isDone(), "err", error());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
deleted file mode 100644
index 4f2a1d6..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * 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.distributed;
-
-import org.apache.ignite.internal.processors.cache.transactions.*;
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-
-import java.io.*;
-import java.nio.*;
-
-/**
- * Message sent to check that transactions related to transaction were prepared on remote node.
- */
-public class GridCacheOptimisticCheckPreparedTxRequest extends GridDistributedBaseMessage {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Future ID. */
- private IgniteUuid futId;
-
- /** Mini future ID. */
- private IgniteUuid miniId;
-
- /** Near transaction ID. */
- private GridCacheVersion nearXidVer;
-
- /** Expected number of transactions on node. */
- private int txNum;
-
- /** System transaction flag. */
- private boolean sys;
-
- /** {@code True} if should check only tx on near node. */
- private boolean nearTxCheck;
-
- /**
- * Empty constructor required by {@link Externalizable}
- */
- public GridCacheOptimisticCheckPreparedTxRequest() {
- // No-op.
- }
-
- /**
- * @param tx Transaction.
- * @param txNum Expected number of transactions on remote node.
- * @param nearTxCheck
- * @param futId Future ID.
- * @param miniId Mini future ID.
- */
- public GridCacheOptimisticCheckPreparedTxRequest(IgniteInternalTx tx,
- int txNum,
- boolean nearTxCheck,
- IgniteUuid futId,
- IgniteUuid miniId)
- {
- super(tx.xidVersion(), 0);
-
- nearXidVer = tx.nearXidVersion();
- sys = tx.system();
-
- this.futId = futId;
- this.miniId = miniId;
- this.txNum = txNum;
- this.nearTxCheck = nearTxCheck;
- }
-
- /**
- * @return {@code True} if should check only tx on near node.
- */
- public boolean nearTxCheck() {
- return nearTxCheck;
- }
-
- /**
- * @return Near version.
- */
- public GridCacheVersion nearXidVersion() {
- return nearXidVer;
- }
-
- /**
- * @return Future ID.
- */
- public IgniteUuid futureId() {
- return futId;
- }
-
- /**
- * @return Mini future ID.
- */
- public IgniteUuid miniId() {
- return miniId;
- }
-
- /**
- * @return Expected number of transactions on node.
- */
- public int transactions() {
- return txNum;
- }
-
- /**
- * @return System transaction flag.
- */
- public boolean system() {
- return sys;
- }
-
- /** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
-
- if (!super.writeTo(buf, writer))
- return false;
-
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType(), fieldsCount()))
- return false;
-
- writer.onHeaderWritten();
- }
-
- switch (writer.state()) {
- case 8:
- if (!writer.writeIgniteUuid("futId", futId))
- return false;
-
- writer.incrementState();
-
- case 9:
- if (!writer.writeIgniteUuid("miniId", miniId))
- return false;
-
- writer.incrementState();
-
- case 10:
- if (!writer.writeBoolean("nearTxCheck", nearTxCheck))
- return false;
-
- writer.incrementState();
-
- case 11:
- if (!writer.writeMessage("nearXidVer", nearXidVer))
- return false;
-
- writer.incrementState();
-
- case 12:
- if (!writer.writeBoolean("sys", sys))
- return false;
-
- writer.incrementState();
-
- case 13:
- if (!writer.writeInt("txNum", txNum))
- return false;
-
- writer.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
- reader.setBuffer(buf);
-
- if (!reader.beforeMessageRead())
- return false;
-
- if (!super.readFrom(buf, reader))
- return false;
-
- switch (reader.state()) {
- case 8:
- futId = reader.readIgniteUuid("futId");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 9:
- miniId = reader.readIgniteUuid("miniId");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 10:
- nearTxCheck = reader.readBoolean("nearTxCheck");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 11:
- nearXidVer = reader.readMessage("nearXidVer");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 12:
- sys = reader.readBoolean("sys");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 13:
- txNum = reader.readInt("txNum");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public byte directType() {
- return 16;
- }
-
- /** {@inheritDoc} */
- @Override public byte fieldsCount() {
- return 14;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridCacheOptimisticCheckPreparedTxRequest.class, this, "super", super.toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
deleted file mode 100644
index bc8c2e0..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * 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.distributed;
-
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-
-import java.io.*;
-import java.nio.*;
-
-/**
- * Check prepared transactions response.
- */
-public class GridCacheOptimisticCheckPreparedTxResponse extends GridDistributedBaseMessage {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Future ID. */
- private IgniteUuid futId;
-
- /** Mini future ID. */
- private IgniteUuid miniId;
-
- /** Flag indicating if all remote transactions were prepared. */
- private boolean success;
-
- /**
- * Empty constructor required by {@link Externalizable}
- */
- public GridCacheOptimisticCheckPreparedTxResponse() {
- // No-op.
- }
-
- /**
- * @param txId Transaction ID.
- * @param futId Future ID.
- * @param miniId Mini future ID.
- * @param success {@code True} if all remote transactions were prepared, {@code false} otherwise.
- */
- public GridCacheOptimisticCheckPreparedTxResponse(GridCacheVersion txId, IgniteUuid futId, IgniteUuid miniId,
- boolean success) {
- super(txId, 0);
-
- this.futId = futId;
- this.miniId = miniId;
- this.success = success;
- }
-
- /**
- * @return Future ID.
- */
- public IgniteUuid futureId() {
- return futId;
- }
-
- /**
- * @return Mini future ID.
- */
- public IgniteUuid miniId() {
- return miniId;
- }
-
- /**
- * @return {@code True} if all remote transactions were prepared.
- */
- public boolean success() {
- return success;
- }
-
- /** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
-
- if (!super.writeTo(buf, writer))
- return false;
-
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType(), fieldsCount()))
- return false;
-
- writer.onHeaderWritten();
- }
-
- switch (writer.state()) {
- case 8:
- if (!writer.writeIgniteUuid("futId", futId))
- return false;
-
- writer.incrementState();
-
- case 9:
- if (!writer.writeIgniteUuid("miniId", miniId))
- return false;
-
- writer.incrementState();
-
- case 10:
- if (!writer.writeBoolean("success", success))
- return false;
-
- writer.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
- reader.setBuffer(buf);
-
- if (!reader.beforeMessageRead())
- return false;
-
- if (!super.readFrom(buf, reader))
- return false;
-
- switch (reader.state()) {
- case 8:
- futId = reader.readIgniteUuid("futId");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 9:
- miniId = reader.readIgniteUuid("miniId");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 10:
- success = reader.readBoolean("success");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public byte directType() {
- return 17;
- }
-
- /** {@inheritDoc} */
- @Override public byte fieldsCount() {
- return 11;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridCacheOptimisticCheckPreparedTxResponse.class, this, "super", super.toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
new file mode 100644
index 0000000..663ed90
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java
@@ -0,0 +1,506 @@
+/*
+ * 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.distributed;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.transactions.*;
+import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.future.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Future verifying that all remote transactions related to transaction were prepared or committed.
+ */
+public class GridCacheTxRecoveryFuture 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;
+
+ /** Context. */
+ private final GridCacheSharedContext<?, ?> cctx;
+
+ /** Future ID. */
+ private final IgniteUuid futId = IgniteUuid.randomUuid();
+
+ /** Transaction. */
+ private final IgniteInternalTx tx;
+
+ /** All involved nodes. */
+ private final Map<UUID, ClusterNode> nodes;
+
+ /** ID of failed node started transaction. */
+ private final UUID failedNodeId;
+
+ /** Transaction nodes mapping. */
+ private final Map<UUID, Collection<UUID>> txNodes;
+
+ /** */
+ private final boolean nearTxCheck;
+
+ /**
+ * @param cctx Context.
+ * @param tx Transaction.
+ * @param failedNodeId ID of failed node started transaction.
+ * @param txNodes Transaction mapping.
+ */
+ @SuppressWarnings("ConstantConditions")
+ public GridCacheTxRecoveryFuture(GridCacheSharedContext<?, ?> cctx,
+ IgniteInternalTx tx,
+ UUID failedNodeId,
+ Map<UUID, Collection<UUID>> txNodes)
+ {
+ super(cctx.kernalContext(), CU.boolReducer());
+
+ this.cctx = cctx;
+ this.tx = tx;
+ this.txNodes = txNodes;
+ this.failedNodeId = failedNodeId;
+
+ if (log == null)
+ log = U.logger(cctx.kernalContext(), logRef, GridCacheTxRecoveryFuture.class);
+
+ nodes = new GridLeanMap<>();
+
+ UUID locNodeId = cctx.localNodeId();
+
+ for (Map.Entry<UUID, Collection<UUID>> e : tx.transactionNodes().entrySet()) {
+ if (!locNodeId.equals(e.getKey()) && !failedNodeId.equals(e.getKey()) && !nodes.containsKey(e.getKey())) {
+ ClusterNode node = cctx.discovery().node(e.getKey());
+
+ if (node != null)
+ nodes.put(node.id(), node);
+ else if (log.isDebugEnabled())
+ log.debug("Transaction node left (will ignore) " + e.getKey());
+ }
+
+ for (UUID nodeId : e.getValue()) {
+ if (!locNodeId.equals(nodeId) && !failedNodeId.equals(nodeId) && !nodes.containsKey(nodeId)) {
+ ClusterNode node = cctx.discovery().node(nodeId);
+
+ if (node != null)
+ nodes.put(node.id(), node);
+ else if (log.isDebugEnabled())
+ log.debug("Transaction node left (will ignore) " + e.getKey());
+ }
+ }
+ }
+
+ UUID nearNodeId = tx.eventNodeId();
+
+ nearTxCheck = !failedNodeId.equals(nearNodeId) && cctx.discovery().alive(nearNodeId);
+ }
+
+ /**
+ * Initializes future.
+ */
+ @SuppressWarnings("ConstantConditions")
+ public void prepare() {
+ if (nearTxCheck) {
+ UUID nearNodeId = tx.eventNodeId();
+
+ if (cctx.localNodeId().equals(nearNodeId)) {
+ IgniteInternalFuture<Boolean> fut = cctx.tm().txCommitted(tx.nearXidVersion());
+
+ fut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
+ @Override public void apply(IgniteInternalFuture<Boolean> fut) {
+ try {
+ onDone(fut.get());
+ }
+ catch (IgniteCheckedException e) {
+ onDone(e);
+ }
+ }
+ });
+ }
+ else {
+ MiniFuture fut = new MiniFuture(tx.eventNodeId());
+
+ add(fut);
+
+ GridCacheTxRecoveryRequest req = new GridCacheTxRecoveryRequest(
+ tx,
+ 0,
+ true,
+ futureId(),
+ fut.futureId());
+
+ try {
+ cctx.io().send(nearNodeId, req, tx.ioPolicy());
+ }
+ catch (ClusterTopologyCheckedException e) {
+ fut.onNodeLeft();
+ }
+ catch (IgniteCheckedException e) {
+ fut.onError(e);
+ }
+
+ markInitialized();
+ }
+
+ return;
+ }
+
+ // First check transactions on local node.
+ int locTxNum = nodeTransactions(cctx.localNodeId());
+
+ if (locTxNum > 1) {
+ IgniteInternalFuture<Boolean> fut = cctx.tm().txsPreparedOrCommitted(tx.nearXidVersion(), locTxNum);
+
+ if (fut == null || fut.isDone()) {
+ boolean prepared;
+
+ try {
+ prepared = fut == null ? true : fut.get();
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Check prepared transaction future failed: " + e, e);
+
+ prepared = false;
+ }
+
+ if (!prepared) {
+ onDone(false);
+
+ markInitialized();
+
+ return;
+ }
+ }
+ else {
+ fut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
+ @Override public void apply(IgniteInternalFuture<Boolean> fut) {
+ boolean prepared;
+
+ try {
+ prepared = fut.get();
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Check prepared transaction future failed: " + e, e);
+
+ prepared = false;
+ }
+
+ if (!prepared) {
+ onDone(false);
+
+ markInitialized();
+ }
+ else
+ proceedPrepare();
+ }
+ });
+
+ return;
+ }
+ }
+
+ proceedPrepare();
+ }
+
+ /**
+ * Process prepare after local check.
+ */
+ private void proceedPrepare() {
+ for (Map.Entry<UUID, Collection<UUID>> entry : txNodes.entrySet()) {
+ UUID nodeId = entry.getKey();
+
+ // Skip left nodes and local node.
+ if (!nodes.containsKey(nodeId) && nodeId.equals(cctx.localNodeId()))
+ continue;
+
+ /*
+ * If primary node failed then send message to all backups, otherwise
+ * send message only to primary node.
+ */
+
+ if (nodeId.equals(failedNodeId)) {
+ for (UUID id : entry.getValue()) {
+ // Skip backup node if it is local node or if it is also was mapped as primary.
+ if (txNodes.containsKey(id) || id.equals(cctx.localNodeId()))
+ continue;
+
+ MiniFuture fut = new MiniFuture(id);
+
+ add(fut);
+
+ GridCacheTxRecoveryRequest req = new GridCacheTxRecoveryRequest(tx,
+ nodeTransactions(id),
+ false,
+ futureId(),
+ fut.futureId());
+
+ try {
+ cctx.io().send(id, req, tx.ioPolicy());
+ }
+ catch (ClusterTopologyCheckedException ignored) {
+ fut.onNodeLeft();
+ }
+ catch (IgniteCheckedException e) {
+ fut.onError(e);
+
+ break;
+ }
+ }
+ }
+ else {
+ MiniFuture fut = new MiniFuture(nodeId);
+
+ add(fut);
+
+ GridCacheTxRecoveryRequest req = new GridCacheTxRecoveryRequest(
+ tx,
+ nodeTransactions(nodeId),
+ false,
+ futureId(),
+ fut.futureId());
+
+ try {
+ cctx.io().send(nodeId, req, tx.ioPolicy());
+ }
+ catch (ClusterTopologyCheckedException ignored) {
+ fut.onNodeLeft();
+ }
+ catch (IgniteCheckedException e) {
+ fut.onError(e);
+
+ break;
+ }
+ }
+ }
+
+ markInitialized();
+ }
+
+ /**
+ * @param nodeId Node ID.
+ * @return Number of transactions on node.
+ */
+ private int nodeTransactions(UUID nodeId) {
+ int cnt = txNodes.containsKey(nodeId) ? 1 : 0; // +1 if node is primary.
+
+ for (Collection<UUID> backups : txNodes.values()) {
+ for (UUID backup : backups) {
+ if (backup.equals(nodeId)) {
+ cnt++; // +1 if node is backup.
+
+ break;
+ }
+ }
+ }
+
+ return cnt;
+ }
+
+ /**
+ * @param nodeId Node ID.
+ * @param res Response.
+ */
+ public void onResult(UUID nodeId, GridCacheTxRecoveryResponse res) {
+ if (!isDone()) {
+ for (IgniteInternalFuture<Boolean> fut : pending()) {
+ if (isMini(fut)) {
+ MiniFuture f = (MiniFuture)fut;
+
+ if (f.futureId().equals(res.miniId())) {
+ assert f.nodeId().equals(nodeId);
+
+ f.onResult(res);
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteUuid futureId() {
+ return futId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public GridCacheVersion version() {
+ return tx.xidVersion();
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<? extends ClusterNode> nodes() {
+ return nodes.values();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean onNodeLeft(UUID nodeId) {
+ for (IgniteInternalFuture<?> fut : futures())
+ if (isMini(fut)) {
+ MiniFuture f = (MiniFuture)fut;
+
+ if (f.nodeId().equals(nodeId)) {
+ f.onNodeLeft();
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean trackable() {
+ return trackable;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void markNotTrackable() {
+ trackable = false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean onDone(@Nullable Boolean res, @Nullable Throwable err) {
+ if (super.onDone(res, err)) {
+ cctx.mvcc().removeFuture(this);
+
+ if (err == null) {
+ assert res != null;
+
+ cctx.tm().finishTxOnRecovery(tx, res);
+ }
+ else {
+ if (err instanceof ClusterTopologyCheckedException && nearTxCheck) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to check transaction on near node, " +
+ "ignoring [err=" + err + ", tx=" + tx + ']');
+ }
+ else {
+ if (log.isDebugEnabled())
+ log.debug("Failed to check prepared transactions, " +
+ "invalidating transaction [err=" + err + ", tx=" + tx + ']');
+
+ cctx.tm().salvageTx(tx);
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @param f Future.
+ * @return {@code True} if mini-future.
+ */
+ private boolean isMini(IgniteInternalFuture<?> f) {
+ return f.getClass().equals(MiniFuture.class);
+ }
+
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridCacheTxRecoveryFuture.class, this, "super", super.toString());
+ }
+
+ /**
+ *
+ */
+ private class MiniFuture extends GridFutureAdapter<Boolean> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Mini future ID. */
+ private final IgniteUuid futId = IgniteUuid.randomUuid();
+
+ /** Node ID. */
+ private UUID nodeId;
+
+ /**
+ * @param nodeId Node ID.
+ */
+ private MiniFuture(UUID nodeId) {
+ this.nodeId = nodeId;
+ }
+
+ /**
+ * @return Node ID.
+ */
+ private UUID nodeId() {
+ return nodeId;
+ }
+
+ /**
+ * @return Future ID.
+ */
+ private IgniteUuid futureId() {
+ return futId;
+ }
+
+ /**
+ * @param e Error.
+ */
+ private void onError(Throwable e) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to get future result [fut=" + this + ", err=" + e + ']');
+
+ onDone(e);
+ }
+
+ /**
+ */
+ private void onNodeLeft() {
+ if (log.isDebugEnabled())
+ log.debug("Transaction node left grid (will ignore) [fut=" + this + ']');
+
+ if (nearTxCheck) {
+ // Near and originating nodes left, need initiate tx check.
+ cctx.tm().commitIfPrepared(tx);
+
+ onDone(new ClusterTopologyCheckedException("Transaction node left grid (will ignore)."));
+ }
+ else
+ onDone(true);
+ }
+
+ /**
+ * @param res Result callback.
+ */
+ private void onResult(GridCacheTxRecoveryResponse res) {
+ onDone(res.success());
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(MiniFuture.class, this, "done", isDone(), "err", error());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
new file mode 100644
index 0000000..259c288
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
@@ -0,0 +1,261 @@
+/*
+ * 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.distributed;
+
+import org.apache.ignite.internal.processors.cache.transactions.*;
+import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+
+import java.io.*;
+import java.nio.*;
+
+/**
+ * Message sent to check that transactions related to transaction were prepared on remote node.
+ */
+public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Future ID. */
+ private IgniteUuid futId;
+
+ /** Mini future ID. */
+ private IgniteUuid miniId;
+
+ /** Near transaction ID. */
+ private GridCacheVersion nearXidVer;
+
+ /** Expected number of transactions on node. */
+ private int txNum;
+
+ /** System transaction flag. */
+ private boolean sys;
+
+ /** {@code True} if should check only tx on near node. */
+ private boolean nearTxCheck;
+
+ /**
+ * Empty constructor required by {@link Externalizable}
+ */
+ public GridCacheTxRecoveryRequest() {
+ // No-op.
+ }
+
+ /**
+ * @param tx Transaction.
+ * @param txNum Expected number of transactions on remote node.
+ * @param nearTxCheck {@code True} if should check only tx on near node.
+ * @param futId Future ID.
+ * @param miniId Mini future ID.
+ */
+ public GridCacheTxRecoveryRequest(IgniteInternalTx tx,
+ int txNum,
+ boolean nearTxCheck,
+ IgniteUuid futId,
+ IgniteUuid miniId)
+ {
+ super(tx.xidVersion(), 0);
+
+ nearXidVer = tx.nearXidVersion();
+ sys = tx.system();
+
+ this.futId = futId;
+ this.miniId = miniId;
+ this.txNum = txNum;
+ this.nearTxCheck = nearTxCheck;
+ }
+
+ /**
+ * @return {@code True} if should check only tx on near node.
+ */
+ public boolean nearTxCheck() {
+ return nearTxCheck;
+ }
+
+ /**
+ * @return Near version.
+ */
+ public GridCacheVersion nearXidVersion() {
+ return nearXidVer;
+ }
+
+ /**
+ * @return Future ID.
+ */
+ public IgniteUuid futureId() {
+ return futId;
+ }
+
+ /**
+ * @return Mini future ID.
+ */
+ public IgniteUuid miniId() {
+ return miniId;
+ }
+
+ /**
+ * @return Expected number of transactions on node.
+ */
+ public int transactions() {
+ return txNum;
+ }
+
+ /**
+ * @return System transaction flag.
+ */
+ public boolean system() {
+ return sys;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
+ writer.setBuffer(buf);
+
+ if (!super.writeTo(buf, writer))
+ return false;
+
+ if (!writer.isHeaderWritten()) {
+ if (!writer.writeHeader(directType(), fieldsCount()))
+ return false;
+
+ writer.onHeaderWritten();
+ }
+
+ switch (writer.state()) {
+ case 8:
+ if (!writer.writeIgniteUuid("futId", futId))
+ return false;
+
+ writer.incrementState();
+
+ case 9:
+ if (!writer.writeIgniteUuid("miniId", miniId))
+ return false;
+
+ writer.incrementState();
+
+ case 10:
+ if (!writer.writeBoolean("nearTxCheck", nearTxCheck))
+ return false;
+
+ writer.incrementState();
+
+ case 11:
+ if (!writer.writeMessage("nearXidVer", nearXidVer))
+ return false;
+
+ writer.incrementState();
+
+ case 12:
+ if (!writer.writeBoolean("sys", sys))
+ return false;
+
+ writer.incrementState();
+
+ case 13:
+ if (!writer.writeInt("txNum", txNum))
+ return false;
+
+ writer.incrementState();
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
+ reader.setBuffer(buf);
+
+ if (!reader.beforeMessageRead())
+ return false;
+
+ if (!super.readFrom(buf, reader))
+ return false;
+
+ switch (reader.state()) {
+ case 8:
+ futId = reader.readIgniteUuid("futId");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 9:
+ miniId = reader.readIgniteUuid("miniId");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 10:
+ nearTxCheck = reader.readBoolean("nearTxCheck");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 11:
+ nearXidVer = reader.readMessage("nearXidVer");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 12:
+ sys = reader.readBoolean("sys");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 13:
+ txNum = reader.readInt("txNum");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 16;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte fieldsCount() {
+ return 14;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridCacheTxRecoveryRequest.class, this, "super", super.toString());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
new file mode 100644
index 0000000..e5c026a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
@@ -0,0 +1,182 @@
+/*
+ * 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.distributed;
+
+import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+
+import java.io.*;
+import java.nio.*;
+
+/**
+ * Transactions recovery check response.
+ */
+public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Future ID. */
+ private IgniteUuid futId;
+
+ /** Mini future ID. */
+ private IgniteUuid miniId;
+
+ /** Flag indicating if all remote transactions were prepared. */
+ private boolean success;
+
+ /**
+ * Empty constructor required by {@link Externalizable}
+ */
+ public GridCacheTxRecoveryResponse() {
+ // No-op.
+ }
+
+ /**
+ * @param txId Transaction ID.
+ * @param futId Future ID.
+ * @param miniId Mini future ID.
+ * @param success {@code True} if all remote transactions were prepared, {@code false} otherwise.
+ */
+ public GridCacheTxRecoveryResponse(GridCacheVersion txId,
+ IgniteUuid futId,
+ IgniteUuid miniId,
+ boolean success)
+ {
+ super(txId, 0);
+
+ this.futId = futId;
+ this.miniId = miniId;
+ this.success = success;
+ }
+
+ /**
+ * @return Future ID.
+ */
+ public IgniteUuid futureId() {
+ return futId;
+ }
+
+ /**
+ * @return Mini future ID.
+ */
+ public IgniteUuid miniId() {
+ return miniId;
+ }
+
+ /**
+ * @return {@code True} if all remote transactions were prepared.
+ */
+ public boolean success() {
+ return success;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
+ writer.setBuffer(buf);
+
+ if (!super.writeTo(buf, writer))
+ return false;
+
+ if (!writer.isHeaderWritten()) {
+ if (!writer.writeHeader(directType(), fieldsCount()))
+ return false;
+
+ writer.onHeaderWritten();
+ }
+
+ switch (writer.state()) {
+ case 8:
+ if (!writer.writeIgniteUuid("futId", futId))
+ return false;
+
+ writer.incrementState();
+
+ case 9:
+ if (!writer.writeIgniteUuid("miniId", miniId))
+ return false;
+
+ writer.incrementState();
+
+ case 10:
+ if (!writer.writeBoolean("success", success))
+ return false;
+
+ writer.incrementState();
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
+ reader.setBuffer(buf);
+
+ if (!reader.beforeMessageRead())
+ return false;
+
+ if (!super.readFrom(buf, reader))
+ return false;
+
+ switch (reader.state()) {
+ case 8:
+ futId = reader.readIgniteUuid("futId");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 9:
+ miniId = reader.readIgniteUuid("miniId");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 10:
+ success = reader.readBoolean("success");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 17;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte fieldsCount() {
+ return 11;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridCacheTxRecoveryResponse.class, this, "super", super.toString());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 2897e30..af75fb8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -119,16 +119,16 @@ public class IgniteTxHandler {
}
});
- ctx.io().addHandler(0, GridCacheOptimisticCheckPreparedTxRequest.class,
- new CI2<UUID, GridCacheOptimisticCheckPreparedTxRequest>() {
- @Override public void apply(UUID nodeId, GridCacheOptimisticCheckPreparedTxRequest req) {
+ ctx.io().addHandler(0, GridCacheTxRecoveryRequest.class,
+ new CI2<UUID, GridCacheTxRecoveryRequest>() {
+ @Override public void apply(UUID nodeId, GridCacheTxRecoveryRequest req) {
processCheckPreparedTxRequest(nodeId, req);
}
});
- ctx.io().addHandler(0, GridCacheOptimisticCheckPreparedTxResponse.class,
- new CI2<UUID, GridCacheOptimisticCheckPreparedTxResponse>() {
- @Override public void apply(UUID nodeId, GridCacheOptimisticCheckPreparedTxResponse res) {
+ ctx.io().addHandler(0, GridCacheTxRecoveryResponse.class,
+ new CI2<UUID, GridCacheTxRecoveryResponse>() {
+ @Override public void apply(UUID nodeId, GridCacheTxRecoveryResponse res) {
processCheckPreparedTxResponse(nodeId, res);
}
});
@@ -138,6 +138,7 @@ public class IgniteTxHandler {
* @param nearNodeId Near node ID that initiated transaction.
* @param locTx Optional local transaction.
* @param req Near prepare request.
+ * @param completeCb Completion callback.
* @return Future for transaction.
*/
public IgniteInternalFuture<IgniteInternalTx> prepareTx(
@@ -170,6 +171,7 @@ public class IgniteTxHandler {
*
* @param locTx Local transaction.
* @param req Near prepare request.
+ * @param completeCb Completion callback.
* @return Prepare future.
*/
private IgniteInternalFuture<IgniteInternalTx> prepareColocatedTx(
@@ -177,7 +179,6 @@ public class IgniteTxHandler {
final GridNearTxPrepareRequest req,
final IgniteInClosure<GridNearTxPrepareResponse> completeCb
) {
-
IgniteInternalFuture<Object> fut = new GridFinishedFuture<>(); // TODO force preload keys.
return new GridEmbeddedFuture<>(
@@ -223,6 +224,7 @@ public class IgniteTxHandler {
*
* @param nearNodeId Near node ID that initiated transaction.
* @param req Near prepare request.
+ * @param completeCb Completion callback.
* @return Prepare future.
*/
private IgniteInternalFuture<IgniteInternalTx> prepareNearTx(
@@ -442,6 +444,7 @@ public class IgniteTxHandler {
/**
* @param nodeId Node ID.
+ * @param locTx Local transaction.
* @param req Request.
* @return Future.
*/
@@ -1099,6 +1102,7 @@ public class IgniteTxHandler {
}
/**
+ * @param cacheCtx Context.
* @param key Key
* @param ver Version.
* @throws IgniteCheckedException If invalidate failed.
@@ -1183,7 +1187,7 @@ public class IgniteTxHandler {
* @param req Request.
*/
protected void processCheckPreparedTxRequest(final UUID nodeId,
- final GridCacheOptimisticCheckPreparedTxRequest req)
+ final GridCacheTxRecoveryRequest req)
{
if (log.isDebugEnabled())
log.debug("Processing check prepared transaction requests [nodeId=" + nodeId + ", req=" + req + ']');
@@ -1231,10 +1235,10 @@ public class IgniteTxHandler {
* @param prepared {@code True} if all transaction prepared or committed.
*/
private void sendCheckPreparedResponse(UUID nodeId,
- GridCacheOptimisticCheckPreparedTxRequest req,
+ GridCacheTxRecoveryRequest req,
boolean prepared) {
- GridCacheOptimisticCheckPreparedTxResponse res =
- new GridCacheOptimisticCheckPreparedTxResponse(req.version(), req.futureId(), req.miniId(), prepared);
+ GridCacheTxRecoveryResponse res =
+ new GridCacheTxRecoveryResponse(req.version(), req.futureId(), req.miniId(), prepared);
try {
if (log.isDebugEnabled())
@@ -1256,11 +1260,11 @@ public class IgniteTxHandler {
* @param nodeId Node ID.
* @param res Response.
*/
- protected void processCheckPreparedTxResponse(UUID nodeId, GridCacheOptimisticCheckPreparedTxResponse res) {
+ protected void processCheckPreparedTxResponse(UUID nodeId, GridCacheTxRecoveryResponse res) {
if (log.isDebugEnabled())
log.debug("Processing check prepared transaction response [nodeId=" + nodeId + ", res=" + res + ']');
- GridCacheOptimisticCheckPreparedTxFuture fut = (GridCacheOptimisticCheckPreparedTxFuture)ctx.mvcc().
+ GridCacheTxRecoveryFuture fut = (GridCacheTxRecoveryFuture)ctx.mvcc().
<Boolean>future(res.version(), res.futureId());
if (fut == null) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 85b3ad0..8a1d490 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -1931,40 +1931,12 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
}
/**
- * Gets local transaction for pessimistic tx recovery.
- *
- * @param nearXidVer Near tx ID.
- * @return Near local or colocated local transaction.
- */
- @Nullable public IgniteInternalTx localTxForRecovery(GridCacheVersion nearXidVer, boolean markFinalizing) {
- // First check if we have near transaction with this ID.
- IgniteInternalTx tx = idMap.get(nearXidVer);
-
- if (tx == null) {
- // Check all local transactions and mark them as waiting for recovery to prevent finish race.
- for (IgniteInternalTx txEx : idMap.values()) {
- if (nearXidVer.equals(txEx.nearXidVersion())) {
- if (!markFinalizing || !txEx.markFinalizing(RECOVERY_WAIT))
- tx = txEx;
- }
- }
- }
-
- // Either we found near transaction or one of transactions is being committed by user.
- // Wait for it and send reply.
- if (tx != null && tx.local())
- return tx;
-
- return null;
- }
-
- /**
* Commits or rolls back prepared transaction.
*
* @param tx Transaction.
* @param commit Whether transaction should be committed or rolled back.
*/
- public void finishOptimisticTxOnRecovery(final IgniteInternalTx tx, boolean commit) {
+ public void finishTxOnRecovery(final IgniteInternalTx tx, boolean commit) {
if (log.isDebugEnabled())
log.debug("Finishing prepared transaction [tx=" + tx + ", commit=" + commit + ']');
@@ -1989,71 +1961,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
}
/**
- * Commits or rolls back pessimistic transaction.
- *
- * @param tx Transaction to finish.
- * @param commitInfo Commit information.
- */
- public void finishPessimisticTxOnRecovery(final IgniteInternalTx tx, GridCacheCommittedTxInfo commitInfo) {
- if (!tx.markFinalizing(RECOVERY_FINISH)) {
- if (log.isDebugEnabled())
- log.debug("Will not try to finish pessimistic transaction (could not mark as finalizing): " + tx);
-
- return;
- }
-
- if (tx instanceof GridDistributedTxRemoteAdapter) {
- IgniteTxRemoteEx rmtTx = (IgniteTxRemoteEx)tx;
-
- rmtTx.doneRemote(tx.xidVersion(),
- Collections.<GridCacheVersion>emptyList(),
- Collections.<GridCacheVersion>emptyList(),
- Collections.<GridCacheVersion>emptyList());
- }
-
- try {
- tx.prepare();
-
- if (commitInfo != null) {
- for (IgniteTxEntry entry : commitInfo.recoveryWrites()) {
- IgniteTxEntry write = tx.writeMap().get(entry.txKey());
-
- if (write != null) {
- GridCacheEntryEx cached = write.cached();
-
- IgniteTxEntry recovered = entry.cleanCopy(write.context());
-
- if (cached == null || cached.detached())
- cached = write.context().cache().entryEx(entry.key(), tx.topologyVersion());
-
- recovered.cached(cached);
-
- tx.writeMap().put(entry.txKey(), recovered);
-
- continue;
- }
-
- // If write was not found, check read.
- IgniteTxEntry read = tx.readMap().remove(entry.txKey());
-
- if (read != null)
- tx.writeMap().put(entry.txKey(), entry);
- }
-
- tx.commitAsync().listen(new CommitListener(tx));
- }
- else
- tx.rollbackAsync();
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to prepare pessimistic transaction (will invalidate): " + tx, e);
-
- salvageTx(tx);
- }
- }
-
- /**
- * Commits optimistic transaction in case when node started transaction failed, but all related
+ * Commits transaction in case when node started transaction failed, but all related
* transactions were prepared (invalidates transaction if it is not fully prepared).
*
* @param tx Transaction.
@@ -2063,7 +1971,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
assert !F.isEmpty(tx.transactionNodes()) : tx;
assert tx.nearXidVersion() != null : tx;
- GridCacheOptimisticCheckPreparedTxFuture fut = new GridCacheOptimisticCheckPreparedTxFuture<>(
+ GridCacheTxRecoveryFuture fut = new GridCacheTxRecoveryFuture(
cctx,
tx,
tx.originatingNodeId(),
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5f95fb8/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 35495ed..657f4af 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -455,9 +455,9 @@ org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresMa
org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager$QueueHeaderPredicate
org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager$RemoveSetDataCallable
org.apache.ignite.internal.processors.cache.distributed.GridCacheCommittedTxInfo
-org.apache.ignite.internal.processors.cache.distributed.GridCacheOptimisticCheckPreparedTxFuture$1
-org.apache.ignite.internal.processors.cache.distributed.GridCacheOptimisticCheckPreparedTxRequest
-org.apache.ignite.internal.processors.cache.distributed.GridCacheOptimisticCheckPreparedTxResponse
+org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryFuture$1
+org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryRequest
+org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryResponse
org.apache.ignite.internal.processors.cache.distributed.GridCacheTtlUpdateRequest
org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter
[27/50] [abbrv] incubator-ignite git commit: # Remove unused methods
from GridFunc.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/942abe45/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index c86c5a4..6f544e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -20,10 +20,8 @@ package org.apache.ignite.internal.util.lang;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
-import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
@@ -31,9 +29,6 @@ import org.jetbrains.annotations.*;
import org.jsr166.*;
import javax.cache.*;
-import java.io.*;
-import java.lang.reflect.*;
-import java.math.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
@@ -74,13 +69,6 @@ public class GridFunc {
};
/** */
- private static final IgnitePredicate<Boolean> IDENTITY_PRED = new P1<Boolean>() {
- @Override public boolean apply(Boolean e) {
- return e;
- }
- };
-
- /** */
private static final IgnitePredicate<Object> ALWAYS_TRUE = new P1<Object>() {
@Override public boolean apply(Object e) {
return true;
@@ -128,34 +116,6 @@ public class GridFunc {
};
/** */
- public static final IgnitePredicate<String> EMPTY_STRING = new P1<String>() {
- @Override public boolean apply(String s) {
- return isEmpty(s);
- }
- };
-
- /** */
- public static final IgnitePredicate<String> NOT_EMPTY_STRING = new P1<String>() {
- @Override public boolean apply(String s) {
- return !isEmpty(s);
- }
- };
-
- /** */
- public static final IgnitePredicate EMPTY_COLLECTION = new P1<Collection>() {
- @Override public boolean apply(Collection c) {
- return isEmpty(c);
- }
- };
-
- /** */
- public static final IgnitePredicate NOT_EMPTY_COLLECTION = new P1<Collection>() {
- @Override public boolean apply(Collection c) {
- return !isEmpty(c);
- }
- };
-
- /** */
private static final IgniteCallable<?> LIST_FACTORY = new IgniteCallable<List>() {
@Override public List call() {
return new ArrayList();
@@ -266,84 +226,6 @@ public class GridFunc {
};
/** */
- private static final IgniteInClosure<?> PRINTLN = new CI1() {
- @Override public void apply(Object o) {
- System.out.println(o);
- }
-
- @Override public String toString() {
- return "Print line closure.";
- }
- };
-
- /** */
- private static final IgniteInClosure<?> PRINT = new CI1() {
- @Override public void apply(Object o) {
- System.out.print(o);
- }
-
- @Override public String toString() {
- return "Print closure.";
- }
- };
-
- /** */
- private static final IgniteOutClosure<?> NILL = new CO() {
- @Nullable @Override public Object apply() {
- return null;
- }
-
- @Override public String toString() {
- return "Nill closure.";
- }
- };
-
- /** */
- private static final IgniteClosure<Runnable, GridAbsClosure> R2C = new C1<Runnable, GridAbsClosure>() {
- @Override public GridAbsClosure apply(Runnable r) {
- return as(r);
- }
-
- @Override public String toString() {
- return "Runnable to absolute closure transformer.";
- }
- };
-
- /** */
- private static final IgniteClosure<ClusterGroup, IgnitePredicate<ClusterNode>> P2P =
- new C1<ClusterGroup, IgnitePredicate<ClusterNode>>() {
- @Override public IgnitePredicate<ClusterNode> apply(ClusterGroup e) {
- return e.predicate();
- }
-
- @Override public String toString() {
- return "Projection to its predicate transformer closure.";
- }
- };
-
- /** */
- private static final IgniteClosure<Object, Class<?>> CLAZZ = new C1<Object, Class<?>>() {
- @Override public Class<?> apply(Object o) {
- return o.getClass();
- }
-
- @Override public String toString() {
- return "Object to class transformer closure.";
- }
- };
-
- /** */
- private static final IgniteClosure MAP_ENTRY_KEY = new IgniteClosure() {
- @Override public Object apply(Object o) {
- return ((Map.Entry)o).getKey();
- }
-
- @Override public String toString() {
- return "Map entry to key transformer closure.";
- }
- };
-
- /** */
private static final IgniteClosure CACHE_ENTRY_KEY = new IgniteClosure() {
@Override public Object apply(Object o) {
return ((Cache.Entry)o).getKey();
@@ -354,16 +236,6 @@ public class GridFunc {
}
};
- /** */
- private static final IgniteClosure MAP_ENTRY_VAL = new IgniteClosure() {
- @Override public Object apply(Object o) {
- return ((Map.Entry)o).getValue();
- }
-
- @Override public String toString() {
- return "Map entry to value transformer closure.";
- }
- };
/** */
private static final IgniteClosure CACHE_ENTRY_VAL_GET = new IgniteClosure() {
@@ -390,18 +262,6 @@ public class GridFunc {
};
/** */
- private static final IgnitePredicate CACHE_ENTRY_NO_PEEK_VAL = new IgnitePredicate() {
- @SuppressWarnings({"unchecked"})
- @Override public boolean apply(Object o) {
- return ((Cache.Entry)o).getValue() == null;
- }
-
- @Override public String toString() {
- return "Cache entry no-peek-value predicate.";
- }
- };
-
- /** */
private static final IgniteClosure<ClusterNode, UUID> NODE2ID = new IgniteClosure<ClusterNode, UUID>() {
@Override public UUID apply(ClusterNode n) {
return n.id();
@@ -442,44 +302,6 @@ public class GridFunc {
};
/**
- * Gets breaker predicate which will return a predicate that will
- * evaluate to {@code firstVal} when checked the first time,
- * but then will always evaluate to the opposite value.
- *
- * @param firstVal First value.
- * @param <T> Predicate type.
- * @return Breaker predicate.
- */
- public static <T> IgnitePredicate<T> breaker(final boolean firstVal) {
- return new IgnitePredicate<T>() {
- private boolean b = true;
-
- @Override public boolean apply(T e) {
- if (b) {
- b = false;
-
- return firstVal;
- }
-
- return !firstVal;
- }
-
- @Override public String toString() {
- return "Breaker predicate.";
- }
- };
- }
-
- /**
- * Gets closure that transform a grid projection into its predicate.
- *
- * @return Closure transforming a grid projection into its predicate.
- */
- public static IgniteClosure<ClusterGroup, IgnitePredicate<ClusterNode>> predicate() {
- return P2P;
- }
-
- /**
* Gets predicate that evaluates to {@code true} only for given local node ID.
*
* @param locNodeId Local node ID.
@@ -510,4868 +332,2608 @@ public class GridFunc {
}
/**
- * Returns out closure that always returns {@code null}.
- *
- * @return Out closure that always returns {@code null}.
- */
- @SuppressWarnings("unchecked")
- public static <T> IgniteOutClosure<T> nill() {
- return (IgniteOutClosure<T>)NILL;
- }
-
- /**
- * Creates closure that will reflectively call a method with the given name on
- * closure's argument and return result of that call.
- * <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteClosure} which is {@link C1}.
+ * Creates new collection by removing duplicates from the given collection.
*
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <R> Type of closure return value.
- * @param <T> Type of closure argument.
- * @return Reflective closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param c Collection to remove duplicates from.
+ * @param <T> Type of the collection.
+ * @return De-duped collection.
*/
- public static <T, R> IgniteClosure<T, R> cInvoke(final String mtdName, final Object... args) {
- A.notNull(mtdName, "mtdName");
-
- return new C1<T, R>() {
- private Method mtd;
+ public static <T> Collection<T> dedup(Collection<? extends T> c) {
+ A.notNull(c, "c");
- @SuppressWarnings("unchecked")
- @Override public R apply(T t) {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(t.getClass(), mtdName, args);
+ Collection<T> set = new GridLeanSet<>();
- mtd.setAccessible(true);
- }
+ set.addAll(c);
- return (R)mtd.invoke(t, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
- }
- };
+ return set;
}
/**
- * Creates in closure that will reflectively call a method with the given name on
- * closure's argument.
+ * Calculates sum of all elements.
* <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteClosure} which is {@link C1}.
+ * <img src="{@docRoot}/img/sum.png">
*
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <T> Type of closure argument.
- * @return Reflective in closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param c Collection of elements.
+ * @return Sum of all elements.
*/
- public static <T> IgniteInClosure<T> ciInvoke(final String mtdName, final Object... args) {
- A.notNull(mtdName, "mtdName");
-
- return new CI1<T>() {
- private Method mtd;
+ public static int sumInt(Iterable<Integer> c) {
+ A.notNull(c, "c");
- @Override public void apply(T t) {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(t.getClass(), mtdName, args);
+ int sum = 0;
- mtd.setAccessible(true);
- }
+ for (int t : c)
+ sum += t;
- mtd.invoke(t, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
- }
- };
+ return sum;
}
/**
- * Creates out closure that will reflectively call a method with the given name on provided
- * object and return result of that call.
- * <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteOutClosure} which is {@link CO}.
+ * Gets reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
+ * method and passed in {@code element} from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
*
- * @param o Target object to call the method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <R> Type of closure return value.
- * @return Reflective out closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+ * @param <T> Reducer element type.
+ * @return Passed in element.
*/
- public static <R> IgniteOutClosure<R> coInvoke(final Object o, final String mtdName, final Object... args) {
- A.notNull(o, "o", mtdName, "mtdName");
-
- return new CO<R>() {
- private Method mtd;
-
- @SuppressWarnings("unchecked")
- @Override public R apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(o.getClass(), mtdName, args);
-
- mtd.setAccessible(true);
- }
+ public static <T> IgniteReducer<T, T> identityReducer(final T elem) {
+ return new R1<T, T>() {
+ @Override public boolean collect(T e) {
+ return true;
+ }
- return (R)mtd.invoke(o, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
+ @Override public T reduce() {
+ return elem;
}
};
}
/**
- * Creates absolute closure that will reflectively call a method with the given name on provided object.
+ * Gets reducer closure that calculates sum of integer elements.
* <p>
- * Method reflects the typedef for {@link GridAbsClosure} which is {@link CA}.
+ * <img src="{@docRoot}/img/sum.png">
*
- * @param o Target object to call the method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @return Reflective absolute closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @return Reducer that calculates sum of integer elements.
*/
- public static GridAbsClosure caInvoke(final Object o, final String mtdName, @Nullable final Object... args) {
- A.notNull(o, "o", mtdName, "mtdName");
-
- return new CA() {
- /** */
- private Method mtd;
+ public static IgniteReducer<Integer, Integer> sumIntReducer() {
+ return new R1<Integer, Integer>() {
+ private AtomicInteger sum = new AtomicInteger(0);
- @SuppressWarnings("unchecked")
- @Override public void apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(o.getClass(), mtdName, args);
+ @Override public boolean collect(Integer e) {
+ if (e != null)
+ sum.addAndGet(e);
- mtd.setAccessible(true);
- }
+ return true;
+ }
- mtd.invoke(o, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
+ @Override public Integer reduce() {
+ return sum.get();
}
};
}
/**
- * Creates out closure that will reflectively call a static method with the given name
- * and return result of that call.
+ * Gets reducer closure that calculates sum of long integer elements.
* <p>
- * Method reflects the typedef for {@link org.apache.ignite.lang.IgniteOutClosure} which is {@link CO}.
+ * <img src="{@docRoot}/img/sum.png">
*
- * @param cls Class to call a static method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @param <R> Type of closure return value.
- * @return Reflective out closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @return Reducer that calculates sum of long integer elements.
*/
- public static <R> IgniteOutClosure<R> coInvoke(final Class<?> cls, final String mtdName,
- @Nullable final Object... args) {
- A.notNull(cls, "cls", mtdName, "mtdName");
-
- return new CO<R>() {
- /** */
- private Method mtd;
+ public static IgniteReducer<Long, Long> sumLongReducer() {
+ return new R1<Long, Long>() {
+ private AtomicLong sum = new AtomicLong(0);
- @SuppressWarnings("unchecked")
- @Override public R apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(cls, mtdName, args);
+ @Override public boolean collect(Long e) {
+ if (e != null)
+ sum.addAndGet(e);
- mtd.setAccessible(true);
- }
+ return true;
+ }
- return (R)mtd.invoke(null, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
+ @Override public Long reduce() {
+ return sum.get();
}
};
}
/**
- * Creates absolute closure that will reflectively call a static method with the given name.
- * <p>
- * Method reflects the typedef for {@link GridAbsClosure} which is {@link CA}.
+ * Creates a range list containing numbers in given range.
*
- * @param cls Class to call a static method on.
- * @param mtdName Method name.
- * @param args Optional set of arguments for the method call.
- * @return Reflective absolute closure.
- * @throws GridClosureException Thrown in case of any reflective invocation errors.
+ * @param fromIncl Inclusive start of the range.
+ * @param toExcl Exclusive stop of the range.
+ * @return List containing numbers in range.
*/
- public static GridAbsClosure caInvoke(final Class<?> cls, final String mtdName, @Nullable final Object... args) {
- A.notNull(cls, "cls", mtdName, "mtdName");
+ public static List<Integer> range(int fromIncl, int toExcl) {
+ A.ensure(fromIncl >= 0, "fromIncl >= 0");
+ A.ensure(toExcl >= 0, "toExcl >= 0");
+ A.ensure(toExcl >= fromIncl, "toExcl > fromIncl");
- return new CA() {
- /** */
- private Method mtd;
+ if (toExcl == fromIncl)
+ return Collections.emptyList();
- @SuppressWarnings("unchecked")
- @Override public void apply() {
- try {
- // No synchronization allows for double creation - ignoring...
- if (mtd == null) {
- mtd = method(cls, mtdName, args);
+ List<Integer> list = new ArrayList<>(toExcl - fromIncl);
- mtd.setAccessible(true);
- }
+ for (int i = fromIncl; i < toExcl; i++)
+ list.add(i);
- mtd.invoke(null, args);
- }
- catch (Exception e) {
- throw wrap(e);
- }
- }
- };
+ return list;
}
/**
- * Looks up the method with given parameters.
+ * Gets reducer closure that concatenates strings using provided delimiter.
*
- * @param cls Class to look up in.
- * @param mtdName Method name to look up.
- * @param args Optional set of method parameters.
- * @return Method instance.
- * @throws Exception Thrown in case of any reflective errors.
+ * @param delim Delimiter (optional).
+ * @return Reducer that concatenates strings using provided delimeter.
*/
- private static Method method(Class<?> cls, String mtdName, @Nullable Object... args) throws Exception {
- assert cls != null;
- assert mtdName != null;
-
- int cnt = 0;
-
- Method m = null;
-
- for (Method mtd : cls.getDeclaredMethods())
- if (mtd.getName().equals(mtdName)) {
- cnt++;
-
- m = mtd;
- }
+ public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
+ return new R1<String, String>() {
+ private SB sb = new SB();
- if (cnt == 0)
- throw new NoSuchMethodException(cls.getName() + '#' + mtdName);
+ private boolean first = true;
- // If there is only one method with provided name we
- // don't use lookup that requires parameters' types since
- // it is a lot more complex to deal with type inheritance there.
- if (cnt == 1)
- return m;
+ private final Object lock = new Object();
- if (!isEmpty(args)) {
- assert args != null;
+ @Override public boolean collect(String s) {
+ synchronized (lock) {
+ if (!first && !isEmpty(delim))
+ sb.a(delim);
- Class<?>[] types = new Class[args.length];
+ sb.a(s);
- int i = 0;
+ first = false;
+ }
- for (Object arg : args) {
- // This is not going to work in cases when method expects
- // an interface or supertype. Accept this limitation for now...
- types[i++] = arg.getClass();
+ return true;
}
- return cls.getDeclaredMethod(mtdName, types);
- }
- else
- return cls.getDeclaredMethod(mtdName);
+ @Override public String reduce() {
+ synchronized (lock) {
+ return sb.toString();
+ }
+ }
+ };
}
/**
- * Gets closure that converts object to its runtime class.
+ * Concatenates strings using provided delimiter.
*
- * @return Closure that converts object to its runtime class.
- */
- public static IgniteClosure<Object, Class<?>> clazz() {
- return CLAZZ;
- }
-
- /**
- * Creates new collection by removing duplicates from the given collection.
- *
- * @param c Collection to remove duplicates from.
- * @param <T> Type of the collection.
- * @return De-duped collection.
+ * @param c Input collection.
+ * @param delim Delimiter (optional).
+ * @return Concatenated string.
*/
- public static <T> Collection<T> dedup(Collection<? extends T> c) {
+ public static String concat(Iterable<String> c, @Nullable String delim) {
A.notNull(c, "c");
- Collection<T> set = new GridLeanSet<>();
-
- set.addAll(c);
-
- return set;
+ return reduce(c, concatReducer(delim));
}
/**
- * Calculates sum of all elements.
+ * Gets collections of data items from grid job res casted to specified type.
* <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @param c Collection of elements.
- * @return Sum of all elements.
- */
- public static int sumInt(Iterable<Integer> c) {
- A.notNull(c, "c");
-
- int sum = 0;
-
- for (int t : c) {
- sum += t;
- }
-
- return sum;
- }
-
- /**
- * Calculates sum of all elements.
+ * Here's the typical example of how this method is used in {@code reduce()} method
+ * implementation (this example sums up all the values of {@code Integer} type):
+ * <pre name="code" class="java">
+ * public Integer reduce(List<GridComputeJobResult> res) throws IgniteCheckedException {
+ * return F.sum(F.<Integer>jobResults(res));
+ * }
+ * </pre>
* <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Note that this method doesn't create a new collection but simply iterates over the input one.
*
- * @param c Collection of elements.
- * @return Sum of all elements.
+ * @param res Collection of grid job res.
+ * @param <T> Type of the data item to cast to. See {@link org.apache.ignite.compute.ComputeJobResult#getData()} method.
+ * @return Collections of data items casted to type {@code T}.
+ * @see org.apache.ignite.compute.ComputeJobResult#getData()
*/
- public static double sumDouble(Iterable<Double> c) {
- A.notNull(c, "c");
+ public static <T> Collection<T> jobResults(@Nullable Collection<? extends ComputeJobResult> res) {
+ if (isEmpty(res))
+ return Collections.emptyList();
- double sum = 0;
+ assert res != null;
- for (double t : c) {
- sum += t;
- }
+ Collection<T> c = new ArrayList<>(res.size());
- return sum;
+ for (ComputeJobResult r : res)
+ c.add(r.<T>getData());
+
+ return c;
}
/**
- * Calculates sum of all elements.
+ * Convenient utility method that returns collection of node IDs for a given
+ * collection of grid nodes.
* <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Note that this method doesn't create a new collection but simply iterates
+ * over the input one.
*
- * @param c Collection of elements.
- * @return Sum of all elements.
+ * @param nodes Collection of grid nodes.
+ * @return Collection of node IDs for given collection of grid nodes.
*/
- public static BigDecimal sumBigDecimal(Iterable<BigDecimal> c) {
- A.notNull(c, "c");
-
- BigDecimal sum = BigDecimal.ZERO;
-
- for (BigDecimal t : c) {
- sum = sum.add(t);
- }
+ public static Collection<UUID> nodeIds(@Nullable Collection<? extends ClusterNode> nodes) {
+ if (nodes == null || nodes.isEmpty())
+ return Collections.emptyList();
- return sum;
+ return F.viewReadOnly(nodes, node2id());
}
/**
- * Calculates sum of all elements.
+ * Convenient utility method that returns collection of node ID8s for a given
+ * collection of grid nodes. ID8 is a shorter string representation of node ID,
+ * mainly the first 8 characters.
* <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Note that this method doesn't create a new collection but simply iterates
+ * over the input one.
*
- * @param c Collection of elements.
- * @return Sum of all elements.
+ * @param nodes Collection of grid nodes.
+ * @return Collection of node IDs for given collection of grid nodes.
*/
- public static BigInteger sumBigInt(Iterable<BigInteger> c) {
- A.notNull(c, "c");
-
- BigInteger sum = BigInteger.ZERO;
-
- for (BigInteger t : c) {
- sum = sum.add(t);
- }
+ public static Collection<String> nodeId8s(@Nullable Collection<? extends ClusterNode> nodes) {
+ if (nodes == null || nodes.isEmpty())
+ return Collections.emptyList();
- return sum;
+ return F.viewReadOnly(nodes, NODE2ID8);
}
/**
- * Calculates arithmetic mean.
+ * Convenient utility method that returns collection of node ID8s for a given
+ * collection of node IDs. ID8 is a shorter string representation of node ID,
+ * mainly the first 8 characters.
* <p>
- * <img src="{@docRoot}/img/avg.png">
+ * Note that this method doesn't create a new collection but simply iterates
+ * over the input one.
*
- * @param c Input collection.
- * @return Arithmetic mean of the input collection.
+ * @param ids Collection of nodeIds.
+ * @return Collection of node IDs for given collection of grid nodes.
*/
- public static double avg(Iterable<? extends Number> c) {
- A.notNull(c, "c");
-
- double sum = 0;
-
- int i = 0;
-
- for (Number t : c) {
- sum += t.doubleValue();
-
- i++;
- }
+ public static Collection<String> id8s(@Nullable Collection<UUID> ids) {
+ if (ids == null || ids.isEmpty())
+ return Collections.emptyList();
- return sum / i;
+ return F.viewReadOnly(ids, ID2ID8);
}
/**
- * Gets reducer closure that calculates arithmetic mean.
- * <p>
- * <img src="{@docRoot}/img/avg.png">
+ * Creates absolute closure that does <tt>System.out.println(msg)</tt>.
*
- * @return Reducer closure that calculated arithmetic mean.
+ * @param msg Message to print.
+ * @return Absolute closure that print message.
*/
- public static <T extends Number> IgniteReducer<T, Double> avgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
-
- private final Object lock = new Object();
-
- @Override public boolean collect(T e) {
- if (e != null)
- synchronized (lock) {
- sum += e.doubleValue();
- i++;
- }
-
- return true;
- }
-
- @Override public Double reduce() {
- synchronized (lock) {
- return sum / i;
- }
+ public static GridAbsClosure println(final String msg) {
+ return new CA() {
+ @Override public void apply() {
+ System.out.println(msg);
}
};
}
/**
- * Calculates quadratic mean.
- * <p>
- * <img src="{@docRoot}/img/qavg.png">
+ * Gets random value from given collection.
*
- * @param c Input collection.
- * @return Quadratic mean of the input collection.
+ * @param c Input collection (no {@code null} and not emtpy).
+ * @param <T> Type of the collection.
+ * @return Random value from the input collection.
*/
- public static double qavg(Iterable<? extends Number> c) {
+ @SuppressWarnings("UnusedDeclaration")
+ public static <T> T rand(Collection<? extends T> c) {
A.notNull(c, "c");
- double sum = 0;
+ int n = ThreadLocalRandom8.current().nextInt(c.size());
int i = 0;
- for (Number t : c) {
- double d = t.doubleValue();
-
- sum += d * d;
-
- i++;
+ for (T t : c) {
+ if (i++ == n)
+ return t;
}
- return Math.sqrt(sum / i);
+ throw new ConcurrentModificationException();
}
/**
- * Gets reducer closure that calculates quadratic mean.
- * <p>
- * <img src="{@docRoot}/img/qavg.png">
+ * Gets random value from given list. For random-access lists this
+ * operation is O(1), otherwise O(n).
*
- * @return Reducer closure that calculated quadratic mean.
+ * @param l Input collection.
+ * @param <T> Type of the list elements.
+ * @return Random value from the input list.
*/
- public static <T extends Number> IgniteReducer<T, Double> qavgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
-
- private final Object lock = new Object();
-
- @Override public boolean collect(T e) {
- if (e != null) {
- double d = e.doubleValue();
-
- synchronized (lock) {
- sum += d * d;
-
- i++;
- }
- }
-
- return true;
- }
+ public static <T> T rand(List<T> l) {
+ A.notNull(l, "l");
- @Override public Double reduce() {
- synchronized (lock) {
- return Math.sqrt(sum / i);
- }
- }
- };
+ return l.get(ThreadLocalRandom8.current().nextInt(l.size()));
}
/**
- * Calculates geometric mean.
- * <p>
- * <img src="{@docRoot}/img/gavg.png">
+ * Gets random value from given array. This operation
+ * does not iterate through array elements and returns immediately.
*
* @param c Input collection.
- * @return Geometric mean of the input collection.
+ * @param <T> Type of the collection.
+ * @return Random value from the input collection.
*/
- public static double gavg(Iterable<? extends Number> c) {
+ public static <T> T rand(T... c) {
A.notNull(c, "c");
- double sum = 0;
-
- int i = 0;
-
- for (Number t : c) {
- sum *= t.doubleValue();
-
- i++;
- }
-
- return Math.pow(sum, 1f / i);
+ return c[ThreadLocalRandom8.current().nextInt(c.length)];
}
/**
- * Gets reducer closure that calculates geometric mean.
- * <p>
- * <img src="{@docRoot}/img/gavg.png">
+ * Concatenates an element to a collection. If {@code copy} flag is {@code true}, then
+ * a new collection will be created and the element and passed in collection will be
+ * copied into the new one. The returned collection will be modifiable. If {@code copy}
+ * flag is {@code false}, then a read-only view will be created over the element and given
+ * collections and no copying will happen.
*
- * @return Reducer closure that calculated geometric mean.
+ * @param cp Copy flag.
+ * @param t First element.
+ * @param c Second collection.
+ * @param <T> Element type.
+ * @return Concatenated collection.
*/
- public static <T extends Number> IgniteReducer<T, Double> gavgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
+ public static <T> Collection<T> concat(boolean cp, @Nullable final T t, @Nullable final Collection<T> c) {
+ if (cp) {
+ if (isEmpty(c)) {
+ Collection<T> l = new ArrayList<>(1);
- private final Object lock = new Object();
+ l.add(t);
- @Override public boolean collect(T e) {
- if (e != null)
- synchronized (lock) {
- sum *= e.doubleValue();
+ return l;
+ }
- i++;
- }
+ assert c != null;
- return true;
- }
+ Collection<T> ret = new ArrayList<>(c.size() + 1);
- @Override public Double reduce() {
- synchronized (lock) {
- return Math.pow(sum, 1f / i);
- }
- }
- };
- }
+ ret.add(t);
+ ret.addAll(c);
- /**
- * Calculates weighted mean.
- * <p>
- * <img src="{@docRoot}/img/wavg.png">
- *
- * @param c Collection of elements.
- * @param w Collection of weights.
- * @return Weighted mean of the input collection.
- */
- public static double wavg(Collection<? extends Number> c, Collection<? extends Number> w) {
- A.notNull(c, "c", w, "w");
- A.ensure(c.size() == w.size(), "c.size() == w.size()");
+ return ret;
+ }
+ else {
+ if (isEmpty(c))
+ return Collections.singletonList(t);
- double sumC = 0;
- double sumW = 0;
+ assert c != null;
- Iterator<? extends Number> iterC = c.iterator();
- Iterator<? extends Number> iterW = w.iterator();
+ return new GridSerializableCollection<T>() {
+ @NotNull
+ @Override public Iterator<T> iterator() {
+ return new GridSerializableIterator<T>() {
+ private Iterator<T> it;
- while (iterC.hasNext()) {
- assert iterW.hasNext();
+ @Override public boolean hasNext() {
+ return it == null || it.hasNext();
+ }
- double dc = iterC.next().doubleValue();
- double dw = iterW.next().doubleValue();
+ @Nullable @Override public T next() {
+ if (it == null) {
+ it = c.iterator();
- sumW += dw;
- sumC += dw * dc;
- }
+ return t;
+ }
- return sumC / sumW;
- }
+ return it.next();
+ }
- /**
- * Calculates harmonic mean.
- * <p>
- * <img src="{@docRoot}/img/havg.png">
+ @Override public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ @Override public int size() {
+ return c.size() + 1;
+ }
+
+ @Override public boolean equals(Object obj) {
+ return obj instanceof Collection && eqNotOrdered(this, (Collection)obj);
+ }
+ };
+ }
+ }
+
+ /**
+ * Concatenates 2 collections into one. If {@code copy} flag is {@code true}, then
+ * a new collection will be created and these collections will be copied into the
+ * new one. The returned collection will be modifiable. If {@code copy} flag is
+ * {@code false}, then a read-only view will be created over given collections
+ * and no copying will happen.
*
- * @param c Input collection.
- * @return Harmonic mean of the input collection.
+ * @param cp Copy flag.
+ * @param c1 First collection.
+ * @param c2 Second collection.
+ * @param <T> Element type.
+ * @return Concatenated {@code non-null} collection.
*/
- public static double havg(Iterable<? extends Number> c) {
- A.notNull(c, "c");
+ public static <T> Collection<T> concat(boolean cp, @Nullable final Collection<T> c1,
+ @Nullable final Collection<T> c2) {
+ if (cp) {
+ if (isEmpty(c1) && isEmpty(c2))
+ return new ArrayList<>(0);
- double sum = 0;
+ if (isEmpty(c1))
+ return new ArrayList<>(c2);
- int i = 0;
+ if (isEmpty(c2))
+ return new ArrayList<>(c1);
- for (Number t : c) {
+ Collection<T> c = new ArrayList<>(c1.size() + c2.size());
- sum += 1 / t.doubleValue();
+ c.addAll(c1);
+ c.addAll(c2);
- i++;
+ return c;
}
+ else {
+ if (isEmpty(c1) && isEmpty(c2))
+ return Collections.emptyList();
- return i / sum;
- }
-
- /**
- * Gets reducer closure that collects only a single value and returns it
- * without any transformations.
- *
- * @return Reducer closure that collects and returns single value.
- */
- public static <T> IgniteReducer<T, T> singleReducer() {
- return new R1<T, T>() {
- private T obj;
+ if (isEmpty(c1) || isEmpty(c2)) {
+ Collection<T> c = isEmpty(c1) ? c2 : c1;
- @Override public boolean collect(T e) {
- // No synchronization needed here.
- obj = e;
+ assert c != null;
- return false;
+ return c;
}
- @Override public T reduce() {
- return obj;
- }
- };
+ return new GridSerializableCollection<T>() {
+ @NotNull
+ @Override public Iterator<T> iterator() {
+ return new GridSerializableIterator<T>() {
+ private Iterator<T> it1 = c1.iterator();
+ private Iterator<T> it2 = c2.iterator();
+
+ @Override public boolean hasNext() {
+ if (it1 != null)
+ if (!it1.hasNext())
+ it1 = null;
+ else
+ return true;
+
+ return it2.hasNext();
+ }
+
+ @Override public T next() {
+ return it1 != null ? it1.next() : it2.next();
+ }
+
+ @Override public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ @Override public boolean contains(Object o) {
+ return c1.contains(o) || c2.contains(o);
+ }
+
+ @Override public int size() {
+ return c1.size() + c2.size();
+ }
+
+ @Override public boolean equals(Object obj) {
+ return obj instanceof Collection && eqNotOrdered(this, (Collection<?>)obj);
+ }
+ };
+ }
}
/**
- * Gets reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
- * method and passed in {@code element} from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+ * Concatenates an elements to an array.
*
- * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
- * @param <T> Reducer element type.
- * @param <R> Return element type.
- * @return Passed in element.
+ * @param arr Array.
+ * @param obj One or more elements.
+ * @return Concatenated array.
*/
- public static <T, R> IgniteReducer<T, R> continuousReducer(final R elem) {
- return new R1<T, R>() {
- @Override public boolean collect(T e) {
- return true;
- }
+ public static <T> T[] concat(@Nullable T[] arr, T... obj) {
+ T[] newArr;
- @Override public R reduce() {
- return elem;
- }
- };
+ if (arr == null || arr.length == 0)
+ newArr = obj;
+ else {
+ newArr = Arrays.copyOf(arr, arr.length + obj.length);
+
+ System.arraycopy(obj, 0, newArr, arr.length, obj.length);
+ }
+
+ return newArr;
}
/**
- * Gets reducer which always returns {@code true} from {@link org.apache.ignite.lang.IgniteReducer#collect(Object)}
- * method and passed in {@code element} from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
+ * Concatenates multiple iterators as single one.
*
- * @param elem Element to return from {@link org.apache.ignite.lang.IgniteReducer#reduce()} method.
- * @param <T> Reducer element type.
- * @return Passed in element.
+ * @param iters Iterators.
+ * @return Single iterator.
*/
- public static <T> IgniteReducer<T, T> identityReducer(final T elem) {
- return new R1<T, T>() {
- @Override public boolean collect(T e) {
- return true;
- }
+ @SuppressWarnings("unchecked")
+ public static <T> Iterator<T> concat(Iterator<T> ... iters) {
+ if (iters.length == 1)
+ return iters[0];
- @Override public T reduce() {
- return elem;
- }
- };
+ return concat(asList(iters).iterator());
}
/**
- * Gets reducer closure that calculates harmonic mean.
- * <p>
- * <img src="{@docRoot}/img/havg.png">
+ * Concatenates multiple iterators as single one.
*
- * @return Reducer closure that calculated harmonic mean.
+ * @param iters Iterator over iterators.
+ * @return Single iterator.
*/
- public static <T extends Number> IgniteReducer<T, Double> havgReducer() {
- return new R1<T, Double>() {
- private double sum;
- private int i;
+ @SuppressWarnings("unchecked")
+ public static <T> Iterator<T> concat(final Iterator<Iterator<T>> iters) {
+ if (!iters.hasNext())
+ return Collections.<T>emptySet().iterator();
- private final Object lock = new Object();
+ return new Iterator<T>() {
+ private Iterator<T> it = iters.next();
- @Override public boolean collect(T e) {
- if (e != null)
- synchronized (lock) {
- sum += 1 / e.doubleValue();
+ private Iterator<T> last;
- i++;
- }
+ private T next;
- return true;
+ {
+ advance();
}
- @Override public Double reduce() {
- synchronized (lock) {
- return i / sum;
- }
- }
- };
- }
+ private void advance() {
+ for (;;) {
+ if (it.hasNext()) {
+ next = it.next();
- /**
- * Gets reducer closure that calculates sum of integer elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @return Reducer that calculates sum of integer elements.
- */
- public static IgniteReducer<Integer, Integer> sumIntReducer() {
- return new R1<Integer, Integer>() {
- private AtomicInteger sum = new AtomicInteger(0);
+ assert next != null;
- @Override public boolean collect(Integer e) {
- if (e != null)
- sum.addAndGet(e);
+ return;
+ }
- return true;
- }
+ if (!iters.hasNext())
+ return;
- @Override public Integer reduce() {
- return sum.get();
+ it = iters.next();
+ }
}
- };
- }
-
- /**
- * Gets reducer closure that calculates sum of long integer elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @return Reducer that calculates sum of long integer elements.
- */
- public static IgniteReducer<Long, Long> sumLongReducer() {
- return new R1<Long, Long>() {
- private AtomicLong sum = new AtomicLong(0);
- @Override public boolean collect(Long e) {
- if (e != null)
- sum.addAndGet(e);
-
- return true;
+ @Override public boolean hasNext() {
+ return next != null;
}
- @Override public Long reduce() {
- return sum.get();
- }
- };
- }
+ @Override public T next() {
+ T res = next;
- /**
- * Gets reducer closure that calculates sum of all elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
- *
- * @return Reducer that calculates sum of all elements.
- */
- @SuppressWarnings("unchecked")
- public static IgniteReducer<Double, Double> sumDoubleReducer() {
- return new R1<Double, Double>() {
- private double sum;
+ if (res == null)
+ throw new NoSuchElementException();
- private final Object lock = new Object();
+ next = null;
- @Override public boolean collect(Double e) {
- if (e != null)
- synchronized (lock) {
- sum += e;
- }
+ last = it;
- return true;
+ advance();
+
+ return res;
}
- @Override public Double reduce() {
- synchronized (lock) {
- return sum;
- }
+ @Override public void remove() {
+ if (last == null)
+ throw new IllegalStateException();
+
+ last.remove();
}
};
}
/**
- * Creates a range list containing numbers in given range.
+ * Loses all elements in input collection that are contained in {@code filter} collection.
*
- * @param fromIncl Inclusive start of the range.
- * @param toExcl Exclusive stop of the range.
- * @return List containing numbers in range.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates new collection not modifying input,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param filter Filter collection. If {@code filter} collection is empty or
+ * {@code null} - no elements are lost.
+ * @param <T> Type of collections.
+ * @return Collection of remaining elements
*/
- public static List<Integer> range(int fromIncl, int toExcl) {
- A.ensure(fromIncl >= 0, "fromIncl >= 0");
- A.ensure(toExcl >= 0, "toExcl >= 0");
- A.ensure(toExcl >= fromIncl, "toExcl > fromIncl");
-
- if (toExcl == fromIncl)
- return Collections.emptyList();
-
- List<Integer> list = new ArrayList<>(toExcl - fromIncl);
-
- for (int i = fromIncl; i < toExcl; i++)
- list.add(i);
+ public static <T0, T extends T0> Collection<T> lose(Collection<T> c, boolean cp,
+ @Nullable Collection<T0> filter) {
+ A.notNull(c, "c");
- return list;
+ return lose(c, cp, F0.in(filter));
}
/**
- * Gets reducer closure that calculates sum of all elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Loses all elements in input collection that are evaluated to {@code true} by
+ * all given predicates.
*
- * @return Reducer that calculates sum of all elements.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates new collection without modifying the input one,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param p Predicates to filter by. If no predicates provided - no elements are lost.
+ * @param <T> Type of collections.
+ * @return Collection of remaining elements.
*/
- @SuppressWarnings("unchecked")
- public static IgniteReducer<BigDecimal, BigDecimal> sumBigDecimalReducer() {
- return new R1<BigDecimal, BigDecimal>() {
- private BigDecimal sum = BigDecimal.ZERO;
+ public static <T> Collection<T> lose(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
+ A.notNull(c, "c");
- private final Object lock = new Object();
+ Collection<T> res;
- @Override public boolean collect(BigDecimal e) {
- if (e != null)
- synchronized (lock) {
- sum = sum.add(e);
- }
+ if (!cp) {
+ res = c;
- return true;
- }
+ if (isEmpty(p))
+ res.clear();
+ else if (!isAlwaysFalse(p))
+ for (Iterator<T> iter = res.iterator(); iter.hasNext();)
+ if (isAll(iter.next(), p))
+ iter.remove();
+ }
+ else {
+ res = new LinkedList<>();
- @Override public BigDecimal reduce() {
- synchronized (lock) {
- return sum;
- }
- }
- };
+ if (!isEmpty(p) && !isAlwaysTrue(p))
+ for (T t : c)
+ if (!isAll(t, p))
+ res.add(t);
+ }
+
+ return res;
}
/**
- * Gets reducer closure that calculates sum of all elements.
- * <p>
- * <img src="{@docRoot}/img/sum.png">
+ * Loses all entries in input map that are evaluated to {@code true} by all given predicates.
*
- * @return Reducer that calculates sum of all elements.
+ * @param m Map to filter.
+ * @param cp If {@code true} method creates new map not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Optional set of predicates to use for filtration. If none provided - original map
+ * will (or its copy) be returned.
+ * @param <K> Type of the free variable for the predicate and type of map's keys.
+ * @param <V> Type of the free variable for the predicate and type of map's values.
+ * @return Filtered map.
*/
- @SuppressWarnings("unchecked")
- public static IgniteReducer<BigInteger, BigInteger> sumBigIntegerReducer() {
- return new R1<BigInteger, BigInteger>() {
- private BigInteger sum = BigInteger.ZERO;
+ @SuppressWarnings({"unchecked"})
+ public static <K, V> Map<K, V> lose(Map<K, V> m, boolean cp,
+ @Nullable IgnitePredicate<? super Map.Entry<K, V>>... p) {
+ A.notNull(m, "m");
- private final Object lock = new Object();
+ Map<K, V> res;
- @Override public boolean collect(BigInteger e) {
- if (e != null)
- synchronized (lock) {
- sum = sum.add(e);
- }
+ if (!cp) {
+ res = m;
- return true;
- }
+ if (isEmpty(p))
+ res.clear();
+ else if (!isAlwaysFalse(p))
+ for (Iterator<Map.Entry<K, V>> iter = m.entrySet().iterator(); iter.hasNext();)
+ if (isAll(iter.next(), p))
+ iter.remove();
+ }
+ else {
+ res = U.newHashMap(m.size());
- @Override public BigInteger reduce() {
- synchronized (lock) {
- return sum;
- }
- }
- };
+ if (!isEmpty(p) && !isAlwaysTrue(p))
+ for (Map.Entry<K, V> e : m.entrySet())
+ if (!F.isAll(e, p))
+ res.put(e.getKey(), e.getValue());
+ }
+
+ return res;
}
/**
- * Gets reducer closure that concatenates strings using provided delimiter.
+ * Loses all entries in input map which keys are evaluated to {@code true} by all
+ * given predicates.
*
- * @param delim Delimiter (optional).
- * @return Reducer that concatenates strings using provided delimeter.
+ * @param m Map to filter.
+ * @param cp If {@code true} method creates new map not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Optional set of predicates to use for filtration. If none provided - original
+ * map (or its copy) will be returned.
+ * @param <K> Type of the free variable for the predicate and type of map's keys.
+ * @param <V> Type of map's values.
+ * @return Filtered map.
*/
- public static IgniteReducer<String, String> concatReducer(@Nullable final String delim) {
- return new R1<String, String>() {
- private SB sb = new SB();
-
- private boolean first = true;
-
- private final Object lock = new Object();
-
- @Override public boolean collect(String s) {
- synchronized (lock) {
- if (!first && !isEmpty(delim))
- sb.a(delim);
-
- sb.a(s);
-
- first = false;
- }
-
- return true;
- }
-
- @Override public String reduce() {
- synchronized (lock) {
- return sb.toString();
- }
+ public static <K, V> Map<K, V> loseKeys(
+ Map<K, V> m,
+ boolean cp,
+ @Nullable final IgnitePredicate<? super K>... p
+ ) {
+ return lose(m, cp, new P1<Map.Entry<K, V>>() {
+ @Override public boolean apply(Map.Entry<K, V> e) {
+ return isAll(e.getKey(), p);
}
- };
+ });
}
/**
- * Concatenates strings using provided delimiter.
+ * Loses all entries in input map which values are evaluated to {@code true} by all
+ * given predicates.
*
- * @param c Input collection.
- * @param delim Delimiter (optional).
- * @return Concatenated string.
+ * @param m Map to filter.
+ * @param cp If {@code true} method creates new map not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Optional set of predicates to use for filtration. If none provided - original
+ * map (or its copy) will be returned.
+ * @param <K> Type of the free variable for the predicate and type of map's keys.
+ * @param <V> Type of map's values.
+ * @return Filtered map.
*/
- public static String concat(Iterable<String> c, @Nullable String delim) {
- A.notNull(c, "c");
-
- return reduce(c, concatReducer(delim));
+ public static <K, V> Map<K, V> loseValues(Map<K, V> m, boolean cp,
+ @Nullable final IgnitePredicate<? super V>... p) {
+ return lose(m, cp, new P1<Map.Entry<K, V>>() {
+ @Override public boolean apply(Map.Entry<K, V> e) {
+ return isAll(e.getValue(), p);
+ }
+ });
}
/**
- * Gets collections of data items from grid job res casted to specified type.
- * <p>
- * Here's the typical example of how this method is used in {@code reduce()} method
- * implementation (this example sums up all the values of {@code Integer} type):
- * <pre name="code" class="java">
- * public Integer reduce(List<GridComputeJobResult> res) throws IgniteCheckedException {
- * return F.sum(F.<Integer>jobResults(res));
- * }
- * </pre>
- * <p>
- * Note that this method doesn't create a new collection but simply iterates over the input one.
+ * Loses all elements in input list that are contained in {@code filter} collection.
*
- * @param res Collection of grid job res.
- * @param <T> Type of the data item to cast to. See {@link org.apache.ignite.compute.ComputeJobResult#getData()} method.
- * @return Collections of data items casted to type {@code T}.
- * @see org.apache.ignite.compute.ComputeJobResult#getData()
+ * @param c Input list.
+ * @param cp If {@code true} method creates new list not modifying input,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param filter Filter collection. If {@code filter} collection is empty or
+ * {@code null} - no elements are lost.
+ * @param <T> Type of list.
+ * @return List of remaining elements
*/
- public static <T> Collection<T> jobResults(@Nullable Collection<? extends ComputeJobResult> res) {
- if (isEmpty(res))
- return Collections.emptyList();
+ public static <T> List<T> loseList(List<T> c, boolean cp, @Nullable Collection<? super T> filter) {
+ A.notNull(c, "c");
- assert res != null;
+ List<T> res;
- Collection<T> c = new ArrayList<>(res.size());
+ if (!cp) {
+ res = c;
- for (ComputeJobResult r : res)
- c.add(r.<T>getData());
+ if (filter != null)
+ res.removeAll(filter);
+ }
+ else {
+ res = new LinkedList<>();
- return c;
+ for (T t : c) {
+ if (filter == null || !filter.contains(t))
+ res.add(t);
+ }
+ }
+
+ return res;
}
/**
- * Convenient utility method that returns collection of node IDs for a given
- * collection of grid nodes.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates
- * over the input one.
+ * Loses all elements in input list for which any of the predicates evaluate to {@code true}.
*
- * @param nodes Collection of grid nodes.
- * @return Collection of node IDs for given collection of grid nodes.
+ * @param c Input list.
+ * @param cp If {@code true} method creates new list not modifying input,
+ * otherwise does <tt>in-place</tt> modifications.
+ * @param p Looses all elements for which any of the predicates evaluate to {@code true}.
+ * @param <T> Type of list.
+ * @return List of remaining elements
*/
- public static Collection<UUID> nodeIds(@Nullable Collection<? extends ClusterNode> nodes) {
- if (nodes == null || nodes.isEmpty())
- return Collections.emptyList();
+ public static <T> List<T> filterList(List<T> c, boolean cp, @Nullable IgnitePredicate<T>... p) {
+ A.notNull(c, "c");
- return F.viewReadOnly(nodes, node2id());
- }
+ List<T> res;
- /**
- * Convenient utility method that returns collection of node ID8s for a given
- * collection of grid nodes. ID8 is a shorter string representation of node ID,
- * mainly the first 8 characters.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates
- * over the input one.
- *
- * @param nodes Collection of grid nodes.
- * @return Collection of node IDs for given collection of grid nodes.
- */
- public static Collection<String> nodeId8s(@Nullable Collection<? extends ClusterNode> nodes) {
- if (nodes == null || nodes.isEmpty())
- return Collections.emptyList();
+ if (!cp) {
+ res = c;
- return F.viewReadOnly(nodes, node2id8());
- }
+ if (p != null)
+ for (Iterator<T> it = c.iterator(); it.hasNext();)
+ if (isAny(it.next(), p))
+ it.remove();
+ }
+ else {
+ res = new ArrayList<>(c.size());
- /**
- * Convenient utility method that returns collection of node ID8s for a given
- * collection of node IDs. ID8 is a shorter string representation of node ID,
- * mainly the first 8 characters.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates
- * over the input one.
- *
- * @param ids Collection of nodeIds.
- * @return Collection of node IDs for given collection of grid nodes.
- */
- public static Collection<String> id8s(@Nullable Collection<UUID> ids) {
- if (ids == null || ids.isEmpty())
- return Collections.emptyList();
+ for (T t : c)
+ if (!isAny(t, p))
+ res.add(t);
+ }
- return F.viewReadOnly(ids, id2id8());
+ return res;
}
/**
- * Convenient utility method that returns collection of node attributes for a given
- * collection of grid nodes.
- * <p>
- * Note that this method doesn't create a new collection but simply iterates over the input one.
+ * Gets closure which converts node to node ID.
*
- * @param nodes Collection of grid nodes.
- * @param attr Name of the attribute to return from each node.
- * @param <T> Type of the attribute.
- * @return Collection of node attributes for given collection of grid nodes.
+ * @return Closure which converts node to node ID.
*/
- public static <T> Collection<T> nodeAttributes(Collection<? extends ClusterNode> nodes, String attr) {
- A.notNull(nodes, "nodes", attr, "attr");
-
- Collection<T> c = new ArrayList<>(nodes.size());
-
- for (ClusterNode n : nodes)
- c.add(n.<T>attribute(attr));
-
- return c;
+ public static IgniteClosure<ClusterNode, UUID> node2id() {
+ return NODE2ID;
}
/**
- * Gets closure that calls {@code System.out.println()} on its bound variable.
+ * Creates grid node predicate evaluating on the given node ID.
*
- * @param <T> Type of the bound variable.
- * @return Closure that calls {@code System.out.println()} on its bound variable.
+ * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
+ * @return Grid node predicate evaluating on the given node ID.
+ * @see #idForNodeId(UUID)
+ * @see #nodeIds(Collection)
*/
- @SuppressWarnings("unchecked")
- public static <T> IgniteInClosure<T> println() {
- return (IgniteInClosure<T>)PRINTLN;
- }
+ public static <T extends ClusterNode> IgnitePredicate<T> nodeForNodeId(final UUID nodeId) {
+ A.notNull(nodeId, "nodeId");
- /**
- * Creates absolute closure that does <tt>System.out.println(msg)</tt>.
- *
- * @param msg Message to print.
- * @return Absolute closure that print message.
- */
- public static GridAbsClosure println(final String msg) {
- return new CA() {
- @Override public void apply() {
- System.out.println(msg);
+ return new P1<T>() {
+ @Override public boolean apply(ClusterNode e) {
+ return e.id().equals(nodeId);
}
};
}
/**
- * Creates absolute closure that does <tt>System.out.print(msg)</tt>.
+ * Creates grid node predicate evaluating on the given node IDs.
*
- * @param msg Message to print.
- * @return Absolute closure that print message.
+ * @param nodeIds Collection of node IDs.
+ * @return Grid node predicate evaluating on the given node IDs.
+ * @see #idForNodeId(UUID)
+ * @see #nodeIds(Collection)
*/
- public static GridAbsClosure print(final String msg) {
- return new CA() {
- @Override public void apply() {
- System.out.print(msg);
- }
- };
- }
+ public static <T extends ClusterNode> IgnitePredicate<T> nodeForNodeIds(@Nullable final Collection<UUID>
+ nodeIds) {
+ if (isEmpty(nodeIds))
+ return alwaysFalse();
- /**
- * Gets closure that prints out its bound variable.
- *
- * @param pre String value to print before each variable.
- * @param post String value to print after each variable.
- * @param <T> Type of the bound variable.
- * @return Closure that calls {@code System.out.print(pre); System.out.print(t); System.out.println(post)}
- * on its bound variable.
- */
- public static <T> IgniteInClosure<T> println(@Nullable final String pre, @Nullable final String post) {
- return new CI1<T>() {
- @Override public void apply(T t) {
- String sPre = pre == null ? "" : pre;
- String sPost = post == null ? "" : post;
+ assert nodeIds != null;
- System.out.println(sPre + t + sPost);
+ return new P1<T>() {
+ @Override public boolean apply(ClusterNode e) {
+ return nodeIds.contains(e.id());
}
};
}
/**
- * Gets closure that prints out its bound variable.
+ * Creates {@link UUID} predicate evaluating on the given node ID.
*
- * @param fmt Format string as for {@link PrintStream#printf(String, Object...)} method.
- * @param <T> Type of the bound variable.
- * @return Closure that prints out its bound variable.
+ * @param nodeId Node ID for which returning predicate will evaluate to {@code true}.
+ * @return {@link UUID} predicate evaluating on the given node ID.
+ * @see #nodeForNodeId(UUID)
+ * @see #nodeIds(Collection)
*/
- public static <T> IgniteInClosure<T> printf(final String fmt) {
- return new CI1<T>() {
- @Override public void apply(T t) {
- System.out.printf(fmt, t);
+ public static IgnitePredicate<UUID> idForNodeId(final UUID nodeId) {
+ A.notNull(nodeId, "nodeId");
+
+ return new P1<UUID>() {
+ @Override public boolean apply(UUID id) {
+ return id.equals(nodeId);
}
};
}
/**
- * Gets closure that prints out its bound variable
+ * Creates predicates that evaluates to {@code true} for each node in given collection.
+ * Note that if collection is empty the result predicate will always evaluate to {@code false}.
+ * Implementation simply creates {@link GridNodePredicate} instance.
*
- * @return Closure that prints out its bound variable.
+ * @param nodes Collection of nodes. If none provided - result predicate will always
+ * return {@code false}.
+ * @return Predicates that evaluates to {@code true} for each node in given collection.
*/
- @SuppressWarnings("unchecked")
- public static <T> IgniteInClosure<T> print() {
- return (IgniteInClosure<T>)PRINT;
+ public static IgnitePredicate<ClusterNode> nodeForNodes(ClusterNode... nodes) {
+ return new GridNodePredicate(nodes);
}
/**
- * Gets closure that prints out its bound variable.
+ * Retains all elements in input collection that are contained in {@code filter}.
*
- * @param pre String value to print before each variable.
- * @param post String value to print after each variable.
- * @return Closure that prints out its bound variable.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates collection not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param filter Filter collection. If filter collection is {@code null} or empty -
+ * an empty collection will be returned.
+ * @param <T> Type of collections.
+ * @return Collection of retain elements.
*/
- public static <T> IgniteInClosure<T> print(@Nullable final String pre, @Nullable final String post) {
- return new CI1<T>() {
- @Override public void apply(T t) {
- String sPre = pre == null ? "" : pre;
- String sPost = post == null ? "" : post;
+ public static <T0, T extends T0> Collection<T> retain(Collection<T> c, boolean cp,
+ @Nullable Collection<? extends T0> filter) {
+ A.notNull(c, "c");
- System.out.print(sPre + t + sPost);
- }
- };
+ return retain(c, cp, F0.in(filter));
}
/**
- * Gets random value from given collection.
+ * Retains all elements in input collection that are evaluated to {@code true}
+ * by all given predicates.
*
- * @param c Input collection (no {@code null} and not emtpy).
- * @param <T> Type of the collection.
- * @return Random value from the input collection.
+ * @param c Input collection.
+ * @param cp If {@code true} method creates collection not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param p Predicates to filter by. If no predicates provides - all elements
+ * will be retained.
+ * @param <T> Type of collections.
+ * @return Collection of retain elements.
*/
- @SuppressWarnings("UnusedDeclaration")
- public static <T> T rand(Collection<? extends T> c) {
+ public static <T> Collection<T> retain(Collection<T> c, boolean cp, @Nullable IgnitePredicate<? super T>... p) {
A.notNull(c, "c");
- int n = ThreadLocalRandom8.current().nextInt(c.size());
-
- int i = 0;
-
- for (T t : c) {
- if (i++ == n)
- return t;
- }
-
- throw new ConcurrentModificationException();
+ return lose(c, cp, not(p));
}
/**
- * Gets random value from given collection which may be modified concurrently.
+ * Retains only up to first {@code num} elements in the input collection.
*
* @param c Input collection.
- * @param <T> Type of the collection.
- * @return Random value from the input collection.
+ * @param cp If {@code true} method creates collection not modifying input, otherwise does
+ * <tt>in-place</tt> modifications.
+ * @param num Maximum number of elements to retain (the actual number can be
+ * less if the input collection contains less elements).
+ * @param <T> Type of the collections.
+ * @return Collection contains up to {@code num} first elements from the input collection.
*/
- @Nullable public static <T> T randConcurrent(Collection<? extends T> c) {
+ public static <T> Collection<T> retain(Collection<T> c, boolean cp, int num) {
A.notNull(c, "c");
+ A.ensure(num >= 0, "num >= 0");
- int size = c.size();
+ Collection<T> res;
- if (size == 0)
- return null;
+ if (!cp) {
+ res = c;
- int n = ThreadLocalRandom8.current().nextInt(size);
+ if (num < res.size()) {
+ int i = 0;
- int i = 0;
+ for (Iterator<T> iter = res.iterator(); iter.hasNext();) {
+ iter.next();
- T res = null;
+ if (i++ >= num)
+ iter.remove();
+ }
+ }
+ }
+ else {
+ res = new ArrayList<>(num);
- for (T t : c) {
- if (i++ == n)
- return t;
+ Iterator<? extends T> iter = c.iterator();
- res = t;
+ for (int i = 0; i < num && iter.hasNext(); i++)
+ res.add(iter.next());
}
return res;
}
/**
- * Gets random value from given list. For random-access lists this
- * operation is O(1), otherwise O(n).
+ * Curries given closure.
*
- * @param l Input collection.
- * @param <T> Type of the list elements.
- * @return Random value from the input list.
+ * @param f Closure.
+ * @param e Parameter.
+ * @param <T> Input type.
+ * @param <R> Output type.
+ * @return Curried closure.
*/
- public static <T> T rand(List<T> l) {
- A.notNull(l, "l");
-
- return l.get(ThreadLocalRandom8.current().nextInt(l.size()));
+ public static <T, R> IgniteOutClosure<R> curry(final IgniteClosure<? super T, R> f, final T e) {
+ return new IgniteOutClosure<R>() {
+ @Override public R apply() {
+ return f.apply(e);
+ }
+ };
}
/**
- * Gets random value from given array. This operation
- * does not iterate through array elements and returns immediately.
+ * Curries given closure.
*
- * @param c Input collection.
- * @param <T> Type of the collection.
- * @return Random value from the input collection.
+ * @param f Closure.
+ * @param e Parameter.
+ * @param <T> Input type.
+ * @return Curried closure.
*/
- public static <T> T rand(T... c) {
- A.notNull(c, "c");
-
- return c[ThreadLocalRandom8.current().nextInt(c.length)];
+ public static <T> GridAbsClosure curry(final IgniteInClosure<? super T> f, final T e) {
+ return new GridAbsClosure() {
+ @Override public void apply() {
+ f.apply(e);
+ }
+ };
}
/**
- * Concatenates an element to a collection. If {@code copy} flag is {@code true}, then
- * a new collection will be created and the element and passed in collection will be
- * copied into the new one. The returned collection will be modifiable. If {@code copy}
- * flag is {@code false}, then a read-only view will be created over the element and given
- * collections and no copying will happen.
+ * Converts array to {@link List}. Note that resulting list cannot
+ * be altered in size, as it it based on the passed in array -
+ * only current elements can be changed.
+ * <p>
+ * Note that unlike {@link Arrays#asList(Object[])}, this method is
+ * {@code null}-safe. If {@code null} is passed in, then empty list
+ * will be returned.
*
- * @param cp Copy flag.
- * @param t First element.
- * @param c Second collection.
- * @param <T> Element type.
- * @return Concatenated collection.
+ * @param vals Array of values
+ * @param <T> Array type.
+ * @return {@link List} instance for array.
*/
- public static <T> Collection<T> concat(boolean cp, @Nullable final T t, @Nullable final Collection<T> c) {
- if (cp) {
- if (isEmpty(c)) {
- Collection<T> l = new ArrayList<>(1);
+ public static <T> List<T> asList(@Nullable T... vals) {
+ return isEmpty(vals) ? Collections.<T>emptyList() : Arrays.asList(vals);
+ }
- l.add(t);
+ /**
+ * Creates new empty iterator.
+ *
+ * @param <T> Type of the iterator.
+ * @return Newly created empty iterator.
+ */
+ public static <T> GridIterator<T> emptyIterator() {
+ return new GridEmptyIterator<>();
+ }
- return l;
+ /**
+ * Flattens collection-of-collections and returns collection over the
+ * elements of the inner collections. This method doesn't create any
+ * new collections or copies any elements.
+ * <p>
+ * Note that due to non-copying nature of implementation, the
+ * {@link Collection#size() size()} method of resulting collection will have to
+ * iterate over all elements to produce size. Method {@link Collection#isEmpty() isEmpty()},
+ * however, is constant time and is much more preferable to use instead
+ * of {@code 'size()'} method when checking if list is not empty.
+ *
+ * @param c Input collection of collections.
+ * @param <T> Type of the inner collections.
+ * @return Iterable over the elements of the inner collections.
+ */
+ public static <T> Collection<T> flatCollections(@Nullable final Collection<? extends Collection<T>> c) {
+ if (F.isEmpty(c))
+ return Collections.emptyList();
+
+ return new GridSerializableCollection<T>() {
+ @NotNull
+ @Override public Iterator<T> iterator() {
+ return flat((Iterable<? extends Iterable<T>>)c);
}
- assert c != null;
+ @Override public int size() {
+ return F.size(iterator());
+ }
- Collection<T> ret = new ArrayList<>(c.size() + 1);
+ @Override public boolean isEmpty() {
+ return !iterator().hasNext();
+ }
+ };
+ }
- ret.add(t);
- ret.addAll(c);
+ /**
+ * Flattens iterable-of-iterables and returns iterable over the
+ * elements of the inner collections. This method doesn't create any
+ * new collections or copies any elements.
+ *
+ * @param c Input collection of collections.
+ * @param <T> Type of the inner collections.
+ * @return Iterable over the elements of the inner collections.
+ */
+ public static <T> GridIterator<T> flat(@Nullable final Iterable<? extends Iterable<T>> c) {
+ return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapter<T>() {
+ /** */
+ private Iterator<? extends Iterable<T>> a = c.iterator();
- return ret;
- }
- else {
- if (isEmpty(c))
- return Collections.singletonList(t);
+ /** */
+ private Iterator<T> b;
- assert c != null;
+ /** */
+ private boolean moved = true;
- return new GridSerializableCollection<T>() {
- @NotNull
- @Override public Iterator<T> iterator() {
- return new GridSerializableIterator<T>() {
- private Iterator<T> it;
+ /** */
+ private boolean more;
- @Override public boolean hasNext() {
- return it == null || it.hasNext();
- }
+ @Override public boolean hasNextX() {
+ if (!moved)
+ return more;
- @Nullable @Override public T next() {
- if (it == null) {
- it = c.iterator();
+ moved = false;
- return t;
- }
+ if (b != null && b.hasNext())
+ return more = true;
- return it.next();
- }
+ while (a.hasNext()) {
+ b = a.next().iterator();
- @Override public void remove() {
- throw new UnsupportedOperationException();
- }
- };
+ if (b.hasNext())
+ return more = true;
}
- @Override public int size() {
- return c.size() + 1;
- }
+ return more = false;
+ }
- @Override public boolean equals(Object obj) {
- return obj instanceof Collection && eqNotOrdered(this, (Collection)obj);
+ @Override public T nextX() {
+ if (hasNext()) {
+ moved = true;
+
+ return b.next();
}
- };
- }
+
+ throw new NoSuchElementException();
+ }
+
+ @Override public void removeX() {
+ assert b != null;
+
+ b.remove();
+ }
+ };
}
/**
- * Concatenates 2 collections into one. If {@code copy} flag is {@code true}, then
- * a new collection will be created and these collections will be copied into the
- * new one. The returned collection will be modifiable. If {@code copy} flag is
- * {@code false}, then a read-only view will be created over given collections
- * and no copying will happen.
+ * Flattens iterable-of-iterators and returns iterator over the
+ * elements of the inner collections. This method doesn't create any
+ * new collections or copies any elements.
*
- * @param cp Copy flag.
- * @param c1 First collection.
- * @param c2 Second collection.
- * @param <T> Element type.
- * @return Concatenated {@code non-null} collection.
+ * @param c Input iterable of iterators.
+ * @return Iterator over the elements of given iterators.
*/
- public static <T> Collection<T> concat(boolean cp, @Nullable final Collection<T> c1,
- @Nullable final Collection<T> c2) {
- if (cp) {
- if (isEmpty(c1) && isEmpty(c2))
- return new ArrayList<>(0);
+ public static <T> Iterator<T> flatIterators(@Nullable final Iterable<Iterator<T>> c) {
+ return isEmpty(c) ? GridFunc.<T>emptyIterator() : new GridIteratorAdapter<T>() {
+ /** */
+ private Iterator<? extends Iterator<T>> a = c.iterator();
- if (isEmpty(c1))
- return new ArrayList<>(c2);
+ /** */
+ private Iterator<T> b;
- if (isEmpty(c2))
- return new ArrayList<>(c1);
+ /** */
+ private boolean moved = true;
- assert c1 != null && c2 != null;
+ /** */
+ private boolean more;
- Collection<T> c = new ArrayList<>(c1.size() + c2.size());
+ @Override public boolean hasNextX() {
+ if (!moved)
+ return more;
- c.addAll(c1);
- c.addAll(c2);
+ moved = false;
- return c;
- }
- else {
- if (isEmpty(c1) && isEmpty(c2))
- return Collections.emptyList();
+ if (b != null && b.hasNext())
+ return more = true;
- if (isEmpty(c1) || isEmpty(c2)) {
- Collection<T> c = isEmpty(c1) ? c2 : c1;
+ while (a.hasNext()) {
+ b = a.next();
- assert c != null;
+ if (b.hasNext())
+ return more = true;
+ }
- return c;
+ return more = false;
}
- assert c1 != null && c2 != null;
-
- return new GridSerializableCollection<T>() {
- @NotNull
- @Override public Iterator<T> iterator() {
- return new GridSerializableIterator<T>() {
- private Iterator<T> it1 = c1.iterator();
- private Iterator<T> it2 = c2.iterator();
-
- @Override public boolean hasNext() {
- if (it1 != null)
- if (!it1.hasNext())
- it1 = null;
- else
- return true;
-
- return it2.hasNext();
- }
-
- @Override public T next() {
- return it1 != null ? it1.next() : it2.next();
- }
+ @Override public T nextX() {
+ if (hasNext()) {
+ moved = true;
- @Override public void remove() {
- throw new UnsupportedOperationException();
- }
- };
+ return b.next();
}
- @Override public boolean contains(Object o) {
- return c1.contains(o) || c2.contains(o);
- }
+ throw new NoSuchElementException();
+ }
- @Override public int size() {
- return c1.size() + c2.size();
- }
+ @Override public void removeX() {
+ assert b != null;
- @Override public boolean equals(Object obj) {
- return obj instanceof Collection && eqNotOrdered(this, (Collection<?>)obj);
- }
- };
- }
+ b.remove();
+ }
+ };
}
/**
- * Concatenates an elements to an array.
+ * Converts given runnable to an absolute closure.
*
- * @param arr Array.
- * @param obj One or more elements.
- * @return Concatenated array.
+ * @param r Runnable to convert to closure. If {@code null} - no-op closure is returned.
+ * @return Closure that wraps given runnable. Note that wrapping closure always returns {@code null}.
*/
- public static <T> T[] concat(@Nullable T[] arr, T... obj) {
- T[] newArr;
-
- if (arr == null || arr.length == 0)
- newArr = obj;
- else {
- newArr = Arrays.copyOf(arr, arr.length + obj.length);
-
- System.arraycopy(obj, 0, newArr, arr.length, obj.length);
- }
-
- return newArr;
- }
+ public static GridAbsClosure as(@Nullable final Runnable r) {
+ return new CA() {
+ @Override public void apply() {
+ if (r != null)
+ r.run();
+ }
+ };
+ }
/**
- * Concatenates multiple iterators as single one.
+ * Gets size of the given collection with provided optional predicates.
*
- * @param iters Iterators.
- * @return Single iterator.
+ * @param c Collection to size.
+ * @param p Optional predicates that filters out elements from count.
+ * @param <T> Type of the iterator.
+ * @return Number of elements in the collection for which all given predicates
+ * evaluates to {@code true}. If no predicates is provided - all elements are counted.
*/
- @SuppressWarnings("unchecked")
- public static <T> Iterator<T> concat(Iterator<T> ... iters) {
- if (iters.length == 1)
- return iters[0];
-
- return concat(asList(iters).iterator());
+ public static <T> int size(@Nullable Collection<? extends T> c, @Nullable IgnitePredicate<? super T>... p) {
+ return c == null || c.isEmpty() ? 0 : isEmpty(p) || isAlwaysTrue(p) ? c.size() : size(c.iterator(), p);
}
/**
- * Concatenates multiple iterators as single one.
+ * Gets size of the given iterator with provided optional predicates. Iterator
+ * will be traversed to get the count.
*
- * @param iters Iterator over iterators.
- * @return Single iterator.
+ * @param it Iterator to size.
+ * @param p Optional predicates that filters out elements from count.
+ * @param <T> Type of the iterator.
+ * @return Number of elements in the iterator for which all given predicates
+ * evaluates to {@code true}. If no predicates is provided - all elements are counted.
*/
- @SuppressWarnings("unchecked")
- public static <T> Iterator<T> concat(final Iterator<Iterator<T>> iters) {
- if (!iters.hasNext())
- return Collections.<T>emptySet().iterator();
-
- return new Iterator<T>() {
- privat
<TRUNCATED>
[26/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4cf21335
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4cf21335
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4cf21335
Branch: refs/heads/ignite-gg-9614
Commit: 4cf213359643d5fdd7275c571619594ad6687bf6
Parents: cc679f5 39ae0c8
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 18:58:08 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 18:58:08 2015 +0300
----------------------------------------------------------------------
dev-tools/build.gradle | 15 +-
dev-tools/src/main/groovy/jiraslurp.groovy | 15 +-
.../util/lang/GridFilteredIterator.java | 2 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 22 +-
...CacheLoadingConcurrentGridStartSelfTest.java | 49 +--
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 65 ++--
.../ignite/testsuites/IgniteCacheTestSuite.java | 296 -------------------
.../testsuites/IgniteCacheTestSuite2.java | 141 +++++++++
.../testsuites/IgniteCacheTestSuite3.java | 143 +++++++++
.../testsuites/IgniteCacheTestSuite4.java | 131 ++++++++
.../ignite/schema/generator/CodeGenerator.java | 6 +-
11 files changed, 500 insertions(+), 385 deletions(-)
----------------------------------------------------------------------
[36/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4-incubating' into ignite-sprint-4
Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4-incubating' into ignite-sprint-4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e9f2e6dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e9f2e6dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e9f2e6dd
Branch: refs/heads/ignite-gg-9614
Commit: e9f2e6dd4a9d553504904d018947fbbb95b12cdb
Parents: dea6118 dabcf1d
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 12:42:55 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 12:42:55 2015 +0300
----------------------------------------------------------------------
pom.xml | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[35/50] [abbrv] incubator-ignite git commit: rat fix
Posted by vo...@apache.org.
rat fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dea61181
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dea61181
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dea61181
Branch: refs/heads/ignite-gg-9614
Commit: dea6118127da7426c2ba212bbbe2bec1e5e1f3b8
Parents: 0c13a08
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 12:35:43 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 12:35:43 2015 +0300
----------------------------------------------------------------------
parent/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dea61181/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 661b310..e3f70b4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -628,6 +628,7 @@
<exclude>src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/ignite.empty</exclude><!--should be empty-->
<exclude>src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/ignite.brokenxml</exclude><!--test resource-->
<exclude>src/test/java/org/apache/ignite/internal/processors/hadoop/books/*.txt</exclude><!--books examples-->
+ <exclude>src/main/java/org/apache/ignite/examples/streaming/wordcount/*.txt</exclude><!--books examples-->
<exclude>examples/src/main/java/org/apache/ignite/examples/streaming/wordcount/*.txt</exclude><!--books examples-->
<exclude>src/main/java/META-INF/services/javax.cache.spi.CachingProvider</exclude><!--cannot be changed-->
<exclude>src/main/java/org/jetbrains/annotations/*.java</exclude><!--copyright-->
[42/50] [abbrv] incubator-ignite git commit: rat fix
Posted by vo...@apache.org.
rat fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ecc7a50a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ecc7a50a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ecc7a50a
Branch: refs/heads/ignite-gg-9614
Commit: ecc7a50a0e45102ba9e5025435bb33e2cd5d0a96
Parents: 2d4a3fb
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 16:13:34 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 16:13:34 2015 +0300
----------------------------------------------------------------------
parent/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ecc7a50a/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index e3f70b4..cd098d9 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -619,6 +619,7 @@
<exclude>**/keystore/*.pfx</exclude><!--bin-files-->
<!--special excludes-->
<exclude>DEVNOTES.txt</exclude>
+ <exclude>DEPENDENCIES</exclude><!--automatically generated file. presents at source pack-->
<exclude>src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffHeapSnapTreeMap.java</exclude><!--BSD license-->
<exclude>src/main/java/org/apache/ignite/internal/util/snaptree/*.java</exclude><!--BSD license-->
<exclude>src/main/java/org/jsr166/*.java</exclude>
[21/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-4-incubating
Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-4-incubating
Conflicts:
examples/pom.xml
modules/aop/pom.xml
modules/aws/pom.xml
modules/clients/pom.xml
modules/cloud/pom.xml
modules/codegen/pom.xml
modules/core/pom.xml
modules/extdata/p2p/pom.xml
modules/extdata/uri/pom.xml
modules/gce/pom.xml
modules/geospatial/pom.xml
modules/hadoop/pom.xml
modules/hibernate/pom.xml
modules/indexing/pom.xml
modules/jcl/pom.xml
modules/jta/pom.xml
modules/log4j/pom.xml
modules/rest-http/pom.xml
modules/scalar/pom.xml
modules/schedule/pom.xml
modules/schema-import/pom.xml
modules/slf4j/pom.xml
modules/spring/pom.xml
modules/ssh/pom.xml
modules/tools/pom.xml
modules/urideploy/pom.xml
modules/visor-console/pom.xml
modules/visor-plugins/pom.xml
modules/web/pom.xml
modules/yardstick/pom.xml
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5166142c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5166142c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5166142c
Branch: refs/heads/ignite-gg-9614
Commit: 5166142ccb692f084463176ac32a3ca8efb7e607
Parents: 6bfb1d8 0c13a08
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 12:15:20 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 12:15:20 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../processors/cache/GridCacheAdapter.java | 7 +++++-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 24 ++++++++++----------
32 files changed, 48 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
[34/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by vo...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/de19191c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/de19191c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/de19191c
Branch: refs/heads/ignite-gg-9614
Commit: de19191c5a257522884f66ae1fe5c82aab188be4
Parents: 745cf7f
Author: Ignite Teamcity <ig...@apache.org>
Authored: Fri May 8 12:23:34 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Fri May 8 12:23:34 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
32 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 3ac5a80..064b804 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 38a593e..a248f85 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 83eced2..a6604f9 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index c90173f..96b6542 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 754491e..25d610e 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 15c3d5d..ed4aa8f 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index e3a7b97..72d993f 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 432b2ad..80bffed 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.0.3
+ignite.version=1.0.4
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index cc6843f..2357695 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 980db73..bffe625 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index b33d76f..310ba31 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index dc7a454..b8111f1 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index fba22c1..782f0c9 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index f7d0443..d9caf79 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index e808ca3..3ac136c 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 061e27c..d81c7cb 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index b6e0928..e02e601 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index d855911..b07549f 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 95800ac..4be6b4a 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 3160cc2..295d3de 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 4cda672..1a36beb 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 51b5ff0..0cda51b 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index d7109c2..d2fdcef 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 26dfc14..8494ad0 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 82a7983..ba29b8a 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index b38de40..1e9f270 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index c711902..b5f5b75 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index a70dd2c..45e0f30 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 96e7b17..edc45b6 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 92f9aa7..1479e79 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 7298f6b..0c20fbb 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de19191c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c445fd3..c5a9e5d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.6-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[32/50] [abbrv] incubator-ignite git commit: #ignite-286: Make cache
full api test work in OFFHEAP_TIERED mode.
Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
index 62e4452..216832c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java
@@ -17,13 +17,17 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests colocated cache with values being stored off-heap.
*/
public class GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest
extends GridCachePartitionedNearDisabledMultiNodeFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java
new file mode 100644
index 0000000..875a913
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.distributed.dht;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest extends
+ GridCachePartitionedFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean txEnabled() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean lockingEnabled() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..bab26f7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..022f26b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..b0d13e0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicOffHeapTieredFullApiSelfTest extends GridCacheAtomicOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..b3adf14
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCacheAtomicOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..41e98b2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest extends
+ GridCacheAtomicPrimaryWriteOrderOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..f29cdd0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index caacc2b..84594a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import javax.cache.*;
import java.util.*;
import java.util.concurrent.atomic.*;
@@ -138,12 +137,12 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
int size = 10;
- IgniteCache<Object, Object> prj0 = grid(0).cache(null);
+ IgniteCache<Object, Object> chache0 = grid(0).cache(null);
for (int i = 0; i < size; i++) {
info("Putting value [i=" + i + ']');
- prj0.put(i, i);
+ chache0.put(i, i);
info("Finished putting value [i=" + i + ']');
}
@@ -156,26 +155,30 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
for (int k = 0; k < size; k++) {
if (affinity(cache).isPrimaryOrBackup(node, k))
- assertEquals("Check failed for node: " + node.id(), k, cache.localPeek(k, ONHEAP));
+ assertEquals("Check failed for node: " + node.id(), k,
+ cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP));
}
}
for (int i = 0; i < size; i++) {
info("Putting value 2 [i=" + i + ']');
- assertEquals(i, prj0.getAndPutIfAbsent(i, i * i));
+ assertEquals(i, chache0.getAndPutIfAbsent(i, i * i));
info("Finished putting value 2 [i=" + i + ']');
}
for (int i = 0; i < size; i++)
- assertEquals(i, prj0.get(i));
+ assertEquals(i, chache0.get(i));
}
/**
* @throws Exception If failed.
*/
public void testUnswapShort() throws Exception {
+ if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
final AtomicInteger swapEvts = new AtomicInteger(0);
final AtomicInteger unswapEvts = new AtomicInteger(0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
index d77efcf..78c8ab7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests partitioned cache with values being stored off-heap.
*/
public class GridCachePartitionedOffHeapFullApiSelfTest extends GridCachePartitionedFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
index c7a04fc..4724d9d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests partitioned cache with values being stored off-heap.
*/
public class GridCachePartitionedOffHeapMultiNodeFullApiSelfTest extends GridCachePartitionedMultiNodeFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..365e9aa
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.distributed.near;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedOffHeapTieredFullApiSelfTest extends GridCachePartitionedOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..4392365
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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.distributed.near;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests partitioned cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest extends GridCachePartitionedOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPut() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).cache(null);
+
+ assert gridCount() > 3;
+ String key = null;
+
+ for (int i = 0; i < 250; ++i) {
+ String testKey = "key_" + i;
+
+ if (!grid(0).affinity(null).isPrimaryOrBackup(grid(0).localNode(), testKey)) {
+ key = testKey;
+
+ break;
+ }
+ }
+
+ assert key != null;
+
+ IgniteCache<String, Integer> primaryCache = primaryCache(key);
+
+ assertFalse(grid(0).affinity(null).isPrimary(grid(0).localNode(), key));
+ assertFalse(grid(0).affinity(null).isBackup(grid(0).localNode(), key));
+
+ primaryCache.put(key, 4); // Put from primary.
+
+ assertNull(primaryCache.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(4, primaryCache.localPeek(key, CachePeekMode.OFFHEAP).intValue());
+
+ cache.put(key, 5); // Put from near to add reader on primary.
+
+ assertEquals(5, primaryCache.localPeek(key, CachePeekMode.ONHEAP).intValue());
+ assertEquals(5, primaryCache.localPeek(key, CachePeekMode.OFFHEAP).intValue());
+ assertEquals(5, cache.get(key).intValue());
+ assertEquals(5, map.get(key));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
index c9b9072..1cb5df5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.replicated;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests replicated cache with values being stored off-heap.
*/
public class GridCacheReplicatedOffHeapFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
index 382b0f9..f79f898 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java
@@ -17,12 +17,16 @@
package org.apache.ignite.internal.processors.cache.distributed.replicated;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests replicated cache with values being stored off-heap.
*/
public class GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..8162c8e
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.replicated;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests replicated cache with off-heap tiered mode.
+ */
+public class GridCacheReplicatedOffHeapTieredFullApiSelfTest extends
+ GridCacheReplicatedOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..0e2bf90
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.distributed.replicated;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests replicated cache with off-heap tiered mode.
+ */
+public class GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest{
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..b4e8cf1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.local;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests local cache in atomic mode with off-heap tiered mode.
+ */
+public class GridCacheLocalAtomicOffHeapTieredFullApiSelfTest extends GridCacheLocalAtomicOffHeapFullApiSelfTest{
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
index 31b8bee..e2621ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java
@@ -17,12 +17,14 @@
package org.apache.ignite.internal.processors.cache.local;
+import org.apache.ignite.cache.*;
+
/**
* Tests local cache with values being stored offheap.
*/
public class GridCacheLocalOffHeapFullApiSelfTest extends GridCacheLocalFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return CacheMemoryMode.OFFHEAP_VALUES;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java
new file mode 100644
index 0000000..c6ce9da
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.local;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
+/**
+ * Tests local cache with off-heap tired memory mode.
+ */
+public class GridCacheLocalOffHeapTieredFullApiSelfTest extends GridCacheLocalOffHeapFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_TIERED;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index d5760ee..56ff951 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -73,6 +73,7 @@ public class IgniteBasicTestSuite extends TestSuite {
suite.addTestSuite(GridLifecycleAwareSelfTest.class);
suite.addTestSuite(GridMessageListenSelfTest.class);
suite.addTestSuite(GridFailFastNodeFailureDetectionSelfTest.class);
+ suite.addTestSuite(OffHeapTieredTransactionSelfTest.class);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
index acf6c64..369e041 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
@@ -60,6 +60,16 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderOffHeapFullApiSelfTest.class);
suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.class);
+ // One node with off-heap tiered mode.
+ suite.addTestSuite(GridCacheLocalOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.class);
+
// Multi-node.
suite.addTestSuite(GridCacheReplicatedMultiNodeFullApiSelfTest.class);
suite.addTestSuite(GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.class);
@@ -112,6 +122,14 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest.class);
suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.class);
+ // Multi-node with off-heap tiered mode.
+ suite.addTestSuite(GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.class);
+
// Private cache API.
suite.addTestSuite(GridCacheExLocalFullApiSelfTest.class);
suite.addTestSuite(GridCacheExReplicatedFullApiSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java
new file mode 100644
index 0000000..8b09d0f
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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 org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ * Test queries in off-heap tired mode.
+ */
+public class IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest extends IgniteCacheQueryMultiThreadedSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration cacheConfiguration() {
+ CacheConfiguration ccfg = super.cacheConfiguration();
+
+ ccfg.setCacheMode(CacheMode.REPLICATED);
+ ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+ ccfg.setOffHeapMaxMemory(0);
+
+ return ccfg;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index daca7dc..54bc814 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -86,6 +86,17 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
cfg.setMarshaller(new OptimizedMarshaller(false));
+ cfg.setCacheConfiguration(cacheConfiguration());
+
+ GridQueryProcessor.idxCls = FakeIndexing.class;
+
+ return cfg;
+ }
+
+ /**
+ * @return Cache configuration.
+ */
+ protected CacheConfiguration cacheConfiguration() {
CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
@@ -106,11 +117,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
if (offheapEnabled())
cacheCfg.setOffHeapMaxMemory(evictsEnabled() ? 1000 : 0); // Small offheap for evictions.
- cfg.setCacheConfiguration(cacheCfg);
-
- GridQueryProcessor.idxCls = FakeIndexing.class;
-
- return cfg;
+ return cacheCfg;
}
/**
@@ -235,6 +242,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
final IgniteCache<Integer, String> c = g.cache(null);
final IgniteCache<Integer, Long> cl = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).localSize());
assertEquals(0, c.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
assertEquals(0, cl.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
@@ -307,6 +317,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
final IgniteCache<Integer, Long> c = g.cache(null);
final IgniteCache<Integer, String> c1 = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).localSize());
assertEquals(0, c1.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
assertEquals(0, c.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
@@ -379,6 +392,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
// Put test values into cache.
final IgniteCache<Integer, Object> c = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).size());
assertEquals(0, c.query(new SqlQuery(Object.class, "1 = 1")).getAll().size());
@@ -450,6 +466,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
// Put test values into cache.
final IgniteCache<Integer, TestValue> c = g.cache(null);
+ if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+ return;
+
assertEquals(0, g.cache(null).localSize());
assertEquals(0, c.query(new SqlQuery(TestValue.class, "1 = 1")).getAll().size());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 69d7548..f42963a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -59,6 +59,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheLargeResultSelfTest.class);
suite.addTestSuite(GridCacheQueryInternalKeysSelfTest.class);
suite.addTestSuite(IgniteCacheQueryMultiThreadedSelfTest.class);
+ suite.addTestSuite(IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.class);
suite.addTestSuite(IgniteCacheQueryEvictsMultiThreadedSelfTest.class);
suite.addTestSuite(IgniteCacheQueryOffheapMultiThreadedSelfTest.class);
suite.addTestSuite(IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.class);
[14/50] [abbrv] incubator-ignite git commit: #ignite-841: Change igfs
exception in case of one client node.
Posted by vo...@apache.org.
#ignite-841: Change igfs exception in case of one client node.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a33d3d49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a33d3d49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a33d3d49
Branch: refs/heads/ignite-gg-9614
Commit: a33d3d49f675acd10e82100aa5a7f3378d11fdd1
Parents: 4accd3a
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed May 6 15:27:45 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed May 6 15:27:45 2015 +0300
----------------------------------------------------------------------
.../dht/GridPartitionedGetFuture.java | 2 +-
.../internal/processors/igfs/IgfsUtils.java | 11 +-
.../processors/igfs/IgfsOneClientNodeTest.java | 133 +++++++++++++++++++
.../ignite/testsuites/IgniteIgfsTestSuite.java | 1 +
4 files changed, 143 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a33d3d49/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 35ba2a9..2f41e63 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
@@ -270,7 +270,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
AffinityTopologyVersion topVer
) {
if (CU.affinityNodes(cctx, topVer).isEmpty()) {
- onDone(new ClusterTopologyCheckedException("Failed to map keys for cache " +
+ onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache " +
"(all partition nodes left the grid)."));
return;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a33d3d49/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 2a915ec..4b0234f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.igfs;
import org.apache.ignite.*;
import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.util.typedef.*;
import java.lang.reflect.*;
@@ -50,9 +51,13 @@ public class IgfsUtils {
if (err0 != null)
// Dealing with a kind of IGFS error, wrap it once again, preserving message and root cause.
err0 = newIgfsException(err0.getClass(), err0.getMessage(), err0);
- else
- // Unknown error nature.
- err0 = new IgfsException("Generic IGFS error occurred.", err);
+ else {
+ if (err instanceof ClusterTopologyServerNotFoundException)
+ err0 = new IgfsException("Cache server nodes not found.", err);
+ else
+ // Unknown error nature.
+ err0 = new IgfsException("Generic IGFS error occurred.", err);
+ }
}
return err0;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a33d3d49/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
new file mode 100644
index 0000000..49ddb03
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.igfs;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Test for igfs with one node in client mode.
+ */
+public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
+ /** Meta-information cache name. */
+ private static final String META_CACHE_NAME = "meta";
+
+ /** Data cache name. */
+ private static final String DATA_CACHE_NAME = null;
+
+ /** Regular cache name. */
+ private static final String CACHE_NAME = "cache";
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME),
+ cacheConfiguration(CACHE_NAME));
+
+ cfg.setClientMode(true);
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+ cfg.setDiscoverySpi(discoSpi);
+
+ FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+ igfsCfg.setMetaCacheName(META_CACHE_NAME);
+ igfsCfg.setDataCacheName(DATA_CACHE_NAME);
+ igfsCfg.setName("igfs");
+
+ cfg.setFileSystemConfiguration(igfsCfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ protected CacheConfiguration cacheConfiguration(String cacheName) {
+ CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+ cacheCfg.setName(cacheName);
+
+ cacheCfg.setCacheMode(PARTITIONED);
+
+ cacheCfg.setBackups(0);
+ cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+
+ cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ return cacheCfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGrids(1);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStartIgfs() throws Exception {
+
+ final IgfsImpl igfs = (IgfsImpl) grid(0).fileSystem("igfs");
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgfsAbstractSelfTest.create(igfs, new IgfsPath[]{new IgfsPath("/dir")}, null);
+ return null;
+ }
+ }, IgfsException.class, "Cache server nodes not found.");
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgfsPath FILE = new IgfsPath(new IgfsPath("/dir"), "file");
+
+ igfs.delete(FILE, false);
+
+ return null;
+ }
+ }, IgfsException.class, "Cache server nodes not found.");
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgfsPath FILE = new IgfsPath(new IgfsPath("/dir"), "file");
+
+ igfs.append(FILE, true);
+
+ return null;
+ }
+ }, IgfsException.class, "Cache server nodes not found.");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a33d3d49/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index 4f3178e..f8dac3d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -60,6 +60,7 @@ public class IgniteIgfsTestSuite extends TestSuite {
suite.addTest(new TestSuite(IgfsDualAsyncSelfTest.class));
suite.addTest(new TestSuite(IgfsClientCacheSelfTest.class));
+ suite.addTest(new TestSuite(IgfsOneClientNodeTest.class));
suite.addTest(new TestSuite(IgfsModeResolverSelfTest.class));
[08/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-4' into ignite-sprint-4
Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-4' into ignite-sprint-4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7be25bd7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7be25bd7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7be25bd7
Branch: refs/heads/ignite-gg-9614
Commit: 7be25bd7859f6cf45e6454c44ed9b1501d87fd4b
Parents: ba210bb 587103f
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 6 12:44:56 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 6 12:44:56 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 109 ++++++++++--------
.../processors/cache/CacheGetFromJobTest.java | 110 +++++++++++++++++++
.../testsuites/IgniteCacheRestartTestSuite.java | 1 +
3 files changed, 174 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7be25bd7/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
----------------------------------------------------------------------
[49/50] [abbrv] incubator-ignite git commit: ignite-877
Posted by vo...@apache.org.
ignite-877
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e6ca7570
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e6ca7570
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e6ca7570
Branch: refs/heads/ignite-gg-9614
Commit: e6ca75701e6acf7e4fb857530744d5263bc2f962
Parents: c9cd92e
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 18:54:33 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 18:54:33 2015 +0300
----------------------------------------------------------------------
pom.xml | 33 ---------------------------------
1 file changed, 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e6ca7570/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c5a9e5d..e303480 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,8 +36,6 @@
<packaging>pom</packaging>
<properties>
- <ignite.site>scp://localhost:/home</ignite.site>
- <ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
<!--fix <attachartifact>...< /> at apache-release profile if changed-->
<ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
@@ -49,13 +47,6 @@
<tag>HEAD</tag>
</scm>
- <distributionManagement>
- <site>
- <id>ignite-site</id>
- <url>${ignite.site}/${ignite.site.folder}</url>
- </site>
- </distributionManagement>
-
<modules>
<module>modules/tools</module>
<module>modules/core</module>
@@ -599,30 +590,6 @@
</execution>
</executions>
</plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.4</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-ssh</artifactId>
- <version>2.8</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>deploy</goal>
- </goals>
- <phase>deploy</phase>
- <configuration>
- <inputDirectory>${basedir}/target/site</inputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</profile>
[23/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by vo...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dabcf1d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dabcf1d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dabcf1d6
Branch: refs/heads/ignite-gg-9614
Commit: dabcf1d6638ff056c005b26f60827ad977921749
Parents: dfeceaf
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 15:18:19 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 15:18:19 2015 +0300
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dabcf1d6/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7614422..c445fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,7 +44,7 @@
<scm>
<url>https://git-wip-us.apache.org/repos/asf/incubator-ignite</url>
- <connection>scm:git:git://git-wip-us.apache.org/repos/asf/incubator-ignite</connection>
+ <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ignite</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ignite</developerConnection>
<tag>HEAD</tag>
</scm>
[06/50] [abbrv] incubator-ignite git commit: #gg-10186:
NullPointerException at CacheDrStateTransferHandler.java:320 #gg-10187:
NullPointerException at GridEntSecurityProcessor.java:263
Posted by vo...@apache.org.
#gg-10186: NullPointerException at CacheDrStateTransferHandler.java:320
#gg-10187: NullPointerException at GridEntSecurityProcessor.java:263
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/587103fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/587103fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/587103fd
Branch: refs/heads/ignite-gg-9614
Commit: 587103fdd1273e1d98897a07f98594dac85e38bc
Parents: 99c7e22
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed May 6 12:40:27 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed May 6 12:40:27 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 109 ++++++++++--------
.../processors/cache/CacheGetFromJobTest.java | 110 +++++++++++++++++++
.../testsuites/IgniteCacheRestartTestSuite.java | 1 +
3 files changed, 174 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/587103fd/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 c0026ab..d22d224 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
@@ -124,6 +124,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** Must use JDK marshaller since it is used by discovery to fire custom events. */
private Marshaller marshaller = new JdkMarshaller();
+ /** Count down latch for caches. */
+ private final CountDownLatch cacheStartedLatch = new CountDownLatch(1);
+
/**
* @param ctx Kernal context.
*/
@@ -657,87 +660,92 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void onKernalStart() throws IgniteCheckedException {
- if (ctx.config().isDaemon())
- return;
+ try {
+ if (ctx.config().isDaemon())
+ return;
- ClusterNode locNode = ctx.discovery().localNode();
+ ClusterNode locNode = ctx.discovery().localNode();
- // Init cache plugin managers.
- final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
+ // Init cache plugin managers.
+ final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- CacheConfiguration locCcfg = desc.cacheConfiguration();
+ for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ CacheConfiguration locCcfg = desc.cacheConfiguration();
- CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
+ CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
- cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
- }
+ cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
+ }
- if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
- for (ClusterNode n : ctx.discovery().remoteNodes()) {
- checkTransactionConfiguration(n);
+ if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
+ for (ClusterNode n : ctx.discovery().remoteNodes()) {
+ checkTransactionConfiguration(n);
- DeploymentMode locDepMode = ctx.config().getDeploymentMode();
- DeploymentMode rmtDepMode = n.attribute(IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE);
+ DeploymentMode locDepMode = ctx.config().getDeploymentMode();
+ DeploymentMode rmtDepMode = n.attribute(IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE);
- CU.checkAttributeMismatch(log, null, n.id(), "deploymentMode", "Deployment mode",
- locDepMode, rmtDepMode, true);
+ CU.checkAttributeMismatch(log, null, n.id(), "deploymentMode", "Deployment mode",
+ locDepMode, rmtDepMode, true);
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- CacheConfiguration rmtCfg = desc.remoteConfiguration(n.id());
+ for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ CacheConfiguration rmtCfg = desc.remoteConfiguration(n.id());
- if (rmtCfg != null) {
- CacheConfiguration locCfg = desc.cacheConfiguration();
+ if (rmtCfg != null) {
+ CacheConfiguration locCfg = desc.cacheConfiguration();
- checkCache(locCfg, rmtCfg, n);
+ checkCache(locCfg, rmtCfg, n);
- // Check plugin cache configurations.
- CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
+ // Check plugin cache configurations.
+ CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
- assert pluginMgr != null : " Map=" + cache2PluginMgr;
+ assert pluginMgr != null : " Map=" + cache2PluginMgr;
- pluginMgr.validateRemotes(rmtCfg, n);
+ pluginMgr.validateRemotes(rmtCfg, n);
+ }
}
}
}
- }
- // Start dynamic caches received from collect discovery data.
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- boolean started = desc.onStart();
+ // Start dynamic caches received from collect discovery data.
+ for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ boolean started = desc.onStart();
- assert started : "Failed to change started flag for locally configured cache: " + desc;
+ assert started : "Failed to change started flag for locally configured cache: " + desc;
- desc.clearRemoteConfigurations();
+ desc.clearRemoteConfigurations();
- CacheConfiguration ccfg = desc.cacheConfiguration();
+ CacheConfiguration ccfg = desc.cacheConfiguration();
- IgnitePredicate filter = ccfg.getNodeFilter();
+ IgnitePredicate filter = ccfg.getNodeFilter();
- if (filter.apply(locNode)) {
- CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
+ if (filter.apply(locNode)) {
+ CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
- CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
+ CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
- assert pluginMgr != null : " Map=" + cache2PluginMgr;
+ assert pluginMgr != null : " Map=" + cache2PluginMgr;
- GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
+ GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
- ctx.dynamicDeploymentId(desc.deploymentId());
+ ctx.dynamicDeploymentId(desc.deploymentId());
- sharedCtx.addCacheContext(ctx);
+ sharedCtx.addCacheContext(ctx);
- GridCacheAdapter cache = ctx.cache();
+ GridCacheAdapter cache = ctx.cache();
- String name = ccfg.getName();
+ String name = ccfg.getName();
- caches.put(maskNull(name), cache);
+ caches.put(maskNull(name), cache);
- startCache(cache);
+ startCache(cache);
- jCacheProxies.put(maskNull(name), new IgniteCacheProxy(ctx, cache, null, false));
+ jCacheProxies.put(maskNull(name), new IgniteCacheProxy(ctx, cache, null, false));
+ }
}
}
+ finally {
+ cacheStartedLatch.countDown();
+ }
ctx.marshallerContext().onMarshallerCacheStarted(ctx);
@@ -835,6 +843,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void onKernalStop(boolean cancel) {
+ cacheStartedLatch.countDown();
+
if (ctx.config().isDaemon())
return;
@@ -959,6 +969,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
/**
+ * @throws IgniteCheckedException If failed to wait.
+ */
+ public void awaitStarted() throws IgniteCheckedException {
+ U.await(cacheStartedLatch);
+ }
+
+ /**
* @param cache Cache.
* @throws IgniteCheckedException If failed.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/587103fd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetFromJobTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetFromJobTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetFromJobTest.java
new file mode 100644
index 0000000..5859bec
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetFromJobTest.java
@@ -0,0 +1,110 @@
+/*
+ * 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 org.apache.ignite.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.atomic.*;
+
+/**
+ * Job tries to get cache during topology change.
+ */
+public class CacheGetFromJobTest extends GridCacheAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTopologyChange() throws Exception {
+ final AtomicReference<Exception> err = new AtomicReference<>();
+
+ final AtomicInteger id = new AtomicInteger(1);
+
+ IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new CA() {
+ @Override public void apply() {
+ info("Run topology change.");
+
+ try {
+ for (int i = 0; i < 5; i++) {
+ info("Topology change: " + i);
+
+ startGrid(id.getAndIncrement());
+ }
+ }
+ catch (Exception e) {
+ err.set(e);
+
+ log.error("Unexpected exception in topology-change-thread: " + e, e);
+ }
+ }
+ }, 3, "topology-change-thread");
+
+ int cntr = 0;
+
+ while (!fut.isDone()) {
+ grid(0).compute().broadcast(new TestJob());
+
+ cntr++;
+ }
+
+ log.info("Job execution count: " + cntr);
+
+ Exception err0 = err.get();
+
+ if (err0 != null)
+ throw err0;
+ }
+
+ /**
+ * Test job.
+ */
+ private static class TestJob implements IgniteCallable<Object> {
+ /** Ignite. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** */
+ public TestJob() {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public Object call() throws Exception {
+ IgniteCache cache = ignite.cache(null);
+
+ assertNotNull(cache);
+
+ assertEquals(0, cache.localSize());
+
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/587103fd/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
index 0ced1c8..796d138 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
@@ -48,6 +48,7 @@ public class IgniteCacheRestartTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheAtomicPutAllFailoverSelfTest.class);
suite.addTestSuite(IgniteCachePutAllRestartTest.class);
suite.addTestSuite(GridCachePutAllFailoverSelfTest.class);
+ suite.addTestSuite(CacheGetFromJobTest.class);
return suite;
}
[09/50] [abbrv] incubator-ignite git commit: ignite-862: Fixed.
Posted by vo...@apache.org.
ignite-862: Fixed.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d4908f24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d4908f24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d4908f24
Branch: refs/heads/ignite-gg-9614
Commit: d4908f2449a4fde9298f6ca11590e0a94a94c955
Parents: 7be25bd
Author: Artem Shutak <as...@gridgain.com>
Authored: Wed May 6 12:58:08 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Wed May 6 12:58:08 2015 +0300
----------------------------------------------------------------------
.../cache/DynamicCacheDescriptor.java | 16 ++++++++++-
.../processors/cache/GridCacheProcessor.java | 30 ++++++--------------
2 files changed, 24 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d4908f24/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
index d8da9ef..6f6f422 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
@@ -18,6 +18,8 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.plugin.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
@@ -56,13 +58,17 @@ public class DynamicCacheDescriptor {
/** Template configuration flag. */
private boolean template;
+ /** Cache plugin manager. */
+ private final CachePluginManager pluginMgr;
+
/**
* @param cacheCfg Cache configuration.
* @param cacheType Cache type.
* @param template {@code True} if this is template configuration.
* @param deploymentId Deployment ID.
*/
- public DynamicCacheDescriptor(CacheConfiguration cacheCfg,
+ public DynamicCacheDescriptor(GridKernalContext ctx,
+ CacheConfiguration cacheCfg,
CacheType cacheType,
boolean template,
IgniteUuid deploymentId) {
@@ -70,6 +76,7 @@ public class DynamicCacheDescriptor {
this.cacheType = cacheType;
this.template = template;
this.deploymentId = deploymentId;
+ pluginMgr = new CachePluginManager(ctx, cacheCfg);
}
/**
@@ -149,6 +156,13 @@ public class DynamicCacheDescriptor {
}
/**
+ * @return Cache plugin manager.
+ */
+ public CachePluginManager pluginManager() {
+ return pluginMgr;
+ }
+
+ /**
* Sets cancelled flag.
*/
public void onCancelled() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d4908f24/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 d22d224..2b9a821 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
@@ -610,7 +610,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
boolean template = cfg.getName() != null && cfg.getName().endsWith("*");
- DynamicCacheDescriptor desc = new DynamicCacheDescriptor(cfg, cacheType, template, IgniteUuid.randomUuid());
+ DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx, cfg, cacheType, template,
+ IgniteUuid.randomUuid());
desc.locallyConfigured(true);
desc.staticallyConfigured(true);
@@ -638,7 +639,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (cfg.getName() == null) { // Use cache configuration with null name as template.
DynamicCacheDescriptor desc0 =
- new DynamicCacheDescriptor(cfg, cacheType, true, IgniteUuid.randomUuid());
+ new DynamicCacheDescriptor(ctx, cfg, cacheType, true, IgniteUuid.randomUuid());
desc0.locallyConfigured(true);
desc0.staticallyConfigured(true);
@@ -666,17 +667,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
ClusterNode locNode = ctx.discovery().localNode();
- // Init cache plugin managers.
- final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
-
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
- CacheConfiguration locCcfg = desc.cacheConfiguration();
-
- CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
-
- cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
- }
-
if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
for (ClusterNode n : ctx.discovery().remoteNodes()) {
checkTransactionConfiguration(n);
@@ -696,9 +686,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
checkCache(locCfg, rmtCfg, n);
// Check plugin cache configurations.
- CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
-
- assert pluginMgr != null : " Map=" + cache2PluginMgr;
+ CachePluginManager pluginMgr = desc.pluginManager();
pluginMgr.validateRemotes(rmtCfg, n);
}
@@ -721,9 +709,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (filter.apply(locNode)) {
CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
- CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
-
- assert pluginMgr != null : " Map=" + cache2PluginMgr;
+ CachePluginManager pluginMgr = desc.pluginManager();
GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
@@ -1657,6 +1643,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (existing == null) {
DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+ ctx,
ccfg,
req.cacheType(),
true,
@@ -1690,6 +1677,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
assert req.cacheType() != null : req;
DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+ ctx,
ccfg,
req.cacheType(),
false,
@@ -2039,7 +2027,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (desc == null) {
DynamicCacheDescriptor templateDesc =
- new DynamicCacheDescriptor(ccfg, req.cacheType(), true, req.deploymentId());
+ new DynamicCacheDescriptor(ctx, ccfg, req.cacheType(), true, req.deploymentId());
DynamicCacheDescriptor old = registeredTemplates.put(maskNull(ccfg.getName()), templateDesc);
@@ -2093,7 +2081,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
assert req.cacheType() != null : req;
DynamicCacheDescriptor startDesc =
- new DynamicCacheDescriptor(ccfg, req.cacheType(), false, req.deploymentId());
+ new DynamicCacheDescriptor(ctx, ccfg, req.cacheType(), false, req.deploymentId());
DynamicCacheDescriptor old = registeredCaches.put(maskNull(ccfg.getName()), startDesc);
[20/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by vo...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0c13a08b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0c13a08b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0c13a08b
Branch: refs/heads/ignite-gg-9614
Commit: 0c13a08b7a0fa9e33fadadd3c4472556be338d70
Parents: c3f3dd1
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu May 7 11:00:19 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu May 7 11:00:19 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 14 ++++----------
31 files changed, 34 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 9dda753..3ac5a80 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index ef44603..38a593e 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 43f24bc..83eced2 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca93673..c90173f 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 8cb97d0..ddc2858 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9e03dab..15c3d5d 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62612f8..e3a7b97 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 0f8fdc0..cc6843f 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index df69c93..980db73 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 8b2a019..e4198b8 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 1ce3370..dc7a454 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 231808f..fba22c1 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index ed4dc07..f7d0443 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 6ff6039..e808ca3 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 8a3cec3..061e27c 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 9287f12..b6e0928 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index dff0a7e..d855911 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 9097614..95800ac 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 590d3f7..3160cc2 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 2c09ed9..4cda672 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 0684d11..51b5ff0 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 1f78f42..d7109c2 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 1390a39..26dfc14 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 867e9be..82a7983 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 625eeaa..b38de40 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 231a576..c711902 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 07e27a0..a70dd2c 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 4e58ab8..96e7b17 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index de50712..92f9aa7 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 6bd65cc..7298f6b 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c13a08b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c859021..3dafeed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,12 +32,12 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
- <!--fix <attachartifact>...</> at apache-release profile if changed-->
+ <!--fix <attachartifact>...< /> at apache-release profile if changed-->
<ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-incubating</ignite.zip.pattern>
</properties>
@@ -508,14 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact
- file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip"
- classifier="fabric"
- type="zip"/>
- <attachartifact
- file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip"
- classifier="hadoop"
- type="zip"/>
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
[05/50] [abbrv] incubator-ignite git commit: #ignite-834:
IgniteCache.clearAll() throws NPE. #ignite-732: IgniteCache.size() should not
fail in case of topology changes.
Posted by vo...@apache.org.
#ignite-834: IgniteCache.clearAll() throws NPE.
#ignite-732: IgniteCache.size() should not fail in case of topology changes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/99c7e228
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/99c7e228
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/99c7e228
Branch: refs/heads/ignite-gg-9614
Commit: 99c7e228d12e25826f74d6d8706d158ec36004ed
Parents: 9ff8029
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed May 6 12:30:57 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed May 6 12:30:57 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 511 +++++++++----------
.../resources/META-INF/classnames.properties | 6 +-
2 files changed, 248 insertions(+), 269 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99c7e228/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 3f4e97b..6674993 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -21,10 +21,10 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
-import org.apache.ignite.internal.compute.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.affinity.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
@@ -1083,7 +1083,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
// Clear local cache synchronously.
clearLocally();
- clearRemotes(0, new GlobalClearAllCallable(name()));
+ clearRemotes(0, null);
}
/** {@inheritDoc} */
@@ -1091,7 +1091,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
// Clear local cache synchronously.
clearLocally(key);
- clearRemotes(0, new GlobalClearKeySetCallable<K, V>(name(), Collections.singleton(key)));
+ clearRemotes(0, Collections.singleton(key));
}
/** {@inheritDoc} */
@@ -1099,83 +1099,55 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
// Clear local cache synchronously.
clearLocallyAll(keys);
- clearRemotes(0, new GlobalClearKeySetCallable<K, V>(name(), keys));
+ clearRemotes(0, keys);
}
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> clearAsync(K key) {
- return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), Collections.singleton(key)));
+ return clearKeysAsync(Collections.singleton(key));
}
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> clearAsync(Set<? extends K> keys) {
- return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), keys));
+ return clearKeysAsync(keys);
}
/**
* @param timeout Timeout for clearLocally all task in milliseconds (0 for never).
* Set it to larger value for large caches.
- * @param clearCall Global clear callable object.
+ * @param keys Keys to clear or {@code null} if all cache should be cleared.
* @throws IgniteCheckedException In case of cache could not be cleared on any of the nodes.
*/
- private void clearRemotes(long timeout, GlobalClearCallable clearCall) throws IgniteCheckedException {
- try {
- // Send job to remote nodes only.
- Collection<ClusterNode> nodes =
- ctx.grid().cluster().forCacheNodes(name(), true, true, false).forRemotes().nodes();
-
- IgniteInternalFuture<Object> fut = null;
-
- if (!nodes.isEmpty()) {
- ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, timeout);
+ private void clearRemotes(long timeout, @Nullable final Set<? extends K> keys) throws IgniteCheckedException {
+ // Send job to remote nodes only.
+ Collection<ClusterNode> nodes =
+ ctx.grid().cluster().forCacheNodes(name(), true, true, false).forRemotes().nodes();
- fut = ctx.closures().callAsyncNoFailover(BROADCAST, clearCall, nodes, true);
- }
+ if (!nodes.isEmpty()) {
+ ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, timeout);
- if (fut != null)
- fut.get();
- }
- catch (ClusterGroupEmptyCheckedException ignore) {
- if (log.isDebugEnabled())
- log.debug("All remote nodes left while cache clearLocally [cacheName=" + name() + "]");
- }
- catch (ComputeTaskTimeoutCheckedException e) {
- U.warn(log, "Timed out waiting for remote nodes to finish cache clear (consider increasing " +
- "'networkTimeout' configuration property) [cacheName=" + name() + "]");
+ ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
- throw e;
+ ctx.kernalContext().task().execute(new ClearTask(ctx, keys), null).get();
}
}
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> clearAsync() {
- return clearAsync(new GlobalClearAllCallable(name()));
+ return clearKeysAsync(null);
}
/**
- * @param clearCall Global clear callable object.
+ * @param keys Keys to clear or {@code null} if all cache should be cleared.
* @return Future.
*/
- private IgniteInternalFuture<?> clearAsync(GlobalClearCallable clearCall) {
+ private IgniteInternalFuture<?> clearKeysAsync(final Set<? extends K> keys) {
Collection<ClusterNode> nodes = ctx.grid().cluster().forCacheNodes(name(), true, true, false).nodes();
if (!nodes.isEmpty()) {
- IgniteInternalFuture<Object> fut =
- ctx.closures().callAsyncNoFailover(BROADCAST, clearCall, nodes, true);
+ ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
- return fut.chain(new CX1<IgniteInternalFuture<Object>, Object>() {
- @Override public Object applyx(IgniteInternalFuture<Object> fut) throws IgniteCheckedException {
- try {
- return fut.get();
- }
- catch (ClusterGroupEmptyCheckedException ignore) {
- if (log.isDebugEnabled())
- log.debug("All remote nodes left while cache clearLocally [cacheName=" + name() + "]");
-
- return null;
- }
- }
- });
+ return ctx.kernalContext().task().execute(new ClearTask(ctx, keys), null);
}
else
return new GridFinishedFuture<>();
@@ -3562,7 +3534,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public IgniteInternalFuture<Integer> sizeAsync(CachePeekMode[] peekModes) {
+ @Override public IgniteInternalFuture<Integer> sizeAsync(final CachePeekMode[] peekModes) {
assert peekModes != null;
PeekModes modes = parsePeekModes(peekModes, true);
@@ -3576,22 +3548,9 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (nodes.isEmpty())
return new GridFinishedFuture<>(0);
- IgniteInternalFuture<Collection<Integer>> fut =
- ctx.closures().broadcastNoFailover(new SizeCallable(ctx.name(), peekModes), null, nodes);
-
- return fut.chain(new CX1<IgniteInternalFuture<Collection<Integer>>, Integer>() {
- @Override public Integer applyx(IgniteInternalFuture<Collection<Integer>> fut)
- throws IgniteCheckedException {
- Collection<Integer> res = fut.get();
+ ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
- int totalSize = 0;
-
- for (Integer size : res)
- totalSize += size;
-
- return totalSize;
- }
- });
+ return ctx.kernalContext().task().execute(new SizeTask(ctx, peekModes), null);
}
/** {@inheritDoc} */
@@ -3909,50 +3868,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
- * Gets cache global size (with or without backups).
- *
- * @param primaryOnly {@code True} if only primary sizes should be included.
- * @return Global size.
- * @throws IgniteCheckedException If internal task execution failed.
- */
- private int globalSize(boolean primaryOnly) throws IgniteCheckedException {
- try {
- // Send job to remote nodes only.
- Collection<ClusterNode> nodes = ctx.grid().cluster().forCacheNodes(name()).forRemotes().nodes();
-
- IgniteInternalFuture<Collection<Integer>> fut = null;
-
- if (!nodes.isEmpty()) {
- ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, gridCfg.getNetworkTimeout());
-
- fut = ctx.closures().broadcastNoFailover(new GlobalSizeCallable(name(), primaryOnly), null, nodes);
- }
-
- // Get local value.
- int globalSize = primaryOnly ? primarySize() : size();
-
- if (fut != null) {
- for (Integer i : fut.get())
- globalSize += i;
- }
-
- return globalSize;
- }
- catch (ClusterGroupEmptyCheckedException ignore) {
- if (log.isDebugEnabled())
- log.debug("All remote nodes left while cache clearLocally [cacheName=" + name() + "]");
-
- return primaryOnly ? primarySize() : size();
- }
- catch (ComputeTaskTimeoutCheckedException e) {
- U.warn(log, "Timed out waiting for remote nodes to finish cache clear (consider increasing " +
- "'networkTimeout' configuration property) [cacheName=" + name() + "]");
-
- throw e;
- }
- }
-
- /**
* @param op Cache operation.
* @param <T> Return type.
* @return Operation result.
@@ -4893,67 +4808,32 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
- * Internal callable which performs clear operation on a cache with the given name.
- */
- @GridInternal
- private static abstract class GlobalClearCallable implements Callable<Object>, Externalizable {
- /** Cache name. */
- protected String cacheName;
-
- /** Injected grid instance. */
- @IgniteInstanceResource
- protected Ignite ignite;
-
- /**
- * Empty constructor for serialization.
- */
- public GlobalClearCallable() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- */
- protected GlobalClearCallable(String cacheName) {
- this.cacheName = cacheName;
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- }
- }
-
- /**
* Global clear all.
*/
@GridInternal
- private static class GlobalClearAllCallable extends GlobalClearCallable {
+ private static class GlobalClearAllJob extends TopologyVersionAwareJob {
/** */
private static final long serialVersionUID = 0L;
/**
* Empty constructor for serialization.
*/
- public GlobalClearAllCallable() {
+ public GlobalClearAllJob() {
// No-op.
}
/**
* @param cacheName Cache name.
+ * @param topVer Affinity topology version.
*/
- private GlobalClearAllCallable(String cacheName) {
- super(cacheName);
+ private GlobalClearAllJob(String cacheName, AffinityTopologyVersion topVer) {
+ super(cacheName, topVer);
}
/** {@inheritDoc} */
- @Override public Object call() throws Exception {
- ((IgniteEx)ignite).cachex(cacheName).clearLocally();
+ @Nullable @Override public Object localExecute(@Nullable IgniteInternalCache cache) {
+ if (cache != null)
+ cache.clearLocally();
return null;
}
@@ -4963,7 +4843,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* Global clear keys.
*/
@GridInternal
- private static class GlobalClearKeySetCallable<K, V> extends GlobalClearCallable {
+ private static class GlobalClearKeySetJob<K> extends TopologyVersionAwareJob {
/** */
private static final long serialVersionUID = 0L;
@@ -4973,166 +4853,75 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/**
* Empty constructor for serialization.
*/
- public GlobalClearKeySetCallable() {
+ public GlobalClearKeySetJob() {
// No-op.
}
/**
* @param cacheName Cache name.
+ * @param topVer Affinity topology version.
* @param keys Keys to clear.
*/
- private GlobalClearKeySetCallable(String cacheName, Set<? extends K> keys) {
- super(cacheName);
+ private GlobalClearKeySetJob(String cacheName, AffinityTopologyVersion topVer, Set<? extends K> keys) {
+ super(cacheName, topVer);
this.keys = keys;
}
/** {@inheritDoc} */
- @Override public Object call() throws Exception {
- ((IgniteEx)ignite).<K, V>cachex(cacheName).clearLocallyAll(keys);
+ @Nullable @Override public Object localExecute(@Nullable IgniteInternalCache cache) {
+ if (cache != null)
+ cache.clearLocallyAll(keys);
return null;
}
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
-
- out.writeObject(keys);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
-
- keys = (Set<K>) in.readObject();
- }
}
/**
* Internal callable for global size calculation.
*/
@GridInternal
- private static class SizeCallable extends IgniteClosureX<Object, Integer> implements Externalizable {
+ private static class SizeJob extends TopologyVersionAwareJob {
/** */
private static final long serialVersionUID = 0L;
- /** Cache name. */
- private String cacheName;
-
/** Peek modes. */
private CachePeekMode[] peekModes;
- /** Injected grid instance. */
- @IgniteInstanceResource
- private Ignite ignite;
-
/**
* Required by {@link Externalizable}.
*/
- public SizeCallable() {
+ public SizeJob() {
// No-op.
}
/**
* @param cacheName Cache name.
+ * @param topVer Affinity topology version.
* @param peekModes Cache peek modes.
*/
- private SizeCallable(String cacheName, CachePeekMode[] peekModes) {
- this.cacheName = cacheName;
- this.peekModes = peekModes;
- }
-
- /** {@inheritDoc} */
- @Override public Integer applyx(Object o) throws IgniteCheckedException {
- IgniteInternalCache<Object, Object> cache = ((IgniteEx)ignite).cachex(cacheName);
-
- assert cache != null : cacheName;
-
- return cache.localSize(peekModes);
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("ForLoopReplaceableByForEach")
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
-
- out.writeInt(peekModes.length);
+ private SizeJob(String cacheName, AffinityTopologyVersion topVer, CachePeekMode[] peekModes) {
+ super(cacheName, topVer);
- for (int i = 0; i < peekModes.length; i++)
- U.writeEnum(out, peekModes[i]);
+ this.peekModes = peekModes;
}
/** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
-
- int len = in.readInt();
+ @Nullable @Override public Object localExecute(@Nullable IgniteInternalCache cache) {
+ if (cache == null)
+ return 0;
- peekModes = new CachePeekMode[len];
-
- for (int i = 0; i < len; i++)
- peekModes[i] = CachePeekMode.fromOrdinal(in.readByte());
+ try {
+ return cache.localSize(peekModes);
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/** {@inheritDoc} */
public String toString() {
- return S.toString(SizeCallable.class, this);
- }
- }
-
- /**
- * Internal callable which performs {@link IgniteInternalCache#size()} or {@link IgniteInternalCache#primarySize()}
- * operation on a cache with the given name.
- */
- @GridInternal
- private static class GlobalSizeCallable implements IgniteClosure<Object, Integer>, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /** Primary only flag. */
- private boolean primaryOnly;
-
- /** Injected grid instance. */
- @IgniteInstanceResource
- private Ignite ignite;
-
- /**
- * Empty constructor for serialization.
- */
- public GlobalSizeCallable() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- * @param primaryOnly Primary only flag.
- */
- private GlobalSizeCallable(String cacheName, boolean primaryOnly) {
- this.cacheName = cacheName;
- this.primaryOnly = primaryOnly;
- }
-
- /** {@inheritDoc} */
- @Override public Integer apply(Object o) {
- IgniteInternalCache<Object, Object> cache = ((IgniteEx)ignite).cachex(cacheName);
-
- return primaryOnly ? cache.primarySize() : cache.size();
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- out.writeBoolean(primaryOnly);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- primaryOnly = in.readBoolean();
+ return S.toString(SizeJob.class, this);
}
}
@@ -5697,4 +5486,194 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
metrics.addPutAndGetTimeNanos(System.nanoTime() - start);
}
}
+
+ /**
+ * Delayed callable class.
+ */
+ protected static abstract class TopologyVersionAwareJob extends ComputeJobAdapter {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Injected job context. */
+ @JobContextResource
+ protected ComputeJobContext jobCtx;
+
+ /** Injected grid instance. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Affinity topology version. */
+ protected AffinityTopologyVersion topVer;
+
+ /** Cache name. */
+ protected String cacheName;
+
+ /**
+ * Empty constructor for serialization.
+ */
+ public TopologyVersionAwareJob() {
+ // No-op.
+ }
+
+ /**
+ * @param cacheName Cache name.
+ * @param topVer Affinity topology version.
+ */
+ public TopologyVersionAwareJob(String cacheName, AffinityTopologyVersion topVer) {
+ assert topVer != null;
+
+ this.cacheName = cacheName;
+ this.topVer = topVer;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public final Object execute() {
+ waitAffinityReadyFuture();
+
+ IgniteInternalCache cache = ((IgniteKernal)ignite).context().cache().cache(cacheName);
+
+ return localExecute(cache);
+ }
+
+ /**
+ * @param cache Cache.
+ * @return Local execution result.
+ */
+ @Nullable protected abstract Object localExecute(@Nullable IgniteInternalCache cache);
+
+ /**
+ * Holds (suspends) job execution until our cache version becomes equal to remote cache's version.
+ */
+ private void waitAffinityReadyFuture() {
+ GridCacheProcessor cacheProc = ((IgniteKernal)ignite).context().cache();
+
+ AffinityTopologyVersion locTopVer = cacheProc.context().exchange().readyAffinityVersion();
+
+ if (locTopVer.compareTo(topVer) < 0) {
+ IgniteInternalFuture<?> fut = cacheProc.context().exchange().affinityReadyFuture(topVer);
+
+ if (fut != null && !fut.isDone()) {
+ fut.listen(new CI1<IgniteInternalFuture<?>>() {
+ @Override public void apply(IgniteInternalFuture<?> t) {
+ jobCtx.callcc();
+ }
+ });
+
+ jobCtx.holdcc();
+ }
+ }
+ }
+ }
+
+ /**
+ * Size task.
+ */
+ private static class SizeTask extends ComputeTaskAdapter<Object, Integer> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Cache context. */
+ private GridCacheContext ctx;
+
+ /** Peek modes. */
+ private CachePeekMode[] peekModes;
+
+ /**
+ * Empty constructor for serialization.
+ */
+ public SizeTask() {
+ // No-op.
+ }
+
+ /**
+ * @param ctx Cache context.
+ */
+ public SizeTask(GridCacheContext ctx, CachePeekMode[] peekModes) {
+ this.ctx = ctx;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @Nullable Object arg) throws IgniteException {
+ Map<ComputeJob, ClusterNode> jobs = new HashMap();
+
+ for (ClusterNode node : subgrid)
+ jobs.put(new SizeJob(ctx.name(), ctx.affinity().affinityTopologyVersion(), peekModes), node);
+
+ return jobs;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) {
+ return ComputeJobResultPolicy.WAIT;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteException {
+ int size = 0;
+
+ for (ComputeJobResult res : results) {
+ if (res.getException() == null && res != null)
+ size += res.<Integer>getData();
+ }
+
+ return size;
+ }
+ }
+
+ /**
+ * Clear task.
+ */
+ private static class ClearTask<K> extends ComputeTaskAdapter<Object, Object> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Cache context. */
+ private GridCacheContext ctx;
+
+ /** Keys to clear. */
+ private Set<? extends K> keys;
+
+ /**
+ * Empty constructor for serialization.
+ */
+ public ClearTask() {
+ // No-op.
+ }
+
+ /**
+ * @param ctx Cache context.
+ * @param keys Keys to clear.
+ */
+ public ClearTask(GridCacheContext ctx, Set<? extends K> keys) {
+ this.ctx = ctx;
+ this.keys = keys;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @Nullable Object arg) throws IgniteException {
+ Map<ComputeJob, ClusterNode> jobs = new HashMap();
+
+ for (ClusterNode node : subgrid) {
+ jobs.put(keys == null ?
+ new GlobalClearAllJob(ctx.name(), ctx.affinity().affinityTopologyVersion()) :
+ new GlobalClearKeySetJob<K>(ctx.name(), ctx.affinity().affinityTopologyVersion(), keys),
+ node);
+ }
+
+ return jobs;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) {
+ return ComputeJobResultPolicy.WAIT;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteException {
+ return null;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99c7e228/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 35495ed..ff263cd 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -323,13 +323,13 @@ org.apache.ignite.internal.processors.cache.GridCacheAdapter$72
org.apache.ignite.internal.processors.cache.GridCacheAdapter$73
org.apache.ignite.internal.processors.cache.GridCacheAdapter$74
org.apache.ignite.internal.processors.cache.GridCacheAdapter$9
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalClearAllCallable
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalClearAllJob
org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalClearCallable
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalClearKeySetCallable
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalClearKeySetJob
org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalSizeCallable
org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure
org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadKeysCallable
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$SizeCallable
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$SizeJob
org.apache.ignite.internal.processors.cache.GridCacheAdapter$UpdateGetTimeStatClosure
org.apache.ignite.internal.processors.cache.GridCacheAdapter$UpdatePutAndGetTimeStatClosure
org.apache.ignite.internal.processors.cache.GridCacheAdapter$UpdatePutTimeStatClosure
[07/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-157-2' into ignite-sprint-4
Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-157-2' into ignite-sprint-4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ba210bbb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ba210bbb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ba210bbb
Branch: refs/heads/ignite-gg-9614
Commit: ba210bbbfec66f4ff8913550e1e3b43ba65cf0e1
Parents: 99c7e22 f5f95fb
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 6 12:41:02 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 6 12:41:02 2015 +0300
----------------------------------------------------------------------
.../ignite/codegen/MessageCodeGenerator.java | 4 +-
.../communication/GridIoMessageFactory.java | 4 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 434 ---------------
...idCacheOptimisticCheckPreparedTxRequest.java | 232 --------
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -------
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++++++++++++++++++
.../distributed/GridCacheTxRecoveryRequest.java | 261 +++++++++
.../GridCacheTxRecoveryResponse.java | 182 +++++++
.../GridDistributedTxRemoteAdapter.java | 2 +-
.../cache/transactions/IgniteInternalTx.java | 5 +-
.../cache/transactions/IgniteTxAdapter.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 38 +-
.../transactions/IgniteTxLocalAdapter.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 173 ++----
.../resources/META-INF/classnames.properties | 6 +-
.../GridCacheAbstractFailoverSelfTest.java | 4 +-
.../GridCacheAbstractNodeRestartSelfTest.java | 94 ++--
...xOriginatingNodeFailureAbstractSelfTest.java | 2 +-
...rDisabledPrimaryNodeFailureRecoveryTest.java | 31 ++
...rtitionedPrimaryNodeFailureRecoveryTest.java | 31 ++
...woBackupsPrimaryNodeFailureRecoveryTest.java | 37 ++
...ePrimaryNodeFailureRecoveryAbstractTest.java | 533 +++++++++++++++++++
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCacheReplicatedNodeRestartSelfTest.java | 2 +
.../testsuites/IgniteCacheRestartTestSuite.java | 4 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 3 -
.../IgniteCacheTxRecoverySelfTestSuite.java | 4 +
28 files changed, 1737 insertions(+), 1046 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba210bbb/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
[40/50] [abbrv] incubator-ignite git commit: hot fix of ignite-869
Posted by vo...@apache.org.
hot fix of ignite-869
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a983125a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a983125a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a983125a
Branch: refs/heads/ignite-gg-9614
Commit: a983125a2b68448e66b22e5df2e023cd6536be73
Parents: 17bf271
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri May 8 15:15:40 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri May 8 15:15:40 2015 +0300
----------------------------------------------------------------------
.../tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a983125a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
index 7ac1994..aba0760 100644
--- a/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
+++ b/modules/cloud/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinderSelfTest.java
@@ -107,8 +107,6 @@ public class TcpDiscoveryCloudIpFinderSelfTest extends
Collection<InetSocketAddress> addresses = ipFinder.getRegisteredAddresses();
- assert addresses.size() > 0;
-
for (InetSocketAddress addr : addresses)
info("Registered instance: " + addr.getAddress().getHostAddress() + ":" + addr.getPort());
[22/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by vo...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dfeceafa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dfeceafa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dfeceafa
Branch: refs/heads/ignite-gg-9614
Commit: dfeceafa9c82be6639de4e2fb86510b63a4f01e0
Parents: 5166142
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 13:05:54 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 13:05:54 2015 +0300
----------------------------------------------------------------------
pom.xml | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dfeceafa/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3dafeed..7614422 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-<modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.ignite</groupId>
@@ -37,8 +37,9 @@
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
+ <ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
<!--fix <attachartifact>...< /> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-incubating</ignite.zip.pattern>
+ <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
<scm>
@@ -51,7 +52,7 @@
<distributionManagement>
<site>
<id>ignite-site</id>
- <url>${ignite.site}/${project.artifactId}-${project.version}</url>
+ <url>${ignite.site}/${ignite.site.folder}</url>
</site>
</distributionManagement>
@@ -116,7 +117,6 @@
<id>dev-libs</id>
<activation>
<activeByDefault>true</activeByDefault>
- <jdk>[1.7,)</jdk>
</activation>
<build>
<plugins>
@@ -488,7 +488,7 @@
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
</descriptorRefs>
<tarLongFileMode>gnu</tarLongFileMode>
- <finalName>incubator-ignite-${project.version}-src</finalName>
+ <finalName>ignite-${project.version}-src</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
@@ -508,8 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip" classifier="fabric" type="zip" />
- <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip" classifier="hadoop" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
@@ -556,7 +556,7 @@
<fileSet>
<directory>${basedir}/target</directory>
<includes>
- <include>incubator-ignite-${project.version}-src.zip</include>
+ <include>ignite-${project.version}-src.zip</include>
<include>bin/*.zip</include>
</includes>
</fileSet>
@@ -584,10 +584,10 @@
<failOnError>false</failOnError>
<target>
<mkdir dir="${basedir}/target/site" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.asc" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.md5" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.sha1" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip" tofile="${basedir}/target/site/ignite-${project.version}-src.zip" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.asc" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.md5" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.sha1" failonerror="false" />
<copy todir="${basedir}/target/site">
<fileset dir="${basedir}/target/bin">
<include name="**/*" />
[17/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by vo...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/823f8a37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/823f8a37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/823f8a37
Branch: refs/heads/ignite-gg-9614
Commit: 823f8a373bd0f290c8781eeec24fcaf0862419dc
Parents: 5cefca0
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 6 20:46:21 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 6 20:46:21 2015 +0300
----------------------------------------------------------------------
pom.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/823f8a37/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fc9ca04..205d286 100644
--- a/pom.xml
+++ b/pom.xml
@@ -117,7 +117,6 @@
<id>dev-libs</id>
<activation>
<activeByDefault>true</activeByDefault>
- <jdk>[1.7,)</jdk>
</activation>
<build>
<plugins>
[50/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-5' into ignite-sprint-5
Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f6012f1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f6012f1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f6012f1e
Branch: refs/heads/ignite-gg-9614
Commit: f6012f1e802be3ade9efd53d79ec6b85df5a4c8c
Parents: e6ca757 f4a3591
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 18:54:49 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 18:54:49 2015 +0300
----------------------------------------------------------------------
.../processors/resource/GridResourceField.java | 11 +
.../processors/resource/GridResourceIoc.java | 387 ++++++-------------
.../processors/resource/GridResourceMethod.java | 13 +
.../resource/GridResourceProcessor.java | 4 +-
.../ignite/internal/util/IgniteUtils.java | 15 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 24 +-
6 files changed, 191 insertions(+), 263 deletions(-)
----------------------------------------------------------------------
[18/50] [abbrv] incubator-ignite git commit: "Version changed
Posted by vo...@apache.org.
"Version changed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6bfb1d86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6bfb1d86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6bfb1d86
Branch: refs/heads/ignite-gg-9614
Commit: 6bfb1d86e59f03eff62c799d5e6838bdd58ea1bb
Parents: 823f8a3
Author: Ignite Teamcity <ig...@apache.org>
Authored: Wed May 6 23:40:35 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Wed May 6 23:40:35 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 14 ++++----------
31 files changed, 34 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 9dda753..fa6e3b1 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index ef44603..f09d120 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 43f24bc..57347b1 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca93673..cc6aa23 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 8cb97d0..3bd9102 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9e03dab..58d5c79 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62612f8..26e42aa 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 0f8fdc0..3834c6e 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index df69c93..d82c224 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 8b2a019..ec14da5 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 1ce3370..18b2dad 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 231808f..7acf7b1 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index ed4dc07..d04b30b 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 6ff6039..289e2fd 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 8a3cec3..e7719b5 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 9287f12..f6aa3dc 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index dff0a7e..f4ca6b1 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 9097614..e95411c 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 590d3f7..91b16e7 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 2c09ed9..d89430a 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 0684d11..d8da0da 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 1f78f42..6425f8c 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 1390a39..3e7cbe7 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 867e9be..3b6a8ef 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 625eeaa..c4c80ab 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 231a576..2538b9c 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 07e27a0..2af6442 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 4e58ab8..634ac5d 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index de50712..674fc2a 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 6bd65cc..a149db3 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6bfb1d86/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 205d286..aa3be2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,13 +32,13 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1.0-incubating-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
<ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
- <!--fix <attachartifact>...</> at apache-release profile if changed-->
+ <!--fix <attachartifact>...< /> at apache-release profile if changed-->
<ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
@@ -508,14 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact
- file="${basedir}/target/bin/ignite-fabric-${project.version}.zip"
- classifier="fabric"
- type="zip"/>
- <attachartifact
- file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip"
- classifier="hadoop"
- type="zip"/>
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
[39/50] [abbrv] incubator-ignite git commit: #ignite-481: "Server
nodes not found" warning in IgfsDeleteWorker use LT.
Posted by vo...@apache.org.
#ignite-481: "Server nodes not found" warning in IgfsDeleteWorker use LT.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f62afc62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f62afc62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f62afc62
Branch: refs/heads/ignite-gg-9614
Commit: f62afc62a5794272411d0fe25b46e8724fd77209
Parents: ef2bed9
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri May 8 14:25:36 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri May 8 14:25:36 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f62afc62/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
index 250b3a0..1b2d3fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.managers.eventstorage.*;
import org.apache.ignite.internal.util.future.*;
@@ -155,6 +156,9 @@ public class IgfsDeleteWorker extends IgfsThread {
try {
info = meta.info(TRASH_ID);
}
+ catch(ClusterTopologyServerNotFoundException e) {
+ LT.warn(log, e, "Server nodes not found.");
+ }
catch (IgniteCheckedException e) {
U.error(log, "Cannot obtain trash directory info.", e);
}
[10/50] [abbrv] incubator-ignite git commit: #ignite-841:
NullPointerException at IgfsMetaManager.onKernalStart0
(IgfsMetaManager.java:115).
Posted by vo...@apache.org.
#ignite-841: NullPointerException at IgfsMetaManager.onKernalStart0 (IgfsMetaManager.java:115).
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a452dac2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a452dac2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a452dac2
Branch: refs/heads/ignite-gg-9614
Commit: a452dac26c47ac10586f1f49bc26f03b6b5e6fd4
Parents: d4908f2
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed May 6 13:44:30 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed May 6 13:44:30 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 72 +++++++---
.../processors/igfs/IgfsDataManager.java | 3 +
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../igfs/IgfsClientCacheSelfTest.java | 132 +++++++++++++++++++
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
.../ignite/testsuites/IgniteIgfsTestSuite.java | 2 +
6 files changed, 192 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a452dac2/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 2b9a821..0e1a9c2 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
@@ -2452,6 +2452,24 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
/**
+ * @param name Cache name.
+ * @return Cache instance for given name.
+ * @throws IgniteCheckedException If failed.
+ */
+ @SuppressWarnings("unchecked")
+ public <K, V> IgniteInternalCache<K, V> getOrStartCache(@Nullable String name) throws IgniteCheckedException {
+ if (log.isDebugEnabled())
+ log.debug("Getting cache for name: " + name);
+
+ IgniteCache<K, V> jcache = (IgniteCache<K, V>)jCacheProxies.get(maskNull(name));
+
+ if (jcache == null)
+ jcache = startJCache(name, true);
+
+ return jcache == null ? null : ((IgniteCacheProxy<K, V>)jcache).internalProxy();
+ }
+
+ /**
* @return All configured cache instances.
*/
public Collection<IgniteInternalCache<?, ?>> caches() {
@@ -2558,37 +2576,53 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (desc != null && !desc.cacheType().userCache())
throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName);
- if (cache == null) {
- if (desc == null || desc.cancelled()) {
- if (failIfNotStarted)
- throw new IllegalArgumentException("Cache is not started: " + cacheName);
+ if (cache == null)
+ cache = startJCache(cacheName, failIfNotStarted);
- return null;
- }
+ return cache;
+ }
- DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId());
+ /**
+ * @param cacheName Cache name.
+ * @param failIfNotStarted If {@code true} throws {@link IllegalArgumentException} if cache is not started,
+ * otherwise returns {@code null} in this case.
+ * @return Cache instance for given name.
+ * @throws IgniteCheckedException If failed.
+ */
+ private IgniteCache startJCache(String cacheName, boolean failIfNotStarted) throws IgniteCheckedException {
+ String masked = maskNull(cacheName);
- req.cacheName(cacheName);
+ DynamicCacheDescriptor desc = registeredCaches.get(masked);
- req.deploymentId(desc.deploymentId());
+ if (desc == null || desc.cancelled()) {
+ if (failIfNotStarted)
+ throw new IllegalArgumentException("Cache is not started: " + cacheName);
- CacheConfiguration cfg = new CacheConfiguration(desc.cacheConfiguration());
+ return null;
+ }
- cfg.setNearConfiguration(null);
+ DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId());
- req.startCacheConfiguration(cfg);
+ req.cacheName(cacheName);
- req.cacheType(desc.cacheType());
+ req.deploymentId(desc.deploymentId());
- req.clientStartOnly(true);
+ CacheConfiguration cfg = new CacheConfiguration(desc.cacheConfiguration());
- F.first(initiateCacheChanges(F.asList(req))).get();
+ cfg.setNearConfiguration(null);
- cache = (IgniteCache<K, V>)jCacheProxies.get(masked);
+ req.startCacheConfiguration(cfg);
- if (cache == null && failIfNotStarted)
- throw new IllegalArgumentException("Cache is not started: " + cacheName);
- }
+ req.cacheType(desc.cacheType());
+
+ req.clientStartOnly(true);
+
+ F.first(initiateCacheChanges(F.asList(req))).get();
+
+ IgniteCache cache = jCacheProxies.get(masked);
+
+ if (cache == null && failIfNotStarted)
+ throw new IllegalArgumentException("Cache is not started: " + cacheName);
return cache;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a452dac2/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index 319b696..aa6427d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -202,7 +202,10 @@ public class IgfsDataManager extends IgfsManager {
/** {@inheritDoc} */
@Override protected void onKernalStart0() throws IgniteCheckedException {
+ igfsCtx.kernalContext().cache().getOrStartCache(igfsCtx.configuration().getDataCacheName());
dataCachePrj = igfsCtx.kernalContext().cache().internalCache(igfsCtx.configuration().getDataCacheName());
+
+ igfsCtx.kernalContext().cache().getOrStartCache(igfsCtx.configuration().getDataCacheName());
dataCache = igfsCtx.kernalContext().cache().internalCache(igfsCtx.configuration().getDataCacheName());
metrics = igfsCtx.igfs().localMetrics();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a452dac2/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 35ca8bb..e33e0d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -108,7 +108,7 @@ public class IgfsMetaManager extends IgfsManager {
/** {@inheritDoc} */
@Override protected void onKernalStart0() throws IgniteCheckedException {
- metaCache = igfsCtx.kernalContext().cache().cache(cfg.getMetaCacheName());
+ metaCache = igfsCtx.kernalContext().cache().getOrStartCache(cfg.getMetaCacheName());
assert metaCache != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a452dac2/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
new file mode 100644
index 0000000..d983302
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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.igfs;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Test for igfs with nodes in client mode (see {@link IgniteConfiguration#setClientMode(boolean)}.
+ */
+public class IgfsClientCacheSelfTest extends IgfsAbstractSelfTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** Meta-information cache name. */
+ private static final String META_CACHE_NAME = "meta";
+
+ /** Data cache name. */
+ private static final String DATA_CACHE_NAME = null;
+
+ /** Regular cache name. */
+ private static final String CACHE_NAME = "cache";
+
+ /**
+ * Constructor.
+ */
+ public IgfsClientCacheSelfTest() {
+ super(IgfsMode.PRIMARY);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ igfsSecondaryFileSystem = createSecondaryFileSystemStack();
+
+ Ignite ignite1 = G.start(getConfiguration(getTestGridName(1)));
+
+ igfs = (IgfsImpl) ignite1.fileSystem("igfs");
+ }
+
+ /**{@inheritDoc} */
+ protected IgfsSecondaryFileSystem createSecondaryFileSystemStack() throws Exception {
+ Ignite igniteSecondary = G.start(getConfiguration(getTestGridName(0)));
+
+ IgfsEx secondaryIgfsImpl = (IgfsEx)igniteSecondary.fileSystem("igfs");
+
+ igfsSecondary = new IgfsExUniversalFileSystemAdapter(secondaryIgfsImpl);
+
+ return secondaryIgfsImpl.asSecondary();
+ }
+
+ /**
+ *
+ * @param gridName Grid name.
+ * @return Ignite configuration.
+ * @throws Exception If failed.
+ */
+ protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME),
+ cacheConfiguration(CACHE_NAME));
+
+ if (!gridName.equals(getTestGridName(0)))
+ cfg.setClientMode(true);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(disco);
+
+ FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+ igfsCfg.setMetaCacheName(META_CACHE_NAME);
+ igfsCfg.setDataCacheName(DATA_CACHE_NAME);
+ igfsCfg.setName("igfs");
+
+ cfg.setFileSystemConfiguration(igfsCfg);
+
+ return cfg;
+ }
+
+ /**
+ * @param cacheName Cache name.
+ * @return Cache configuration.
+ */
+ protected CacheConfiguration cacheConfiguration(String cacheName) {
+ CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+ cacheCfg.setName(cacheName);
+
+ if (META_CACHE_NAME.equals(cacheName))
+ cacheCfg.setCacheMode(REPLICATED);
+ else {
+ cacheCfg.setCacheMode(PARTITIONED);
+ cacheCfg.setNearConfiguration(null);
+
+ cacheCfg.setBackups(0);
+ cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+ }
+
+ cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ return cacheCfg;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a452dac2/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
index 57b1010..d377560 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
@@ -154,7 +154,7 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
*/
public void testConfiguration() throws IgniteCheckedException {
IgniteInternalCache metaCache = getFieldValue(fs, "meta", "metaCache");
- GridCacheAdapter dataCache = getFieldValue(fs, "data", "dataCache");
+ IgniteInternalCache dataCache = getFieldValue(fs, "data", "dataCache");
assertNotNull(metaCache);
assertEquals(META_CACHE_NAME, metaCache.name());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a452dac2/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index 11e22b1..4f3178e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -59,6 +59,8 @@ public class IgniteIgfsTestSuite extends TestSuite {
suite.addTest(new TestSuite(IgfsDualSyncSelfTest.class));
suite.addTest(new TestSuite(IgfsDualAsyncSelfTest.class));
+ suite.addTest(new TestSuite(IgfsClientCacheSelfTest.class));
+
suite.addTest(new TestSuite(IgfsModeResolverSelfTest.class));
suite.addTestSuite(IgfsFragmentizerSelfTest.class);
[16/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by vo...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5cefca0f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5cefca0f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5cefca0f
Branch: refs/heads/ignite-gg-9614
Commit: 5cefca0f1473faab4aeb2f149de36c4fdef19460
Parents: 2d0a6e8
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 6 19:18:44 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 6 19:18:44 2015 +0300
----------------------------------------------------------------------
pom.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5cefca0f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1a9fc9c..fc9ca04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,6 +37,7 @@
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
+ <ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
<!--fix <attachartifact>...</> at apache-release profile if changed-->
<ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
@@ -51,7 +52,7 @@
<distributionManagement>
<site>
<id>ignite-site</id>
- <url>${ignite.site}/${project.artifactId}-${project.version}</url>
+ <url>${ignite.site}/${ignite.site.folder}</url>
</site>
</distributionManagement>
[25/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by vo...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cc679f54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cc679f54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cc679f54
Branch: refs/heads/ignite-gg-9614
Commit: cc679f5412d6735f37e9fc54ce4fe4734c6b82cd
Parents: 5f8f6f4
Author: avinogradov <av...@gridgain.com>
Authored: Thu May 7 18:57:43 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Thu May 7 18:57:43 2015 +0300
----------------------------------------------------------------------
pom.xml | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc679f54/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9321a28..aa30216 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
POM file.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-<modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.ignite</groupId>
@@ -37,13 +37,14 @@
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
- <!--fix <attachartifact>...</> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-incubating</ignite.zip.pattern>
+ <ignite.site.folder>${project.artifactId}-${project.version}</ignite.site.folder>
+ <!--fix <attachartifact>...< /> at apache-release profile if changed-->
+ <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
<scm>
<url>https://git-wip-us.apache.org/repos/asf/incubator-ignite</url>
- <connection>scm:git:git://git-wip-us.apache.org/repos/asf/incubator-ignite</connection>
+ <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ignite</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ignite</developerConnection>
<tag>HEAD</tag>
</scm>
@@ -51,7 +52,7 @@
<distributionManagement>
<site>
<id>ignite-site</id>
- <url>${ignite.site}/${project.artifactId}-${project.version}</url>
+ <url>${ignite.site}/${ignite.site.folder}</url>
</site>
</distributionManagement>
@@ -116,7 +117,6 @@
<id>dev-libs</id>
<activation>
<activeByDefault>true</activeByDefault>
- <jdk>[1.7,)</jdk>
</activation>
<build>
<plugins>
@@ -488,7 +488,7 @@
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
</descriptorRefs>
<tarLongFileMode>gnu</tarLongFileMode>
- <finalName>incubator-ignite-${project.version}-src</finalName>
+ <finalName>ignite-${project.version}-src</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
@@ -508,14 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact
- file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip"
- classifier="fabric"
- type="zip"/>
- <attachartifact
- file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip"
- classifier="hadoop"
- type="zip"/>
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
@@ -562,7 +556,7 @@
<fileSet>
<directory>${basedir}/target</directory>
<includes>
- <include>incubator-ignite-${project.version}-src.zip</include>
+ <include>ignite-${project.version}-src.zip</include>
<include>bin/*.zip</include>
</includes>
</fileSet>
@@ -590,10 +584,10 @@
<failOnError>false</failOnError>
<target>
<mkdir dir="${basedir}/target/site" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.asc" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.md5" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.sha1" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip" tofile="${basedir}/target/site/ignite-${project.version}-src.zip" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.asc" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.md5" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.sha1" failonerror="false" />
<copy todir="${basedir}/target/site">
<fileset dir="${basedir}/target/bin">
<include name="**/*" />
[19/50] [abbrv] incubator-ignite git commit: # sprint-4 Fixed
isEmpty() logic.
Posted by vo...@apache.org.
# sprint-4 Fixed isEmpty() logic.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c3f3dd14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c3f3dd14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c3f3dd14
Branch: refs/heads/ignite-gg-9614
Commit: c3f3dd141ba9a3cb1e7044f807e624c57ef38084
Parents: a33d3d4
Author: AKuznetsov <ak...@gridgain.com>
Authored: Thu May 7 13:14:40 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Thu May 7 13:14:40 2015 +0700
----------------------------------------------------------------------
.../ignite/internal/processors/cache/GridCacheAdapter.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3f3dd14/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 6674993..afddc79 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -489,7 +489,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public boolean isEmpty() {
- return values().isEmpty();
+ try {
+ return localSize(CachePeekModes.ONHEAP_ONLY) == 0;
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
}
/** {@inheritDoc} */
[44/50] [abbrv] incubator-ignite git commit: i-478 review
Posted by vo...@apache.org.
i-478 review
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/995b6089
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/995b6089
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/995b6089
Branch: refs/heads/ignite-gg-9614
Commit: 995b60898067b7dd95f33f598fadd579917473d0
Parents: d081046
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 8 16:40:31 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 8 16:40:31 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/resource/GridResourceIoc.java | 2 --
.../ignite/internal/processors/resource/GridResourceProcessor.java | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/995b6089/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
index 301e5e5..c2ef116 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
@@ -91,7 +91,6 @@ class GridResourceIoc {
/**
* @param cls Class.
*/
- @NotNull
private ClassDescriptor descriptor(@Nullable GridDeployment dep, Class<?> cls) {
ClassDescriptor res = clsDescs.get(cls);
@@ -319,7 +318,6 @@ class GridResourceIoc {
for (Map.Entry<Class<? extends Annotation>, T2<List<GridResourceField>, List<GridResourceMethod>>> entry
: annMap.entrySet()) {
-
GridResourceField[] fields = GridResourceField.toArray(entry.getValue().get1());
GridResourceMethod[] mtds = GridResourceMethod.toArray(entry.getValue().get2());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/995b6089/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
index eae5c4b..cb4149b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
@@ -147,6 +147,8 @@ public class GridResourceProcessor extends GridProcessorAdapter {
Method mtd = rsrcMtd.getMethod();
try {
+ // No need to call mtd.setAccessible(true);
+ // It has been called in GridResourceMethod constructor.
mtd.invoke(target);
}
catch (IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
[02/50] [abbrv] incubator-ignite git commit: # GG-10218 Added support
for local query.
Posted by vo...@apache.org.
# GG-10218 Added support for local query.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9ff80298
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9ff80298
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9ff80298
Branch: refs/heads/ignite-gg-9614
Commit: 9ff80298f395315027883ade7771730b6182477f
Parents: 6d2a759
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed May 6 14:23:38 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed May 6 14:23:38 2015 +0700
----------------------------------------------------------------------
.../ignite/internal/visor/query/VisorQueryArg.java | 14 +++++++++++++-
.../ignite/internal/visor/query/VisorQueryJob.java | 2 ++
.../visor/commands/cache/VisorCacheScanCommand.scala | 2 +-
3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ff80298/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
index becebda..5050414 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryArg.java
@@ -32,17 +32,22 @@ public class VisorQueryArg implements Serializable {
/** Query text. */
private final String qryTxt;
+ /** Flag whether to execute query locally. */
+ private final boolean local;
+
/** Result batch size. */
private final int pageSize;
/**
* @param cacheName Cache name for query.
* @param qryTxt Query text.
+ * @param local Flag whether to execute query locally.
* @param pageSize Result batch size.
*/
- public VisorQueryArg(String cacheName, String qryTxt, int pageSize) {
+ public VisorQueryArg(String cacheName, String qryTxt, boolean local, int pageSize) {
this.cacheName = cacheName;
this.qryTxt = qryTxt;
+ this.local = local;
this.pageSize = pageSize;
}
@@ -61,6 +66,13 @@ public class VisorQueryArg implements Serializable {
}
/**
+ * @return {@code true} if query should be executed locally.
+ */
+ public boolean local() {
+ return local;
+ }
+
+ /**
* @return Page size.
*/
public int pageSize() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ff80298/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryJob.java
index ebf62fa..4a9daad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryJob.java
@@ -75,6 +75,7 @@ public class VisorQueryJob extends VisorJob<VisorQueryArg, IgniteBiTuple<? exten
if (scan) {
ScanQuery<Object, Object> qry = new ScanQuery<>(null);
qry.setPageSize(arg.pageSize());
+ qry.setLocal(arg.local());
long start = U.currentTimeMillis();
@@ -100,6 +101,7 @@ public class VisorQueryJob extends VisorJob<VisorQueryArg, IgniteBiTuple<? exten
else {
SqlFieldsQuery qry = new SqlFieldsQuery(arg.queryTxt());
qry.setPageSize(arg.pageSize());
+ qry.setLocal(arg.local());
long start = U.currentTimeMillis();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ff80298/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheScanCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheScanCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheScanCommand.scala
index d40ec8d..4b66720 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheScanCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheScanCommand.scala
@@ -139,7 +139,7 @@ class VisorCacheScanCommand {
val firstPage =
try
executeRandom(groupForDataNode(node, cacheName),
- classOf[VisorQueryTask], new VisorQueryArg(cacheName, "SCAN", pageSize)) match {
+ classOf[VisorQueryTask], new VisorQueryArg(cacheName, "SCAN", false, pageSize)) match {
case x if x.get1() != null =>
error(x.get1())
[04/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-4' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-855
Posted by vo...@apache.org.
Merge branch 'ignite-sprint-4' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-855
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/733f30ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/733f30ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/733f30ee
Branch: refs/heads/ignite-gg-9614
Commit: 733f30eee40b4f9ece2f8c90af2042e85c41fd9f
Parents: eab2e53 9ff8029
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed May 6 11:22:11 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed May 6 11:22:11 2015 +0300
----------------------------------------------------------------------
.../internal/visor/query/VisorQueryArg.java | 14 ++++++-
.../internal/visor/query/VisorQueryJob.java | 2 +
.../internal/GridUpdateNotifierSelfTest.java | 21 +++++++++-
.../ignite/schema/generator/CodeGenerator.java | 41 ++++++++++++--------
.../commands/cache/VisorCacheScanCommand.scala | 2 +-
5 files changed, 60 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
[15/50] [abbrv] incubator-ignite git commit: ignite-853
Posted by vo...@apache.org.
ignite-853
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2d0a6e80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2d0a6e80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2d0a6e80
Branch: refs/heads/ignite-gg-9614
Commit: 2d0a6e80e75ab0e7bb5417fb8815716936736bf6
Parents: a33d3d4
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 6 19:05:04 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 6 19:05:04 2015 +0300
----------------------------------------------------------------------
pom.xml | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d0a6e80/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c859021..1a9fc9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
<properties>
<ignite.site>scp://localhost:/home</ignite.site>
<!--fix <attachartifact>...</> at apache-release profile if changed-->
- <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}-incubating</ignite.zip.pattern>
+ <ignite.zip.pattern>ignite-${ignite.edition}-${project.version}</ignite.zip.pattern>
</properties>
<scm>
@@ -488,7 +488,7 @@
<descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
</descriptorRefs>
<tarLongFileMode>gnu</tarLongFileMode>
- <finalName>incubator-ignite-${project.version}-src</finalName>
+ <finalName>ignite-${project.version}-src</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
@@ -509,11 +509,11 @@
<failOnError>false</failOnError>
<target>
<attachartifact
- file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip"
+ file="${basedir}/target/bin/ignite-fabric-${project.version}.zip"
classifier="fabric"
type="zip"/>
<attachartifact
- file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip"
+ file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip"
classifier="hadoop"
type="zip"/>
</target>
@@ -562,7 +562,7 @@
<fileSet>
<directory>${basedir}/target</directory>
<includes>
- <include>incubator-ignite-${project.version}-src.zip</include>
+ <include>ignite-${project.version}-src.zip</include>
<include>bin/*.zip</include>
</includes>
</fileSet>
@@ -590,10 +590,10 @@
<failOnError>false</failOnError>
<target>
<mkdir dir="${basedir}/target/site" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.asc" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.md5" failonerror="false" />
- <copy file="${basedir}/target/incubator-ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/incubator-ignite-${project.version}-src.zip.sha1" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip" tofile="${basedir}/target/site/ignite-${project.version}-src.zip" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.asc" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.asc" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.md5" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.md5" failonerror="false" />
+ <copy file="${basedir}/target/ignite-${project.version}-src.zip.sha1" tofile="${basedir}/target/site/ignite-${project.version}-src.zip.sha1" failonerror="false" />
<copy todir="${basedir}/target/site">
<fileset dir="${basedir}/target/bin">
<include name="**/*" />
[43/50] [abbrv] incubator-ignite git commit: Merge branches
'ignite-478' and 'ignite-sprint-5' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-478
Posted by vo...@apache.org.
Merge branches 'ignite-478' and 'ignite-sprint-5' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-478
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d0810461
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d0810461
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d0810461
Branch: refs/heads/ignite-gg-9614
Commit: d0810461d61f35cc855998515beb467b49b74246
Parents: eae6f5e 2361640
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 8 16:30:30 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 8 16:30:30 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 34 +-
RELEASE_NOTES.txt | 13 +-
assembly/release-base.xml | 2 +
assembly/release-schema-import.xml | 50 +
dev-tools/.gitignore | 2 +
dev-tools/build.gradle | 45 +
dev-tools/src/main/groovy/jiraslurp.groovy | 146 +
examples/pom.xml | 2 +-
.../streaming/wordcount/CacheConfig.java | 5 -
modules/aop/pom.xml | 2 +-
.../aop/aspectj/GridifyAspectJAspect.java | 2 +-
.../aspectj/GridifySetToSetAspectJAspect.java | 2 +-
.../aspectj/GridifySetToValueAspectJAspect.java | 2 +-
.../aop/spring/GridifySetToSetSpringAspect.java | 2 +-
.../spring/GridifySetToValueSpringAspect.java | 2 +-
.../gridify/aop/spring/GridifySpringAspect.java | 2 +-
modules/aws/pom.xml | 2 +-
.../spi/checkpoint/s3/S3CheckpointSpi.java | 2 +-
.../config/grid-client-config.properties | 50 +-
modules/clients/pom.xml | 2 +-
.../ClientPropertiesConfigurationSelfTest.java | 12 +-
.../clients/src/test/resources/spring-cache.xml | 4 +-
.../src/test/resources/spring-server-node.xml | 4 +-
.../test/resources/spring-server-ssl-node.xml | 4 +-
modules/cloud/README.txt | 32 +
modules/cloud/licenses/apache-2.0.txt | 202 +
modules/cloud/pom.xml | 106 +
.../cloud/TcpDiscoveryCloudIpFinder.java | 433 ++
.../tcp/ipfinder/cloud/package-info.java | 21 +
.../TcpDiscoveryCloudIpFinderSelfTest.java | 122 +
.../tcp/ipfinder/cloud/package-info.java | 22 +
.../ignite/testsuites/IgniteCloudTestSuite.java | 112 +
modules/codegen/pom.xml | 2 +-
.../ignite/codegen/MessageCodeGenerator.java | 30 +-
modules/core/pom.xml | 2 +-
.../java/org/apache/ignite/IgniteCache.java | 5 +
.../org/apache/ignite/IgniteJdbcDriver.java | 81 +-
.../java/org/apache/ignite/IgniteLogger.java | 8 +-
.../java/org/apache/ignite/IgniteServices.java | 2 +-
.../main/java/org/apache/ignite/Ignition.java | 46 +-
.../apache/ignite/cache/CacheInterceptor.java | 9 +-
.../cache/CacheServerNotFoundException.java | 12 +-
.../apache/ignite/cache/CachingProvider.java | 3 +
.../eviction/sorted/SortedEvictionPolicy.java | 2 +-
.../configuration/CacheConfiguration.java | 277 +-
.../configuration/ConnectorConfiguration.java | 2 +-
.../configuration/IgniteConfiguration.java | 445 +-
.../ignite/configuration/TopologyValidator.java | 35 +
.../ignite/events/CacheQueryExecutedEvent.java | 3 +-
.../ignite/events/CacheQueryReadEvent.java | 3 +-
.../ignite/internal/GridDirectCollection.java | 3 +
.../ignite/internal/GridJobContextImpl.java | 7 +-
.../ignite/internal/GridUpdateNotifier.java | 66 +-
.../ignite/internal/IgniteComponentType.java | 36 +-
.../apache/ignite/internal/IgniteKernal.java | 98 +-
.../org/apache/ignite/internal/IgnitionEx.java | 196 +-
.../ignite/internal/MarshallerContextImpl.java | 2 +-
.../client/GridClientConfiguration.java | 2 +-
.../connection/GridClientNioTcpConnection.java | 9 +-
.../internal/cluster/ClusterGroupAdapter.java | 16 +
.../ClusterTopologyServerNotFoundException.java | 12 +-
.../managers/communication/GridIoManager.java | 69 +-
.../communication/GridIoMessageFactory.java | 12 +-
.../GridLifecycleAwareMessageFilter.java | 35 +
.../deployment/GridDeploymentClassLoader.java | 2 +-
.../deployment/GridDeploymentManager.java | 2 +-
.../GridDeploymentPerVersionStore.java | 3 +-
.../discovery/GridDiscoveryManager.java | 21 +-
.../eventstorage/GridEventStorageManager.java | 6 +
.../managers/indexing/GridIndexingManager.java | 14 +-
.../affinity/GridAffinityAssignmentCache.java | 4 +-
.../processors/cache/CacheInvokeResult.java | 24 +-
.../processors/cache/CacheObjectImpl.java | 2 +-
.../cache/CacheStoreBalancingWrapper.java | 6 +
.../cache/DynamicCacheDescriptor.java | 16 +-
.../processors/cache/GridCacheAdapter.java | 555 +-
.../cache/GridCacheAffinityManager.java | 12 -
.../processors/cache/GridCacheEntryEx.java | 4 +
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheIoManager.java | 320 +-
.../processors/cache/GridCacheMapEntry.java | 51 +-
.../processors/cache/GridCacheMessage.java | 8 +-
.../processors/cache/GridCacheMvccManager.java | 2 +-
.../GridCachePartitionExchangeManager.java | 10 +-
.../processors/cache/GridCacheProcessor.java | 192 +-
.../processors/cache/GridCacheProxyImpl.java | 24 -
.../processors/cache/GridCacheReturn.java | 5 +-
.../cache/GridCacheSharedContext.java | 2 +-
.../processors/cache/GridCacheSwapManager.java | 250 +-
.../processors/cache/GridCacheTtlManager.java | 156 +-
.../processors/cache/GridCacheUtils.java | 59 +-
.../processors/cache/IgniteCacheProxy.java | 25 +-
.../processors/cache/IgniteInternalCache.java | 27 -
.../cache/affinity/GridCacheAffinityImpl.java | 2 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 383 -
...idCacheOptimisticCheckPreparedTxRequest.java | 232 -
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++
.../distributed/GridCacheTxRecoveryRequest.java | 261 +
.../GridCacheTxRecoveryResponse.java | 182 +
.../GridDistributedCacheAdapter.java | 20 +-
.../distributed/GridDistributedLockRequest.java | 99 +-
.../GridDistributedTxRemoteAdapter.java | 5 +-
.../distributed/dht/GridDhtCacheAdapter.java | 4 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 9 +-
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../distributed/dht/GridDhtLockFuture.java | 38 +-
.../distributed/dht/GridDhtLockRequest.java | 45 +-
.../distributed/dht/GridDhtTopologyFuture.java | 8 +
.../dht/GridDhtTransactionalCacheAdapter.java | 21 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 102 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 9 +
.../distributed/dht/GridDhtTxLocalAdapter.java | 49 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 16 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 14 +-
.../dht/GridPartitionedGetFuture.java | 9 +-
.../dht/atomic/GridDhtAtomicCache.java | 44 +-
.../dht/atomic/GridDhtAtomicUpdateResponse.java | 8 +
.../dht/atomic/GridNearAtomicUpdateFuture.java | 47 +-
.../dht/atomic/GridNearAtomicUpdateRequest.java | 49 +-
.../atomic/GridNearAtomicUpdateResponse.java | 18 +-
.../dht/colocated/GridDhtColocatedCache.java | 56 +-
.../colocated/GridDhtColocatedLockFuture.java | 44 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 6 +
.../dht/preloader/GridDhtForceKeysResponse.java | 54 +-
.../preloader/GridDhtPartitionSupplyPool.java | 2 +-
.../GridDhtPartitionsExchangeFuture.java | 20 +
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../distributed/near/GridNearAtomicCache.java | 7 +-
.../distributed/near/GridNearCacheAdapter.java | 20 +-
.../distributed/near/GridNearCacheEntry.java | 10 +-
.../distributed/near/GridNearGetFuture.java | 17 +-
.../distributed/near/GridNearGetResponse.java | 8 +-
.../distributed/near/GridNearLockFuture.java | 41 +-
.../distributed/near/GridNearLockRequest.java | 61 +-
.../near/GridNearTransactionalCache.java | 45 +-
.../near/GridNearTxFinishFuture.java | 3 +
.../cache/distributed/near/GridNearTxLocal.java | 13 +-
.../near/GridNearTxPrepareFuture.java | 20 +
.../distributed/near/GridNearTxRemote.java | 7 +-
.../processors/cache/local/GridLocalCache.java | 8 +-
.../local/atomic/GridLocalAtomicCache.java | 92 +-
.../query/GridCacheDistributedQueryManager.java | 3 +
.../cache/query/GridCacheLocalQueryFuture.java | 3 +
.../query/GridCacheQueryFutureAdapter.java | 3 +
.../cache/query/GridCacheQueryManager.java | 63 +-
.../cache/query/GridCacheSqlQuery.java | 137 +-
.../cache/query/GridCacheTwoStepQuery.java | 25 +-
.../jdbc/GridCacheQueryJdbcMetadataTask.java | 3 +
.../cache/transactions/IgniteInternalTx.java | 10 +-
.../cache/transactions/IgniteTxAdapter.java | 19 +-
.../cache/transactions/IgniteTxEntry.java | 74 +-
.../cache/transactions/IgniteTxHandler.java | 116 +-
.../transactions/IgniteTxLocalAdapter.java | 122 +-
.../cache/transactions/IgniteTxLocalEx.java | 4 +-
.../cache/transactions/IgniteTxManager.java | 286 +-
.../IgniteCacheObjectProcessorImpl.java | 2 +-
.../closure/GridClosureProcessor.java | 16 +-
.../datastreamer/DataStreamProcessor.java | 28 +-
.../datastreamer/DataStreamerImpl.java | 5 +-
.../datastreamer/DataStreamerRequest.java | 38 +-
.../processors/igfs/IgfsDataManager.java | 3 +
.../processors/igfs/IgfsDeleteWorker.java | 4 +
.../processors/igfs/IgfsFileWorkerBatch.java | 3 +
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../internal/processors/igfs/IgfsThread.java | 8 +-
.../internal/processors/igfs/IgfsUtils.java | 11 +-
.../processors/job/GridJobProcessor.java | 6 +
.../internal/processors/job/GridJobWorker.java | 9 +
.../offheap/GridOffHeapProcessor.java | 17 +
.../portable/GridPortableInputStream.java | 26 -
.../processors/query/GridQueryIndexing.java | 23 +-
.../processors/query/GridQueryProcessor.java | 83 +-
.../messages/GridQueryNextPageResponse.java | 68 +-
.../h2/twostep/messages/GridQueryRequest.java | 21 +-
.../processors/rest/GridRestProcessor.java | 3 +
.../top/GridTopologyCommandHandler.java | 3 +-
.../service/GridServiceProcessor.java | 9 +
.../processors/task/GridTaskWorker.java | 12 +
.../timeout/GridTimeoutProcessor.java | 3 +
.../ignite/internal/util/GridJavaProcess.java | 4 +
.../ignite/internal/util/IgniteUtils.java | 22 +-
.../util/ipc/loopback/IpcServerTcpEndpoint.java | 2 +-
.../shmem/IpcSharedMemoryServerEndpoint.java | 2 +-
.../util/lang/GridFilteredIterator.java | 2 +-
.../ignite/internal/util/lang/GridFunc.java | 7218 +++++-------------
.../ignite/internal/util/nio/GridNioServer.java | 6 +
.../util/offheap/GridOffHeapPartitionedMap.java | 9 +
.../unsafe/GridUnsafePartitionedMap.java | 155 +-
.../util/spring/IgniteSpringHelper.java | 56 +-
.../util/tostring/GridToStringBuilder.java | 2 +-
.../apache/ignite/internal/util/typedef/X.java | 2 +-
.../ignite/internal/util/worker/GridWorker.java | 3 +
.../ignite/internal/visor/cache/VisorCache.java | 92 +-
.../visor/cache/VisorCacheConfiguration.java | 7 -
.../internal/visor/cache/VisorCacheMetrics.java | 53 +-
.../cache/VisorCacheNearConfiguration.java | 4 +-
.../visor/cache/VisorCacheNodesTask.java | 74 +
.../visor/cache/VisorCacheStartTask.java | 155 +
.../cache/VisorCacheStoreConfiguration.java | 35 -
.../cache/VisorCacheTypeFieldMetadata.java | 36 +-
.../visor/cache/VisorCacheTypeMetadata.java | 99 +-
.../internal/visor/igfs/VisorIgfsMetrics.java | 128 +-
.../visor/misc/VisorResolveHostNameTask.java | 2 +-
.../visor/node/VisorBasicConfiguration.java | 11 +
.../visor/node/VisorNodeDataCollectorJob.java | 8 +-
.../node/VisorNodeEventsCollectorTask.java | 58 +-
.../internal/visor/query/VisorQueryArg.java | 31 +-
.../internal/visor/query/VisorQueryCursor.java | 1 -
.../internal/visor/query/VisorQueryJob.java | 11 +-
.../internal/visor/query/VisorQueryTask.java | 41 -
.../internal/visor/util/VisorEventMapper.java | 13 +
.../internal/visor/util/VisorTaskUtils.java | 12 +-
.../apache/ignite/lang/IgniteAsyncSupport.java | 4 +-
.../apache/ignite/logger/java/JavaLogger.java | 12 +-
.../apache/ignite/marshaller/Marshaller.java | 14 +-
.../ignite/marshaller/jdk/JdkMarshaller.java | 10 +-
.../optimized/OptimizedMarshaller.java | 8 +-
.../ignite/messaging/MessagingListenActor.java | 3 +
.../apache/ignite/resources/LoggerResource.java | 2 +-
.../apache/ignite/resources/SpringResource.java | 2 +-
.../org/apache/ignite/services/Service.java | 2 +-
.../ignite/services/ServiceConfiguration.java | 2 +-
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 19 +-
.../org/apache/ignite/spi/IgniteSpiThread.java | 3 +
.../checkpoint/cache/CacheCheckpointSpi.java | 2 +-
.../spi/checkpoint/jdbc/JdbcCheckpointSpi.java | 2 +-
.../sharedfs/SharedFsCheckpointSpi.java | 4 +-
.../fifoqueue/FifoQueueCollisionSpi.java | 10 +-
.../jobstealing/JobStealingCollisionSpi.java | 14 +-
.../PriorityQueueCollisionSpi.java | 6 +-
.../communication/tcp/TcpCommunicationSpi.java | 12 +-
.../discovery/tcp/TcpClientDiscoverySpi.java | 4 -
.../spi/discovery/tcp/TcpDiscoverySpi.java | 39 +-
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 18 +-
.../memory/MemoryEventStorageSpi.java | 10 +-
.../spi/failover/always/AlwaysFailoverSpi.java | 10 +-
.../jobstealing/JobStealingFailoverSpi.java | 6 +-
.../spi/failover/never/NeverFailoverSpi.java | 8 +-
.../apache/ignite/spi/indexing/IndexingSpi.java | 4 +-
.../adaptive/AdaptiveLoadBalancingSpi.java | 12 +-
.../roundrobin/RoundRobinLoadBalancingSpi.java | 10 +-
.../WeightedRandomLoadBalancingSpi.java | 10 +-
.../spi/swapspace/file/FileSwapSpaceSpi.java | 10 +-
.../startup/cmdline/CommandLineStartup.java | 5 +-
.../startup/cmdline/CommandLineTransformer.java | 3 +
.../resources/META-INF/classnames.properties | 64 +-
.../core/src/main/resources/ignite.properties | 2 +-
.../src/test/config/load/merge-sort-base.xml | 2 +-
.../internal/GridDiscoveryEventSelfTest.java | 30 +-
.../internal/GridUpdateNotifierSelfTest.java | 30 +-
.../processors/cache/CacheGetFromJobTest.java | 110 +
.../GridCacheAbstractFailoverSelfTest.java | 4 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 731 +-
.../cache/GridCacheAbstractSelfTest.java | 4 +-
.../cache/GridCacheSwapReloadSelfTest.java | 20 +-
.../processors/cache/GridCacheTestEntryEx.java | 2 +
...ProjectionForCachesOnDaemonNodeSelfTest.java | 147 +
.../IgniteCacheEntryListenerAbstractTest.java | 4 +-
.../IgniteCacheP2pUnmarshallingErrorTest.java | 189 +
...gniteCacheP2pUnmarshallingNearErrorTest.java | 56 +
...CacheP2pUnmarshallingRebalanceErrorTest.java | 80 +
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 109 +
.../cache/IgniteCachePeekModesAbstractTest.java | 15 +-
.../cache/IgniteCachePutAllRestartTest.java | 203 +
.../cache/IgniteCacheTxPreloadNoWriteTest.java | 29 +-
.../cache/IgniteExchangeFutureHistoryTest.java | 77 +
...gniteTopologyValidatorAbstractCacheTest.java | 183 +
...iteTopologyValidatorAbstractTxCacheTest.java | 125 +
...ValidatorNearPartitionedAtomicCacheTest.java | 30 +
...logyValidatorNearPartitionedTxCacheTest.java | 30 +
...logyValidatorPartitionedAtomicCacheTest.java | 49 +
...TopologyValidatorPartitionedTxCacheTest.java | 30 +
...ologyValidatorReplicatedAtomicCacheTest.java | 49 +
...eTopologyValidatorReplicatedTxCacheTest.java | 30 +
.../cache/OffHeapTieredTransactionSelfTest.java | 127 +
...CacheLoadingConcurrentGridStartSelfTest.java | 163 +
.../CacheNoValueClassOnServerNodeTest.java | 129 +
.../GridCacheAbstractNodeRestartSelfTest.java | 94 +-
...GridCacheLoadingConcurrentGridStartTest.java | 154 -
.../distributed/GridCacheLockAbstractTest.java | 75 +
.../IgniteCachePutGetRestartAbstractTest.java | 2 +-
...arDisabledFairAffinityPutGetRestartTest.java | 35 +
...xOriginatingNodeFailureAbstractSelfTest.java | 8 +-
...cOriginatingNodeFailureAbstractSelfTest.java | 7 +-
.../dht/GridCacheDhtPreloadSelfTest.java | 2 +-
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 43 +
...ionedNearDisabledOffHeapFullApiSelfTest.java | 8 +-
...DisabledOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...abledOffHeapTieredAtomicFullApiSelfTest.java | 56 +
...earDisabledOffHeapTieredFullApiSelfTest.java | 33 +
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +
...itionedTxOriginatingNodeFailureSelfTest.java | 2 -
...rDisabledPrimaryNodeFailureRecoveryTest.java | 31 +
...rtitionedPrimaryNodeFailureRecoveryTest.java | 31 +
...woBackupsPrimaryNodeFailureRecoveryTest.java | 37 +
...ePrimaryNodeFailureRecoveryAbstractTest.java | 533 ++
...CacheAtomicOffHeapTieredFullApiSelfTest.java | 32 +
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +
...yWriteOrderOffHeapTieredFullApiSelfTest.java | 33 +
...erOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +
...achePartitionedMultiNodeFullApiSelfTest.java | 15 +-
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...dCachePartitionedOffHeapFullApiSelfTest.java | 8 +-
...titionedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...PartitionedOffHeapTieredFullApiSelfTest.java | 32 +
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 72 +
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../near/IgniteCacheNearTxRollbackTest.java | 133 +
.../GridCacheReplicatedNodeRestartSelfTest.java | 2 +
...idCacheReplicatedOffHeapFullApiSelfTest.java | 8 +-
...plicatedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...eReplicatedOffHeapTieredFullApiSelfTest.java | 33 +
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +
...acheSortedEvictionPolicyPerformanceTest.java | 13 +-
.../IgniteCacheExpiryPolicyAbstractTest.java | 2 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 2 +
.../expiry/IgniteCacheTtlCleanupSelfTest.java | 85 +
...LocalAtomicOffHeapTieredFullApiSelfTest.java | 32 +
.../GridCacheLocalIsolatedNodesSelfTest.java | 102 +
.../GridCacheLocalOffHeapFullApiSelfTest.java | 6 +-
...dCacheLocalOffHeapTieredFullApiSelfTest.java | 32 +
.../DataStreamerMultiThreadedSelfTest.java | 112 +
.../igfs/IgfsClientCacheSelfTest.java | 132 +
.../processors/igfs/IgfsOneClientNodeTest.java | 133 +
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
...idFileSwapSpaceSpiMultithreadedLoadTest.java | 4 +-
.../logger/java/IgniteJavaLoggerTest.java | 65 -
.../ignite/logger/java/JavaLoggerTest.java | 65 +
.../tcp/TcpClientDiscoverySelfTest.java | 8 +
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 70 +-
.../GridSwapSpaceSpiAbstractSelfTest.java | 2 +-
.../testframework/junits/GridAbstractTest.java | 15 +
.../junits/logger/GridTestLog4jLogger.java | 10 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 4 +
.../IgniteCacheFailoverTestSuite.java | 11 +-
.../IgniteCacheFullApiSelfTestSuite.java | 18 +
...gniteCacheP2pUnmarshallingErrorTestSuit.java | 41 +
.../testsuites/IgniteCacheRestartTestSuite.java | 8 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 291 +-
.../testsuites/IgniteCacheTestSuite2.java | 141 +
.../testsuites/IgniteCacheTestSuite3.java | 140 +
.../testsuites/IgniteCacheTestSuite4.java | 131 +
.../IgniteCacheTxRecoverySelfTestSuite.java | 4 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 3 +
.../testsuites/IgniteLoggingSelfTestSuite.java | 2 +-
.../IgniteTopologyValidatorTestSuit.java | 43 +
modules/extdata/p2p/pom.xml | 2 +-
.../CacheNoValueClassOnServerTestClient.java | 88 +
.../apache/ignite/tests/p2p/cache/Person.java | 42 +
.../CacheConfigurationP2PTestClient.java | 1 -
modules/extdata/uri/pom.xml | 2 +-
modules/gce/README.txt | 32 +
modules/gce/licenses/apache-2.0.txt | 202 +
modules/gce/pom.xml | 92 +
.../gce/TcpDiscoveryGoogleStorageIpFinder.java | 380 +
.../tcp/ipfinder/gce/package-info.java | 22 +
...pDiscoveryGoogleStorageIpFinderSelfTest.java | 73 +
.../tcp/ipfinder/gce/package-info.java | 22 +
.../ignite/testsuites/IgniteGCETestSuite.java | 71 +
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
.../processors/hadoop/HadoopDefaultJobInfo.java | 3 +
.../processors/hadoop/HadoopProcessor.java | 2 +-
.../processors/hadoop/igfs/HadoopIgfsIpcIo.java | 3 +
.../hadoop/jobtracker/HadoopJobTracker.java | 5 +-
.../hadoop/taskexecutor/HadoopRunnableTask.java | 3 +
.../external/HadoopExternalTaskExecutor.java | 3 +
.../processors/hadoop/v2/HadoopV2Job.java | 11 +-
.../hadoop/v2/HadoopV2TaskContext.java | 9 +
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 179 +-
.../query/h2/opt/GridH2AbstractKeyValueRow.java | 92 +-
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 7 +-
.../query/h2/opt/GridH2KeyValueRowOnheap.java | 6 +-
.../query/h2/opt/GridH2RowDescriptor.java | 14 +-
.../processors/query/h2/opt/GridH2Table.java | 10 +-
.../query/h2/opt/GridH2ValueCacheObject.java | 191 +
.../query/h2/opt/GridLuceneIndex.java | 84 +-
.../processors/query/h2/sql/GridSqlQuery.java | 20 +
.../query/h2/sql/GridSqlQueryParser.java | 10 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 11 +-
.../processors/query/h2/sql/GridSqlSelect.java | 2 +-
.../processors/query/h2/sql/GridSqlUnion.java | 2 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 61 +-
.../query/h2/twostep/GridMergeIndex.java | 6 +-
.../h2/twostep/GridMergeIndexUnsorted.java | 4 +-
.../h2/twostep/GridReduceQueryExecutor.java | 162 +-
.../query/h2/twostep/GridResultPage.java | 80 +-
.../query/h2/twostep/msg/GridH2Array.java | 124 +
.../query/h2/twostep/msg/GridH2Boolean.java | 112 +
.../query/h2/twostep/msg/GridH2Byte.java | 113 +
.../query/h2/twostep/msg/GridH2Bytes.java | 113 +
.../query/h2/twostep/msg/GridH2CacheObject.java | 148 +
.../query/h2/twostep/msg/GridH2Date.java | 115 +
.../query/h2/twostep/msg/GridH2Decimal.java | 134 +
.../query/h2/twostep/msg/GridH2Double.java | 113 +
.../query/h2/twostep/msg/GridH2Float.java | 113 +
.../query/h2/twostep/msg/GridH2Geometry.java | 134 +
.../query/h2/twostep/msg/GridH2Integer.java | 113 +
.../query/h2/twostep/msg/GridH2JavaObject.java | 113 +
.../query/h2/twostep/msg/GridH2Long.java | 113 +
.../query/h2/twostep/msg/GridH2Null.java | 78 +
.../query/h2/twostep/msg/GridH2Short.java | 113 +
.../query/h2/twostep/msg/GridH2String.java | 115 +
.../query/h2/twostep/msg/GridH2Time.java | 116 +
.../query/h2/twostep/msg/GridH2Timestamp.java | 133 +
.../query/h2/twostep/msg/GridH2Uuid.java | 133 +
.../h2/twostep/msg/GridH2ValueMessage.java | 49 +
.../twostep/msg/GridH2ValueMessageFactory.java | 201 +
.../GridCacheAbstractFieldsQuerySelfTest.java | 1284 ----
.../cache/GridCacheOffHeapAndSwapSelfTest.java | 11 +-
.../cache/GridCacheOffHeapSelfTest.java | 11 +-
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 256 +-
...niteCacheP2pUnmarshallingQueryErrorTest.java | 56 +
...eQueryMultiThreadedOffHeapTiredSelfTest.java | 37 +
.../IgniteCacheQueryMultiThreadedSelfTest.java | 35 +-
...artitionedFieldsQueryP2PEnabledSelfTest.java | 34 -
...GridCachePartitionedFieldsQuerySelfTest.java | 115 -
...rtitionedFieldsQueryP2PDisabledSelfTest.java | 34 -
...artitionedFieldsQueryP2PEnabledSelfTest.java | 34 +
...eReplicatedFieldsQueryP2PEnableSelfTest.java | 34 -
.../GridCacheReplicatedFieldsQuerySelfTest.java | 157 -
...eplicatedFieldsQueryP2PDisabledSelfTest.java | 34 -
...ReplicatedFieldsQueryP2PEnabledSelfTest.java | 34 +
.../h2/GridIndexingSpiAbstractSelfTest.java | 132 +-
.../query/h2/sql/BaseH2CompareQueryTest.java | 32 +-
.../IgniteCacheQuerySelfTestSuite.java | 8 +-
modules/jcl/pom.xml | 2 +-
.../ignite/logger/jcl/IgniteJclLogger.java | 167 -
.../org/apache/ignite/logger/jcl/JclLogger.java | 167 +
.../ignite/logger/jcl/IgniteJclLoggerTest.java | 48 -
.../apache/ignite/logger/jcl/JclLoggerTest.java | 48 +
.../ignite/testsuites/IgniteJclTestSuite.java | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
.../apache/ignite/logger/log4j/Log4JLogger.java | 8 +-
modules/rest-http/pom.xml | 2 +-
.../http/jetty/GridJettyRestHandler.java | 3 +
modules/scalar/pom.xml | 2 +-
.../ignite/scalar/ScalarConversions.scala | 8 -
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 8 +-
.../ignite/schema/generator/CodeGenerator.java | 105 +-
.../ignite/schema/ui/SchemaImportApp.java | 8 +-
modules/slf4j/pom.xml | 2 +-
.../ignite/logger/slf4j/GridSlf4jLogger.java | 138 -
.../apache/ignite/logger/slf4j/Slf4jLogger.java | 138 +
modules/spring/pom.xml | 2 +-
.../util/spring/IgniteSpringHelperImpl.java | 217 +-
.../ignite/internal/GridFactorySelfTest.java | 3 +-
.../IgniteStartFromStreamConfigurationTest.java | 50 +
.../testsuites/IgniteSpringTestSuite.java | 2 +
modules/ssh/pom.xml | 2 +-
...gniteProjectionStartStopRestartSelfTest.java | 26 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
.../uri/GridUriDeploymentClassLoader.java | 4 +-
.../spi/deployment/uri/UriDeploymentSpi.java | 2 +-
modules/visor-console/pom.xml | 2 +-
.../ignite/visor/commands/VisorConsole.scala | 314 +-
.../visor/commands/VisorConsoleCommand.scala | 77 -
.../ignite/visor/commands/VisorTextTable.scala | 539 --
.../visor/commands/ack/VisorAckCommand.scala | 42 +-
.../commands/alert/VisorAlertCommand.scala | 35 +-
.../commands/cache/VisorCacheClearCommand.scala | 51 +-
.../commands/cache/VisorCacheCommand.scala | 36 +-
.../commands/cache/VisorCacheScanCommand.scala | 60 +-
.../commands/cache/VisorCacheStopCommand.scala | 30 +-
.../commands/cache/VisorCacheSwapCommand.scala | 66 +-
.../commands/common/VisorConsoleCommand.scala | 90 +
.../visor/commands/common/VisorTextTable.scala | 543 ++
.../config/VisorConfigurationCommand.scala | 438 +-
.../commands/deploy/VisorDeployCommand.scala | 47 +-
.../commands/disco/VisorDiscoveryCommand.scala | 58 +-
.../commands/events/VisorEventsCommand.scala | 338 +-
.../visor/commands/gc/VisorGcCommand.scala | 130 +-
.../visor/commands/kill/VisorKillCommand.scala | 53 +-
.../visor/commands/node/VisorNodeCommand.scala | 47 +-
.../visor/commands/ping/VisorPingCommand.scala | 41 +-
.../commands/start/VisorStartCommand.scala | 34 +-
.../commands/tasks/VisorTasksCommand.scala | 76 +-
.../commands/top/VisorTopologyCommand.scala | 36 +-
.../visor/commands/vvm/VisorVvmCommand.scala | 32 +-
.../scala/org/apache/ignite/visor/visor.scala | 286 +-
.../ignite/visor/VisorTextTableSpec.scala | 3 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 237 +-
491 files changed, 21924 insertions(+), 13692 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0810461/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
[13/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-848' into ignite-sprint-4
Posted by vo...@apache.org.
Merge branch 'ignite-848' into ignite-sprint-4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4accd3ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4accd3ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4accd3ad
Branch: refs/heads/ignite-gg-9614
Commit: 4accd3ad3a268f76507254af2c46f1f89039db9b
Parents: 91b2764 70872aa
Author: agura <ag...@gridgain.com>
Authored: Wed May 6 14:53:06 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Wed May 6 14:53:06 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheMapEntry.java | 18 ++++-
.../processors/cache/GridCacheTtlManager.java | 42 ++++------
.../processors/cache/GridCacheUtils.java | 5 +-
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 2 +
.../IgniteCacheExpiryPolicyAbstractTest.java | 2 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 2 +
.../expiry/IgniteCacheTtlCleanupSelfTest.java | 85 ++++++++++++++++++++
8 files changed, 121 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
[12/50] [abbrv] incubator-ignite git commit: Merge branches
'ignite-855' and 'ignite-sprint-4' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-855
Posted by vo...@apache.org.
Merge branches 'ignite-855' and 'ignite-sprint-4' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-855
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/91b2764c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/91b2764c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/91b2764c
Branch: refs/heads/ignite-gg-9614
Commit: 91b2764c781fadf5ef1f1cff9877b9d6b3d6ea8b
Parents: 733f30e a452dac
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed May 6 14:31:20 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed May 6 14:31:20 2015 +0300
----------------------------------------------------------------------
.../ignite/codegen/MessageCodeGenerator.java | 4 +-
.../communication/GridIoMessageFactory.java | 4 +-
.../cache/DynamicCacheDescriptor.java | 16 +-
.../processors/cache/GridCacheAdapter.java | 511 +++++++++---------
.../processors/cache/GridCacheProcessor.java | 189 ++++---
...ridCacheOptimisticCheckPreparedTxFuture.java | 434 ---------------
...idCacheOptimisticCheckPreparedTxRequest.java | 232 --------
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -------
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++++++++++++++++++
.../distributed/GridCacheTxRecoveryRequest.java | 261 +++++++++
.../GridCacheTxRecoveryResponse.java | 182 +++++++
.../GridDistributedTxRemoteAdapter.java | 2 +-
.../cache/transactions/IgniteInternalTx.java | 5 +-
.../cache/transactions/IgniteTxAdapter.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 38 +-
.../transactions/IgniteTxLocalAdapter.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 173 ++----
.../processors/igfs/IgfsDataManager.java | 3 +
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../resources/META-INF/classnames.properties | 12 +-
.../processors/cache/CacheGetFromJobTest.java | 110 ++++
.../GridCacheAbstractFailoverSelfTest.java | 4 +-
.../GridCacheAbstractNodeRestartSelfTest.java | 94 ++--
...xOriginatingNodeFailureAbstractSelfTest.java | 2 +-
...rDisabledPrimaryNodeFailureRecoveryTest.java | 31 ++
...rtitionedPrimaryNodeFailureRecoveryTest.java | 31 ++
...woBackupsPrimaryNodeFailureRecoveryTest.java | 37 ++
...ePrimaryNodeFailureRecoveryAbstractTest.java | 533 +++++++++++++++++++
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCacheReplicatedNodeRestartSelfTest.java | 2 +
.../igfs/IgfsClientCacheSelfTest.java | 132 +++++
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 5 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 3 -
.../IgniteCacheTxRecoverySelfTestSuite.java | 4 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 2 +
37 files changed, 2364 insertions(+), 1393 deletions(-)
----------------------------------------------------------------------
[47/50] [abbrv] incubator-ignite git commit: # IGNITE-777
(ConcurrentModificationException in TcpDiscoverySpi): Clone message before
send to client.
Posted by vo...@apache.org.
# IGNITE-777 (ConcurrentModificationException in TcpDiscoverySpi): Clone message before send to client.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0dc908bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0dc908bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0dc908bd
Branch: refs/heads/ignite-gg-9614
Commit: 0dc908bd3d781c30b809d3ba525208d583d8c35d
Parents: c9cd92e
Author: sevdokimov <se...@gridgain.com>
Authored: Wed Apr 22 13:29:40 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Fri May 8 17:58:11 2015 +0300
----------------------------------------------------------------------
.../spi/discovery/tcp/TcpDiscoverySpi.java | 24 ++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0dc908bd/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 46d90b5..3afcd0f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -2690,8 +2690,28 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
msgLsnr.apply(msg);
if (redirectToClients(msg)) {
- for (ClientMessageWorker clientMsgWorker : clientMsgWorkers.values())
- clientMsgWorker.addMessage(msg);
+ byte[] marshalledMsg = null;
+
+ for (ClientMessageWorker clientMsgWorker : clientMsgWorkers.values()) {
+ // Send a clone to client to avoid ConcurrentModificationException
+ TcpDiscoveryAbstractMessage msgClone;
+
+ try {
+ if (marshalledMsg == null)
+ marshalledMsg = marsh.marshal(msg);
+
+ msgClone = marsh.unmarshal(marshalledMsg, null);
+
+ clientMsgWorker.addMessage(msgClone);
+ }
+ catch (IgniteCheckedException e) {
+ log.error("Failed to marshal message: " + msg, e);
+
+ msgClone = msg;
+ }
+
+ clientMsgWorker.addMessage(msgClone);
+ }
}
Collection<TcpDiscoveryNode> failedNodes;
[48/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-478' into ignite-sprint-5
Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-478' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f4a3591b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f4a3591b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f4a3591b
Branch: refs/heads/ignite-gg-9614
Commit: f4a3591b35b707aa1cf2643d4d9db99a5bd0afc8
Parents: f059be6 995b608
Author: sevdokimov <se...@gridgain.com>
Authored: Fri May 8 18:01:46 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Fri May 8 18:01:46 2015 +0300
----------------------------------------------------------------------
.../processors/resource/GridResourceField.java | 11 +
.../processors/resource/GridResourceIoc.java | 387 ++++++-------------
.../processors/resource/GridResourceMethod.java | 13 +
.../resource/GridResourceProcessor.java | 4 +-
.../ignite/internal/util/IgniteUtils.java | 15 +
5 files changed, 169 insertions(+), 261 deletions(-)
----------------------------------------------------------------------
[46/50] [abbrv] incubator-ignite git commit: # IGNITE-777 Review:
Replace log.error() with U.error()
Posted by vo...@apache.org.
# IGNITE-777 Review: Replace log.error() with U.error()
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f059be62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f059be62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f059be62
Branch: refs/heads/ignite-gg-9614
Commit: f059be626b0a66e81b5ce3961d53a20d89526bc8
Parents: 0dc908b
Author: sevdokimov <se...@gridgain.com>
Authored: Fri May 8 17:57:00 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Fri May 8 17:58:11 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f059be62/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 3afcd0f..0ebb6cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -2705,7 +2705,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
clientMsgWorker.addMessage(msgClone);
}
catch (IgniteCheckedException e) {
- log.error("Failed to marshal message: " + msg, e);
+ U.error(log, "Failed to marshal message: " + msg, e);
msgClone = msg;
}
[29/50] [abbrv] incubator-ignite git commit: Merge branch
ignite-sprint-4 into ignite-sprint-5
Posted by vo...@apache.org.
Merge branch ignite-sprint-4 into ignite-sprint-5
Conflicts:
examples/pom.xml
modules/aop/pom.xml
modules/aws/pom.xml
modules/clients/pom.xml
modules/cloud/pom.xml
modules/codegen/pom.xml
modules/core/pom.xml
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
modules/extdata/p2p/pom.xml
modules/extdata/uri/pom.xml
modules/gce/pom.xml
modules/geospatial/pom.xml
modules/hadoop/pom.xml
modules/hibernate/pom.xml
modules/indexing/pom.xml
modules/jcl/pom.xml
modules/jta/pom.xml
modules/log4j/pom.xml
modules/rest-http/pom.xml
modules/scalar/pom.xml
modules/schedule/pom.xml
modules/schema-import/pom.xml
modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
modules/slf4j/pom.xml
modules/spring/pom.xml
modules/ssh/pom.xml
modules/tools/pom.xml
modules/urideploy/pom.xml
modules/visor-console/pom.xml
modules/visor-plugins/pom.xml
modules/web/pom.xml
modules/yardstick/pom.xml
pom.xml
Merge branch 'ignite-sprint-4' of https://github.com/ggprivate/ggprivate into ignite-sprint-5
Conflicts:
benchmarks/cache-comparison/pom.xml
benchmarks/filesystem/hadoop1/pom.xml
benchmarks/filesystem/hadoop2/pom.xml
benchmarks/mongo/pom.xml
benchmarks/risk-analytics/pom.xml
benchmarks/serialization/pom.xml
benchmarks/yardstick/pom.xml
benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
examples/clients/cpp/configure
examples/clients/cpp/configure.ac
examples/clients/dotnet/GridGainExamples/GridGainExamples/Properties/AssemblyInfo.cs
examples/clients/dotnet/GridGainExamples/GridGainExamplesDll/Properties/AssemblyInfo.cs
examples/pom.xml
modules/clients/cpp/main/configure
modules/clients/cpp/main/configure.ac
modules/clients/cpp/main/tests/configure
modules/clients/cpp/main/tests/configure.ac
modules/clients/cpp/vsproject/resource.h
modules/clients/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
modules/clients/dotnet/gridgain-native/AssemblyInfo.cpp
modules/clients/dotnet/gridgain/Properties/AssemblyInfo.cs
modules/clients/pom.xml
modules/clients/src/test/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
modules/clients/src/test/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
modules/clients/src/test/dotnet/gridgain-test/Properties/AssemblyInfo.cs
modules/codegen/pom.xml
modules/compatibility/pom.xml
modules/core/pom.xml
modules/diagnostic/pom.xml
modules/dr-demo/pom.xml
modules/license-gen/pom.xml
modules/mongo-sniffer/pom.xml
modules/mongo-visor/pom.xml
modules/mongo/pom.xml
modules/tools/pom.xml
modules/visor-console/pom.xml
modules/visor-demo/pom.xml
modules/visor-tester-plugin/pom.xml
modules/visor-tester/pom.xml
modules/visor/pom.xml
parent/pom.xml
pilots/chronotrack/pom.xml
pilots/ctb/pom.xml
pilots/dsi/pom.xml
pilots/ionic/pom.xml
pilots/sb/pom.xml
pilots/sony/pom.xml
pilots/wellsfargo/pom.xml
pilots/worldpay/pom.xml
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0b91761c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0b91761c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0b91761c
Branch: refs/heads/ignite-gg-9614
Commit: 0b91761cccbba00888fdba73c9ca5602b8b229bc
Parents: 942abe4 0c13a08
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri May 8 09:57:43 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri May 8 09:57:43 2015 +0700
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 4 +-
modules/codegen/pom.xml | 2 +-
.../ignite/codegen/MessageCodeGenerator.java | 4 +-
modules/core/pom.xml | 2 +-
.../communication/GridIoMessageFactory.java | 4 +-
.../cache/DynamicCacheDescriptor.java | 16 +-
.../processors/cache/GridCacheAdapter.java | 518 +++++++++---------
.../processors/cache/GridCacheMapEntry.java | 18 +-
.../GridCachePartitionExchangeManager.java | 3 +
.../processors/cache/GridCacheProcessor.java | 189 ++++---
.../processors/cache/GridCacheTtlManager.java | 42 +-
.../processors/cache/GridCacheUtils.java | 5 +-
...ridCacheOptimisticCheckPreparedTxFuture.java | 434 ---------------
...idCacheOptimisticCheckPreparedTxRequest.java | 232 --------
...dCacheOptimisticCheckPreparedTxResponse.java | 179 -------
.../distributed/GridCacheTxRecoveryFuture.java | 506 ++++++++++++++++++
.../distributed/GridCacheTxRecoveryRequest.java | 261 +++++++++
.../GridCacheTxRecoveryResponse.java | 182 +++++++
.../GridDistributedTxRemoteAdapter.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 2 +-
.../dht/GridPartitionedGetFuture.java | 2 +-
.../cache/query/GridCacheSqlQuery.java | 2 +-
.../cache/query/GridCacheTwoStepQuery.java | 17 +
.../cache/transactions/IgniteInternalTx.java | 5 +-
.../cache/transactions/IgniteTxAdapter.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 38 +-
.../transactions/IgniteTxLocalAdapter.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 173 ++----
.../datastreamer/DataStreamerImpl.java | 2 +
.../processors/igfs/IgfsDataManager.java | 3 +
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../internal/processors/igfs/IgfsUtils.java | 11 +-
.../internal/visor/query/VisorQueryArg.java | 14 +-
.../internal/visor/query/VisorQueryJob.java | 2 +
.../resources/META-INF/classnames.properties | 12 +-
.../internal/GridUpdateNotifierSelfTest.java | 21 +-
.../processors/cache/CacheGetFromJobTest.java | 110 ++++
.../GridCacheAbstractFailoverSelfTest.java | 4 +-
.../GridCacheAbstractNodeRestartSelfTest.java | 94 ++--
...xOriginatingNodeFailureAbstractSelfTest.java | 2 +-
...rDisabledPrimaryNodeFailureRecoveryTest.java | 31 ++
...rtitionedPrimaryNodeFailureRecoveryTest.java | 31 ++
...woBackupsPrimaryNodeFailureRecoveryTest.java | 37 ++
...ePrimaryNodeFailureRecoveryAbstractTest.java | 533 +++++++++++++++++++
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCacheReplicatedNodeRestartSelfTest.java | 2 +
.../IgniteCacheExpiryPolicyAbstractTest.java | 2 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 2 +
.../expiry/IgniteCacheTtlCleanupSelfTest.java | 85 +++
.../igfs/IgfsClientCacheSelfTest.java | 132 +++++
.../processors/igfs/IgfsOneClientNodeTest.java | 133 +++++
.../processors/igfs/IgfsStreamsSelfTest.java | 2 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 5 +-
.../IgniteCacheTxRecoverySelfTestSuite.java | 4 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 3 +
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 4 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 4 +
.../processors/query/h2/sql/GridSqlQuery.java | 20 +
.../query/h2/sql/GridSqlQueryParser.java | 10 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 11 +-
.../processors/query/h2/sql/GridSqlSelect.java | 2 +-
.../processors/query/h2/sql/GridSqlUnion.java | 2 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 3 +
.../h2/twostep/GridReduceQueryExecutor.java | 119 ++++-
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 21 +
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
.../ignite/schema/generator/CodeGenerator.java | 41 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
.../commands/cache/VisorCacheScanCommand.scala | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 6 +-
95 files changed, 2916 insertions(+), 1514 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --cc modules/cloud/pom.xml
index 91ba978,ddc2858..754491e
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@@ -103,4 -103,4 +103,4 @@@
</dependencies>
--</project>
++</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/modules/gce/pom.xml
----------------------------------------------------------------------
diff --cc modules/gce/pom.xml
index 1061aee,e4198b8..b33d76f
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@@ -89,4 -89,4 +89,4 @@@
</dependencies>
--</project>
++</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
----------------------------------------------------------------------
diff --cc modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
index 5b74cdd,f04aa01..b92d84b
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
@@@ -673,13 -680,15 +680,15 @@@ public class CodeGenerator
if (!groups.isEmpty()) {
add2(src, "// Groups for " + tbl + ".");
- add2(src, (first ? "Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> " : "") +
+ add2(src, (firstGrps ? "Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> " : "") +
- " grps = new LinkedHashMap<>();");
+ "grps = new LinkedHashMap<>();");
add0(src, "");
+ firstGrps = false;
+
for (Map.Entry<String, Map<String, IndexItem>> group : groups.entrySet()) {
add2(src, (firstGrp ? "LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>> " : "") +
- "grpItems = new LinkedHashMap<>();");
+ "grpItems = new LinkedHashMap<>();");
add0(src, "");
for (Map.Entry<String, IndexItem> grpItem : group.getValue().entrySet()) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b91761c/pom.xml
----------------------------------------------------------------------
[38/50] [abbrv] incubator-ignite git commit: # ignite-sprint-5 run on
TC tx recovery suite separately
Posted by vo...@apache.org.
# ignite-sprint-5 run on TC tx recovery suite separately
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ef2bed9b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ef2bed9b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ef2bed9b
Branch: refs/heads/ignite-gg-9614
Commit: ef2bed9bfbbe5602f61ae57fac582cf13d235ed3
Parents: de19191
Author: sboikov <sb...@gridgain.com>
Authored: Fri May 8 13:35:22 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri May 8 13:35:22 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java | 3 ---
1 file changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ef2bed9b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
index 2e56b7a..9394693 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -132,9 +132,6 @@ public class IgniteCacheTestSuite3 extends TestSuite {
// Iterators.
suite.addTest(IgniteCacheIteratorsSelfTestSuite.suite());
- // Add tx recovery test suite.
- suite.addTest(IgniteCacheTxRecoverySelfTestSuite.suite());
-
// Cache interceptor tests.
suite.addTest(IgniteCacheInterceptorSelfTestSuite.suite());
[28/50] [abbrv] incubator-ignite git commit: # Remove unused methods
from GridFunc.
Posted by vo...@apache.org.
# Remove unused methods from GridFunc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/942abe45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/942abe45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/942abe45
Branch: refs/heads/ignite-gg-9614
Commit: 942abe45be1c0f6f844de06c6a6e6b03bedb5566
Parents: 4cf2133
Author: sevdokimov <se...@gridgain.com>
Authored: Thu May 7 20:51:42 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Thu May 7 20:51:42 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/util/lang/GridFunc.java | 7218 +++++-------------
1 file changed, 1842 insertions(+), 5376 deletions(-)
----------------------------------------------------------------------
[24/50] [abbrv] incubator-ignite git commit: # Fix code style.
Posted by vo...@apache.org.
# Fix code style.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/39ae0c8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/39ae0c8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/39ae0c8c
Branch: refs/heads/ignite-gg-9614
Commit: 39ae0c8c85a8a10453889df984f9beb03e8693de
Parents: 29da67c
Author: sevdokimov <se...@gridgain.com>
Authored: Thu May 7 18:17:48 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Thu May 7 18:18:09 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/util/lang/GridFilteredIterator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39ae0c8c/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
index b1df224..f3240d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFilteredIterator.java
@@ -35,7 +35,7 @@ public abstract class GridFilteredIterator<T> implements Iterator<T> {
/**
* @param it Iterator.
*/
- public GridFilteredIterator(Iterator<? extends T> it) {
+ protected GridFilteredIterator(Iterator<? extends T> it) {
assert it != null;
this.it = it;
[30/50] [abbrv] incubator-ignite git commit: # ignite-sprint-5 Fixed
compilation.
Posted by vo...@apache.org.
# ignite-sprint-5 Fixed compilation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/17bf271b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/17bf271b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/17bf271b
Branch: refs/heads/ignite-gg-9614
Commit: 17bf271b2da8c0aba68261069c1f61d876c1db96
Parents: 0b91761
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri May 8 10:38:32 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri May 8 10:38:32 2015 +0700
----------------------------------------------------------------------
.../scala/org/apache/ignite/scalar/ScalarConversions.scala | 8 --------
1 file changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17bf271b/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala b/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
index d9565af..32e6758 100644
--- a/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
+++ b/modules/scalar/src/main/scala/org/apache/ignite/scalar/ScalarConversions.scala
@@ -867,14 +867,6 @@ trait ScalarConversions {
GridFunc.as(r)
/**
- * Implicit converter from `java.util.concurrent.Callable` to `GridOutClosure`.
- *
- * @param c Java callable to convert.
- */
- implicit def toOutClosure2[R](c: java.util.concurrent.Callable[R]): IgniteOutClosure[R] =
- GridFunc.as0(c)
-
- /**
* Implicit converter from Scala predicate to Scala wrapping predicate.
*
* @param f Scala predicate to convert.
[33/50] [abbrv] incubator-ignite git commit: #ignite-286: Make cache
full api test work in OFFHEAP_TIERED mode.
Posted by vo...@apache.org.
#ignite-286: Make cache full api test work in OFFHEAP_TIERED mode.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/745cf7f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/745cf7f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/745cf7f9
Branch: refs/heads/ignite-gg-9614
Commit: 745cf7f9bd4ca8e649fa77fdfe4e9e3468ecaaa0
Parents: e8a38e0
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri May 8 12:15:29 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri May 8 12:15:29 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 26 ++-
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheProxyImpl.java | 24 --
.../processors/cache/GridCacheSwapManager.java | 215 +++++++++++++-----
.../processors/cache/IgniteInternalCache.java | 27 ---
.../colocated/GridDhtColocatedLockFuture.java | 2 +
.../distributed/near/GridNearCacheAdapter.java | 10 -
.../processors/cache/local/GridLocalCache.java | 8 +-
.../local/atomic/GridLocalAtomicCache.java | 27 ++-
.../cache/query/GridCacheQueryManager.java | 21 +-
.../transactions/IgniteTxLocalAdapter.java | 12 +-
.../offheap/GridOffHeapProcessor.java | 17 ++
.../util/offheap/GridOffHeapPartitionedMap.java | 9 +
.../unsafe/GridUnsafePartitionedMap.java | 155 ++++++-------
.../cache/GridCacheAbstractFullApiSelfTest.java | 227 +++++++++++--------
.../cache/GridCacheAbstractSelfTest.java | 4 +-
.../cache/OffHeapTieredTransactionSelfTest.java | 127 +++++++++++
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 43 ++++
...ionedNearDisabledOffHeapFullApiSelfTest.java | 8 +-
...DisabledOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...abledOffHeapTieredAtomicFullApiSelfTest.java | 56 +++++
...earDisabledOffHeapTieredFullApiSelfTest.java | 33 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...CacheAtomicOffHeapTieredFullApiSelfTest.java | 32 +++
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...yWriteOrderOffHeapTieredFullApiSelfTest.java | 33 +++
...erOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...achePartitionedMultiNodeFullApiSelfTest.java | 15 +-
...dCachePartitionedOffHeapFullApiSelfTest.java | 8 +-
...titionedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...PartitionedOffHeapTieredFullApiSelfTest.java | 32 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 72 ++++++
...idCacheReplicatedOffHeapFullApiSelfTest.java | 8 +-
...plicatedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...eReplicatedOffHeapTieredFullApiSelfTest.java | 33 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...LocalAtomicOffHeapTieredFullApiSelfTest.java | 32 +++
.../GridCacheLocalOffHeapFullApiSelfTest.java | 6 +-
...dCacheLocalOffHeapTieredFullApiSelfTest.java | 32 +++
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
.../IgniteCacheFullApiSelfTestSuite.java | 18 ++
...eQueryMultiThreadedOffHeapTiredSelfTest.java | 37 +++
.../IgniteCacheQueryMultiThreadedSelfTest.java | 29 ++-
.../IgniteCacheQuerySelfTestSuite.java | 1 +
44 files changed, 1231 insertions(+), 367 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index afddc79..3826bfa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -2692,6 +2692,22 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public void removeAll() throws IgniteCheckedException {
+ assert ctx.isLocal();
+
+ for (Iterator<KeyCacheObject> it = ctx.swap().offHeapKeyIterator(true, true, AffinityTopologyVersion.NONE);
+ it.hasNext(); )
+ remove((K)it.next());
+
+ for (Iterator<KeyCacheObject> it = ctx.swap().swapKeyIterator(true, true, AffinityTopologyVersion.NONE);
+ it.hasNext(); )
+ remove((K)it.next());
+
+ removeAll(keySet());
+ }
+
+ /** {@inheritDoc} */
@Override public void removeAll(final Collection<? extends K> keys) throws IgniteCheckedException {
boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -3782,16 +3798,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException {
- return ctx.swap().lazySwapIterator();
- }
-
- /** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException {
- return ctx.swap().lazyOffHeapIterator();
- }
-
- /** {@inheritDoc} */
@Override public long offHeapEntriesCount() {
return ctx.swap().offHeapEntriesCount();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 9135c16..d565af1 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
@@ -751,7 +751,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
U.error(log, "Failed to evict entry from cache: " + e, ex);
}
- if (memoryMode == OFFHEAP_TIERED) {
+ if (!cctx.isNear() && memoryMode == OFFHEAP_TIERED) {
try {
evict0(cctx.cache(), e, cctx.versions().next(), null, false);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 5487944..55d2f84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -1390,30 +1390,6 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.swapIterator();
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.offHeapIterator();
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Override public long offHeapEntriesCount() {
CacheOperationContext prev = gate.enter(opCtx);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 6444e37..eb82218 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -1211,10 +1211,10 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
checkIteratorQueue();
if (offHeapEnabled() && !swapEnabled())
- return rawOffHeapIterator();
+ return rawOffHeapIterator(true, true);
if (swapEnabled() && !offHeapEnabled())
- return rawSwapIterator();
+ return rawSwapIterator(true, true);
// Both, swap and off-heap are enabled.
return new GridCloseableIteratorAdapter<Map.Entry<byte[], byte[]>>() {
@@ -1227,7 +1227,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
private Map.Entry<byte[], byte[]> cur;
{
- it = rawOffHeapIterator();
+ it = rawOffHeapIterator(true, true);
advance();
}
@@ -1241,7 +1241,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
if (offheapFlag) {
offheapFlag = false;
- it = rawSwapIterator();
+ it = rawSwapIterator(true, true);
if (!it.hasNext()) {
it.close();
@@ -1313,7 +1313,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), topVer) :
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
- return new PartitionsKeyIterator(parts) {
+ return new PartitionsAbstractIterator<KeyCacheObject>(parts) {
@Override protected Iterator<KeyCacheObject> partitionIterator(int part)
throws IgniteCheckedException
{
@@ -1338,7 +1338,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), topVer) :
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
- return new PartitionsKeyIterator(parts) {
+ return new PartitionsAbstractIterator<KeyCacheObject>(parts) {
@Override protected Iterator<KeyCacheObject> partitionIterator(int part)
throws IgniteCheckedException
{
@@ -1554,37 +1554,91 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* @param c Key/value closure.
+ * @param primary Include primaries.
+ * @param backup Include backups.
* @return Off-heap iterator.
*/
- public <T> GridCloseableIterator<T> rawOffHeapIterator(CX2<T2<Long, Integer>, T2<Long, Integer>, T> c) {
+ public <T> GridCloseableIterator<T> rawOffHeapIterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c,
+ boolean primary,
+ boolean backup)
+ {
assert c != null;
- if (!offheapEnabled)
+ if (!offheapEnabled || (!primary && !backup))
return new GridEmptyCloseableIterator<>();
checkIteratorQueue();
- return offheap.iterator(spaceName, c);
+ if (primary && backup)
+ return offheap.iterator(spaceName, c);
+
+ AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
+
+ Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+
+ return new CloseablePartitionsIterator<T, T>(parts) {
+ @Override protected GridCloseableIterator<T> partitionIterator(int part)
+ throws IgniteCheckedException
+ {
+ return offheap.iterator(spaceName, c, part);
+ }
+ };
}
/**
+ * @param primary Include primaries.
+ * @param backup Include backups.
* @return Raw off-heap iterator.
*/
- public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawOffHeapIterator() {
- if (!offheapEnabled)
+ public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawOffHeapIterator(final boolean primary,
+ final boolean backup)
+ {
+ if (!offheapEnabled || (!primary && !backup))
return new GridEmptyCloseableIterator<>();
- return new GridCloseableIteratorAdapter<Map.Entry<byte[], byte[]>>() {
- private GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> it = offheap.iterator(spaceName);
+ if (primary && backup)
+ return new GridCloseableIteratorAdapter<Map.Entry<byte[], byte[]>>() {
+ private GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> it = offheap.iterator(spaceName);
+
+ private Map.Entry<byte[], byte[]> cur;
+
+ @Override protected Map.Entry<byte[], byte[]> onNext() {
+ return cur = it.next();
+ }
+
+ @Override protected boolean onHasNext() {
+ return it.hasNext();
+ }
+
+ @Override protected void onRemove() throws IgniteCheckedException {
+ KeyCacheObject key = cctx.toCacheKeyObject(cur.getKey());
+
+ int part = cctx.affinity().partition(key);
+
+ offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
+ }
+
+ @Override protected void onClose() throws IgniteCheckedException {
+ it.close();
+ }
+ };
+ AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
+
+ Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+
+ return new CloseablePartitionsIterator<Map.Entry<byte[], byte[]>, IgniteBiTuple<byte[], byte[]>>(parts) {
private Map.Entry<byte[], byte[]> cur;
@Override protected Map.Entry<byte[], byte[]> onNext() {
- return cur = it.next();
+ return cur = super.onNext();
}
- @Override protected boolean onHasNext() {
- return it.hasNext();
+ @Override protected GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> partitionIterator(int part)
+ throws IgniteCheckedException {
+ return offheap.iterator(spaceName, part);
}
@Override protected void onRemove() throws IgniteCheckedException {
@@ -1594,10 +1648,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
}
-
- @Override protected void onClose() throws IgniteCheckedException {
- it.close();
- }
};
}
@@ -1621,15 +1671,33 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* @return Raw off-heap iterator.
+ * @param primary Include primaries.
+ * @param backup Include backups.
* @throws IgniteCheckedException If failed.
*/
- public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawSwapIterator() throws IgniteCheckedException {
- if (!swapEnabled)
+ public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawSwapIterator(boolean primary, boolean backup)
+ throws IgniteCheckedException
+ {
+ if (!swapEnabled || (!primary && !backup))
return new GridEmptyCloseableIterator<>();
checkIteratorQueue();
- return swapMgr.rawIterator(spaceName);
+ if (primary && backup)
+ return swapMgr.rawIterator(spaceName);
+
+ AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
+
+ Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+
+ return new CloseablePartitionsIterator<Map.Entry<byte[], byte[]>, Map.Entry<byte[], byte[]>>(parts) {
+ @Override protected GridCloseableIterator<Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ throws IgniteCheckedException
+ {
+ return swapMgr.rawIterator(spaceName, part);
+ }
+ };
}
/**
@@ -1654,7 +1722,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
return new PartitionsIterator<K, V>(parts) {
- @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part)
throws IgniteCheckedException
{
return swapMgr.rawIterator(spaceName, part);
@@ -1669,7 +1737,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Offheap entries iterator.
* @throws IgniteCheckedException If failed.
*/
- public <K, V> Iterator<Cache.Entry<K, V>> offheapIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer)
+ public <K, V> Iterator<Cache.Entry<K, V>> offheapIterator(boolean primary,
+ boolean backup,
+ AffinityTopologyVersion topVer)
throws IgniteCheckedException
{
assert primary || backup;
@@ -1684,7 +1754,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
return new PartitionsIterator<K, V>(parts) {
- @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> partitionIterator(int part) {
+ @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part) {
return offheap.iterator(spaceName, part);
}
};
@@ -1884,20 +1954,46 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
*
*/
- private abstract class PartitionsIterator<K, V> implements Iterator<Cache.Entry<K, V>> {
+ private abstract class PartitionsIterator<K, V> extends PartitionsAbstractIterator<Cache.Entry<K, V>> {
+ /**
+ * @param parts Partitions
+ */
+ public PartitionsIterator(Collection<Integer> parts) {
+ super(parts);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Iterator<Cache.Entry<K, V>> partitionIterator(int part)
+ throws IgniteCheckedException {
+ return cacheEntryIterator(GridCacheSwapManager.this.<K, V>lazyIterator(nextPartition(part)));
+ }
+
+ /**
+ * @param part Partition.
+ * @return Iterator for given partition.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part)
+ throws IgniteCheckedException;
+ }
+
+ /**
+ *
+ */
+ private abstract class PartitionsAbstractIterator<T> implements Iterator<T> {
/** */
private Iterator<Integer> partIt;
/** */
- private Iterator<Cache.Entry<K, V>> curIt;
+ private Iterator<T> curIt;
/** */
- private Cache.Entry<K, V> next;
+ private T next;
/**
* @param parts Partitions
*/
- public PartitionsIterator(Collection<Integer> parts) {
+ public PartitionsAbstractIterator(Collection<Integer> parts) {
this.partIt = parts.iterator();
advance();
@@ -1909,11 +2005,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/** {@inheritDoc} */
- @Override public Cache.Entry<K, V> next() {
+ @Override public T next() {
if (next == null)
throw new NoSuchElementException();
- Cache.Entry<K, V> e = next;
+ T e = next;
advance();
@@ -1937,8 +2033,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = partIt.next();
try {
- curIt = cacheEntryIterator(
- GridCacheSwapManager.this.<K, V>lazyIterator(partitionIterator(part)));
+ curIt = partitionIterator(part);
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -1964,58 +2059,70 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Iterator for given partition.
* @throws IgniteCheckedException If failed.
*/
- abstract protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ abstract protected Iterator<T> partitionIterator(int part)
throws IgniteCheckedException;
}
/**
*
*/
- private abstract class PartitionsKeyIterator implements Iterator<KeyCacheObject> {
+ private abstract class CloseablePartitionsIterator<T, T1 extends T> extends GridCloseableIteratorAdapter<T> {
/** */
private Iterator<Integer> partIt;
/** */
- private Iterator<KeyCacheObject> curIt;
+ protected GridCloseableIterator<T1> curIt;
/** */
- private KeyCacheObject next;
+ protected T next;
/**
* @param parts Partitions
*/
- public PartitionsKeyIterator(Collection<Integer> parts) {
+ public CloseablePartitionsIterator(Collection<Integer> parts) {
this.partIt = parts.iterator();
- advance();
+ try {
+ advance();
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/** {@inheritDoc} */
- @Override public boolean hasNext() {
+ @Override protected boolean onHasNext() {
return next != null;
}
/** {@inheritDoc} */
- @Override public KeyCacheObject next() {
- if (next == null)
- throw new NoSuchElementException();
+ @Override protected T onNext() {
+ try {
+ if (next == null)
+ throw new NoSuchElementException();
- KeyCacheObject e = next;
+ T e = next;
- advance();
+ advance();
- return e;
+ return e;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/** {@inheritDoc} */
- @Override public void remove() {
- throw new UnsupportedOperationException();
+ @Override protected void onClose() throws IgniteCheckedException {
+ if (curIt != null)
+ curIt.close();
}
/**
* Switches to next element.
+ * @throws IgniteCheckedException If failed.
*/
- private void advance() {
+ private void advance() throws IgniteCheckedException {
next = null;
do {
@@ -2038,8 +2145,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
break;
}
- else
+ else {
+ curIt.close();
+
curIt = null;
+ }
}
}
while (partIt.hasNext());
@@ -2050,7 +2160,6 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @return Iterator for given partition.
* @throws IgniteCheckedException If failed.
*/
- abstract protected Iterator<KeyCacheObject> partitionIterator(int part)
- throws IgniteCheckedException;
+ abstract protected GridCloseableIterator<T1> partitionIterator(int part) throws IgniteCheckedException;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index fe371ce..5184115 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1451,33 +1451,6 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public long swapKeys() throws IgniteCheckedException;
/**
- * Gets iterator over keys and values belonging to this cache swap space on local node. This
- * iterator is thread-safe, which means that cache (and therefore its swap space)
- * may be modified concurrently with iteration over swap.
- * <p>
- * Returned iterator supports {@code remove} operation which delegates to
- * <code>removex(Object, org.apache.ignite.lang.IgnitePredicate[])</code> method.
- *
- * @return Iterator over keys.
- * @throws IgniteCheckedException If failed.
- */
- public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException;
-
- /**
- * Gets iterator over keys and values belonging to this cache off-heap memory on local node. This
- * iterator is thread-safe, which means that cache (and therefore its off-heap memory)
- * may be modified concurrently with iteration over off-heap. To achieve better performance
- * the keys and values deserialized on demand, whenever accessed.
- * <p>
- * Returned iterator supports {@code remove} operation which delegates to
- * <code>removex(Object, org.apache.ignite.lang.IgnitePredicate[])}</code> method.
- *
- * @return Iterator over keys.
- * @throws IgniteCheckedException If failed.
- */
- public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException;
-
- /**
* Forces this cache node to re-balance its partitions. This method is usually used when
* {@link CacheConfiguration#getRebalanceDelay()} configuration parameter has non-zero value.
* When many nodes are started or stopped almost concurrently, it is more efficient to delay
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 5b74b31..f10baa3 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
@@ -786,6 +786,8 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
catch (GridCacheEntryRemovedException ignored) {
if (log.isDebugEnabled())
log.debug("Got removed entry in lockAsync(..) method (will retry): " + entry);
+
+ entry = null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 29c1d45..145e980 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
@@ -436,16 +436,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
}
/** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException {
- return dht().swapIterator();
- }
-
- /** {@inheritDoc} */
- @Override public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException {
- return dht().offHeapIterator();
- }
-
- /** {@inheritDoc} */
@Override public long offHeapEntriesCount() {
return dht().offHeapEntriesCount();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
index fae2372..6120e25 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java
@@ -146,6 +146,8 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> {
try {
entry = entryExx(key);
+ entry.unswap(false);
+
if (!ctx.isAll(entry, filter)) {
fut.onFailed();
@@ -200,12 +202,6 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public void removeAll() throws IgniteCheckedException {
- removeAll(keySet());
- }
-
- /** {@inheritDoc} */
@Override public IgniteInternalFuture<?> removeAllAsync() {
return ctx.closures().callLocalSafe(new Callable<Void>() {
@Override public Void call() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 936ed9d..819b0f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -387,12 +387,6 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public void removeAll() throws IgniteCheckedException {
- removeAll(keySet());
- }
-
- /** {@inheritDoc} */
@Override public IgniteInternalFuture<?> removeAllAsync() {
return ctx.closures().callLocalSafe(new Callable<Void>() {
@Override public Void call() throws Exception {
@@ -1374,16 +1368,24 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
private List<GridCacheEntryEx> lockEntries(Collection<? extends K> keys) {
List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
+ boolean nullKeys = false;
+
while (true) {
for (K key : keys) {
- if (key == null)
- throw new NullPointerException("Null key.");
+ if (key == null) {
+ nullKeys = true;
+
+ break;
+ }
GridCacheEntryEx entry = entryEx(ctx.toCacheKeyObject(key));
locked.add(entry);
}
+ if (nullKeys)
+ break;
+
for (int i = 0; i < locked.size(); i++) {
GridCacheEntryEx entry = locked.get(i);
@@ -1405,6 +1407,15 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
if (!locked.isEmpty())
return locked;
}
+
+ assert nullKeys;
+
+ AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
+
+ for (GridCacheEntryEx entry : locked)
+ ctx.evicts().touch(entry, topVer);
+
+ throw new NullPointerException("Null key.");
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index d3ebe60..16a8028 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -766,13 +766,14 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
final ExpiryPolicy plc = cctx.expiry();
+ final boolean backups = qry.includeBackups() || cctx.isReplicated();
+
final GridCloseableIteratorAdapter<IgniteBiTuple<K, V>> heapIt = new GridCloseableIteratorAdapter<IgniteBiTuple<K, V>>() {
private IgniteBiTuple<K, V> next;
private IgniteCacheExpiryPolicy expiryPlc = cctx.cache().expiryPolicy(plc);
- private Iterator<K> iter = qry.includeBackups() || cctx.isReplicated() ?
- prj.keySet().iterator() : prj.primaryKeySet().iterator();
+ private Iterator<K> iter = backups ? prj.keySet().iterator() : prj.primaryKeySet().iterator();
{
advance();
@@ -868,10 +869,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
iters.add(heapIt);
if (cctx.isOffHeapEnabled())
- iters.add(offheapIterator(qry));
+ iters.add(offheapIterator(qry, backups));
if (cctx.swap().swapEnabled())
- iters.add(swapIterator(qry));
+ iters.add(swapIterator(qry, backups));
it = new CompoundIterator<>(iters);
}
@@ -905,32 +906,34 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
/**
* @param qry Query.
+ * @param backups Include backups.
* @return Swap iterator.
* @throws IgniteCheckedException If failed.
*/
- private GridIterator<IgniteBiTuple<K, V>> swapIterator(GridCacheQueryAdapter<?> qry)
+ private GridIterator<IgniteBiTuple<K, V>> swapIterator(GridCacheQueryAdapter<?> qry, boolean backups)
throws IgniteCheckedException {
IgniteBiPredicate<K, V> filter = qry.scanFilter();
- Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawSwapIterator();
+ Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawSwapIterator(true, backups);
return scanIterator(it, filter, qry.keepPortable());
}
/**
* @param qry Query.
+ * @param backups Include backups.
* @return Offheap iterator.
*/
- private GridIterator<IgniteBiTuple<K, V>> offheapIterator(GridCacheQueryAdapter<?> qry) {
+ private GridIterator<IgniteBiTuple<K, V>> offheapIterator(GridCacheQueryAdapter<?> qry, boolean backups) {
IgniteBiPredicate<K, V> filter = qry.scanFilter();
if (cctx.offheapTiered() && filter != null) {
OffheapIteratorClosure c = new OffheapIteratorClosure(filter, qry.keepPortable());
- return cctx.swap().rawOffHeapIterator(c);
+ return cctx.swap().rawOffHeapIterator(c, true, backups);
}
else {
- Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator();
+ Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator(true, backups);
return scanIterator(it, filter, qry.keepPortable());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index fc3efba..3c855ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -2040,7 +2040,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
for (Object key : keys) {
if (key == null) {
- setRollbackOnly();
+ rollback();
throw new NullPointerException("Null key.");
}
@@ -2191,7 +2191,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
drVer,
skipStore);
- if (!implicit() && readCommitted())
+ if (!implicit() && readCommitted() && !cacheCtx.offheapTiered())
cacheCtx.evicts().touch(entry, topologyVersion());
if (groupLock() && !lockOnly)
@@ -2934,19 +2934,17 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
assert loadFut.isDone();
return nonInterruptable(commitAsync().chain(new CX1<IgniteInternalFuture<IgniteInternalTx>, GridCacheReturn>() {
- @Override
- public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut)
+ @Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut)
throws IgniteCheckedException {
txFut.get();
- return (GridCacheReturn)implicitRes;
+ return implicitRes;
}
}));
}
else
return nonInterruptable(loadFut.chain(new CX1<IgniteInternalFuture<Set<KeyCacheObject>>, GridCacheReturn>() {
- @Override
- public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f)
+ @Override public GridCacheReturn applyx(IgniteInternalFuture<Set<KeyCacheObject>> f)
throws IgniteCheckedException {
f.get();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
index ebedadb..a99c4c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
@@ -293,6 +293,23 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
}
/**
+ * Gets iterator over contents of the given space.
+ *
+ * @param spaceName Space name.
+ * @param c Key/value closure.
+ * @param part Partition.
+ * @return Iterator.
+ */
+ public <T> GridCloseableIterator<T> iterator(@Nullable String spaceName,
+ CX2<T2<Long, Integer>, T2<Long, Integer>, T> c, int part) {
+ assert c != null;
+
+ GridOffHeapPartitionedMap m = offheap(spaceName);
+
+ return m == null ? new GridEmptyCloseableIterator<T>() : m.iterator(c, part);
+ }
+
+ /**
* Gets number of elements in the given space.
*
* @param spaceName Space name. Optional.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
index 49850ab..a945262 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
@@ -201,6 +201,15 @@ public interface GridOffHeapPartitionedMap {
public <T> GridCloseableIterator<T> iterator(CX2<T2<Long, Integer>, T2<Long, Integer>, T> c);
/**
+ * Gets iterator over the partition.
+ *
+ * @param c Key/value closure.
+ * @param part Partition.
+ * @return Iterator over the partition.
+ */
+ public <T> GridCloseableIterator<T> iterator(CX2<T2<Long, Integer>, T2<Long, Integer>, T> c, int part);
+
+ /**
* Gets iterator over certain partition.
*
* @param p Partition.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
index ba67b30..4ffc33f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
@@ -277,21 +277,8 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
/** {@inheritDoc} */
@Override public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator() {
- return new GridCloseableIteratorAdapter<IgniteBiTuple<byte[], byte[]>>() {
- private int p;
-
- private GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> curIt;
-
- {
- try {
- advance();
- }
- catch (IgniteCheckedException e) {
- e.printStackTrace(); // Should never happen.
- }
- }
-
- private void advance() throws IgniteCheckedException {
+ return new PartitionedMapCloseableIterator<IgniteBiTuple<byte[], byte[]>>() {
+ protected void advance() throws IgniteCheckedException {
curIt = null;
while (p < parts) {
@@ -305,34 +292,6 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
curIt = null;
}
-
- @Override protected IgniteBiTuple<byte[], byte[]> onNext() throws IgniteCheckedException {
- if (curIt == null)
- throw new NoSuchElementException();
-
- IgniteBiTuple<byte[], byte[]> t = curIt.next();
-
- if (!curIt.hasNext()) {
- curIt.close();
-
- advance();
- }
-
- return t;
- }
-
- @Override protected boolean onHasNext() {
- return curIt != null;
- }
-
- @Override protected void onRemove() {
- throw new UnsupportedOperationException();
- }
-
- @Override protected void onClose() throws IgniteCheckedException {
- if (curIt != null)
- curIt.close();
- }
};
}
@@ -340,21 +299,8 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
@Override public <T> GridCloseableIterator<T> iterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c) {
assert c != null;
- return new GridCloseableIteratorAdapter<T>() {
- private int p;
-
- private GridCloseableIterator<T> curIt;
-
- {
- try {
- advance();
- }
- catch (IgniteCheckedException e) {
- e.printStackTrace(); // Should never happen.
- }
- }
-
- private void advance() throws IgniteCheckedException {
+ return new PartitionedMapCloseableIterator<T>() {
+ protected void advance() throws IgniteCheckedException {
curIt = null;
while (p < parts) {
@@ -368,38 +314,16 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
curIt = null;
}
-
- @Override protected T onNext() throws IgniteCheckedException {
- if (curIt == null)
- throw new NoSuchElementException();
-
- T t = curIt.next();
-
- if (!curIt.hasNext()) {
- curIt.close();
-
- advance();
- }
-
- return t;
- }
-
- @Override protected boolean onHasNext() {
- return curIt != null;
- }
-
- @Override protected void onRemove() {
- throw new UnsupportedOperationException();
- }
-
- @Override protected void onClose() throws IgniteCheckedException {
- if (curIt != null)
- curIt.close();
- }
};
}
/** {@inheritDoc} */
+ @Override public <T> GridCloseableIterator<T> iterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c,
+ int part) {
+ return mapFor(part).iterator(c);
+ }
+
+ /** {@inheritDoc} */
@Override public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator(int p) {
return mapFor(p).iterator();
}
@@ -430,4 +354,63 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap {
public long lruSize() {
return lru.size();
}
+
+ /**
+ * Partitioned closable iterator.
+ */
+ private abstract class PartitionedMapCloseableIterator<T> extends GridCloseableIteratorAdapter<T> {
+ /** Current partition. */
+ protected int p;
+
+ /** Current iterator. */
+ protected GridCloseableIterator<T> curIt;
+
+ {
+ try {
+ advance();
+ }
+ catch (IgniteCheckedException e) {
+ e.printStackTrace(); // Should never happen.
+ }
+ }
+
+ /**
+ * Switch to next partition.
+ *
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract void advance() throws IgniteCheckedException;
+
+ /** {@inheritDoc} */
+ @Override protected T onNext() throws IgniteCheckedException {
+ if (curIt == null)
+ throw new NoSuchElementException();
+
+ T t = curIt.next();
+
+ if (!curIt.hasNext()) {
+ curIt.close();
+
+ advance();
+ }
+
+ return t;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean onHasNext() {
+ return curIt != null;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void onRemove() {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void onClose() throws IgniteCheckedException {
+ if (curIt != null)
+ curIt.close();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 4dc371c..70d8f9c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -50,6 +50,7 @@ import static java.util.concurrent.TimeUnit.*;
import static org.apache.ignite.cache.CacheAtomicityMode.*;
import static org.apache.ignite.cache.CacheMemoryMode.*;
import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CachePeekMode.*;
import static org.apache.ignite.events.EventType.*;
import static org.apache.ignite.testframework.GridTestUtils.*;
import static org.apache.ignite.transactions.TransactionConcurrency.*;
@@ -121,15 +122,15 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
/**
* @return {@code True} if values should be stored off-heap.
*/
- protected boolean offHeapValues() {
- return false;
+ protected CacheMemoryMode memoryMode() {
+ return ONHEAP_TIERED;
}
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- if (offHeapValues())
+ if (memoryMode() == OFFHEAP_TIERED || memoryMode() == OFFHEAP_VALUES)
cfg.setSwapSpaceSpi(new GridTestSwapSpaceSpi());
return cfg;
@@ -139,8 +140,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
@Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(gridName);
- if (offHeapValues()) {
- ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_VALUES);
+ if (memoryMode() == OFFHEAP_TIERED || memoryMode() == OFFHEAP_VALUES) {
+ ccfg.setMemoryMode(memoryMode());
ccfg.setOffHeapMaxMemory(0);
}
@@ -272,7 +273,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Will actually delete entry from map.
CU.invalidate(jcache(i), "key0");
- assertNull("Failed check for grid: " + i, jcache(i).localPeek("key0", CachePeekMode.ONHEAP));
+ assertNull("Failed check for grid: " + i, jcache(i).localPeek("key0", ONHEAP));
Collection<String> keysCol = mapped.get(grid(i).localNode());
@@ -288,20 +289,20 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
sum++;
- assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize(CachePeekMode.ALL));
+ assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize(ALL));
}
for (int i = 0; i < gridCount(); i++) {
Collection<String> keysCol = mapped.get(grid(i).localNode());
assertEquals("Failed check for grid: " + i, !F.isEmpty(keysCol) ? keysCol.size() : 0,
- jcache(i).localSize(CachePeekMode.PRIMARY));
+ jcache(i).localSize(PRIMARY));
}
int globalPrimarySize = map.size();
for (int i = 0; i < gridCount(); i++)
- assertEquals(globalPrimarySize, jcache(i).size(CachePeekMode.PRIMARY));
+ assertEquals(globalPrimarySize, jcache(i).size(PRIMARY));
int times = 1;
@@ -313,7 +314,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
int globalSize = globalPrimarySize * times;
for (int i = 0; i < gridCount(); i++)
- assertEquals(globalSize, jcache(i).size(CachePeekMode.ALL));
+ assertEquals(globalSize, jcache(i).size(ALL));
}
/**
@@ -735,7 +736,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", ONHEAP));
cache.remove("key1");
cache.put("key2", 1);
@@ -750,7 +751,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
/**
@@ -789,7 +790,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull("Failed for cache: " + i, jcache(i).localPeek("key3", ONHEAP));
cache.remove("key1");
cache.put("key2", 1);
@@ -804,7 +805,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
/**
@@ -874,9 +875,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Map<String, EntryProcessorResult<String>> res = cache.invokeAll(F.asSet("key1", "key2", "key3"), RMV_PROCESSOR);
for (int i = 0; i < gridCount(); i++) {
- assertNull(jcache(i).localPeek("key1", CachePeekMode.ONHEAP));
- assertNull(jcache(i).localPeek("key2", CachePeekMode.ONHEAP));
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key1", ONHEAP));
+ assertNull(jcache(i).localPeek("key2", ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
assertEquals("null", res.get("key1").get());
@@ -1232,7 +1233,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("key3"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("key3", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("key3", ONHEAP));
}
/**
@@ -1271,7 +1272,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(cache.get("k1"));
for (int i = 0; i < gridCount(); i++)
- assertNull(jcache(i).localPeek("k1", CachePeekMode.ONHEAP));
+ assertNull(jcache(i).localPeek("k1", ONHEAP));
final EntryProcessor<String, Integer, Integer> errProcessor = new EntryProcessor<String, Integer, Integer>() {
@Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
@@ -1692,7 +1693,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < gridCount(); i++) {
info("Peek on node [i=" + i + ", id=" + grid(i).localNode().id() + ", val=" +
- grid(i).cache(null).localPeek("key", CachePeekMode.ONHEAP) + ']');
+ grid(i).cache(null).localPeek("key", ONHEAP) + ']');
}
assertEquals((Integer)1, cache.getAndPutIfAbsent("key", 2));
@@ -2001,10 +2002,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < gridCount(); i++) {
info("Peek key on grid [i=" + i + ", nodeId=" + grid(i).localNode().id() +
- ", peekVal=" + grid(i).cache(null).localPeek("key", CachePeekMode.ONHEAP) + ']');
+ ", peekVal=" + grid(i).cache(null).localPeek("key", ONHEAP) + ']');
info("Peek key2 on grid [i=" + i + ", nodeId=" + grid(i).localNode().id() +
- ", peekVal=" + grid(i).cache(null).localPeek("key2", CachePeekMode.ONHEAP) + ']');
+ ", peekVal=" + grid(i).cache(null).localPeek("key2", ONHEAP) + ']');
}
assertEquals((Integer)6, cache.get("key2"));
@@ -2233,7 +2234,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testDeletedEntriesFlag() throws Exception {
- if (cacheMode() != LOCAL && cacheMode() != REPLICATED) {
+ if (cacheMode() != LOCAL && cacheMode() != REPLICATED && memoryMode() != OFFHEAP_TIERED) {
int cnt = 3;
IgniteCache<String, Integer> cache = jcache();
@@ -2288,9 +2289,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
String key = String.valueOf(i);
if (grid(0).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode()))
- assertEquals((Integer)i, jcache(g).localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals((Integer)i, peek(jcache(g), key));
else
- assertNull(jcache(g).localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(peek(jcache(g), key));
}
}
}
@@ -2475,6 +2476,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
}, NullPointerException.class, null);
+ assertEquals(0, grid(0).cache(null).localSize());
+
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
cache.removeAll(null);
@@ -2569,7 +2572,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Set<String> keys = new HashSet<>(primaryKeysForCache(cache, 2));
for (String key : keys)
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(cache.localPeek(key, ONHEAP));
Map<String, Integer> vals = new HashMap<>();
@@ -2584,17 +2587,17 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
for (String key : keys)
- assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(vals.get(key), peek(cache, key));
cache.clear();
for (String key : keys)
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(peek(cache, key));
loadAll(cache, keys, true);
for (String key : keys)
- assertEquals(vals.get(key), cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(vals.get(key), peek(cache, key));
}
/**
@@ -2703,7 +2706,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
try {
cache.clear();
- assertEquals(vals.get(first), peek(cache, first));
+ assertEquals(vals.get(first), cache.localPeek(first, ONHEAP));
}
finally {
lock.unlock();
@@ -2734,14 +2737,14 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.localEvict(Sets.union(ImmutableSet.of("key1", "key2"), keys));
- assert cache.localSize(CachePeekMode.ONHEAP) == 0;
+ assert cache.localSize(ONHEAP) == 0;
cache.clear();
cache.localPromote(ImmutableSet.of("key2", "key1"));
- assert cache.localPeek("key1", CachePeekMode.ONHEAP) == null;
- assert cache.localPeek("key2", CachePeekMode.ONHEAP) == null;
+ assert cache.localPeek("key1", ONHEAP) == null;
+ assert cache.localPeek("key2", ONHEAP) == null;
}
/**
@@ -2906,13 +2909,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Ignite ignite = primaryIgnite("key");
IgniteCache<String, Integer> cache = ignite.cache(null);
- assert cache.localPeek("key", CachePeekMode.ONHEAP) == null;
+ assert peek(cache, "key") == null;
cache.put("key", 1);
cache.replace("key", 2);
- assert cache.localPeek("key", CachePeekMode.ONHEAP) == 2;
+ assertEquals(2, peek(cache, "key").intValue());
}
/**
@@ -2944,7 +2947,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.remove("key");
assertNull(cache.get("key")); // localPeek ignores transactions.
- assertNotNull(cache.localPeek("key")); // localPeek ignores transactions.
+ assertNotNull(peek(cache, "key")); // localPeek ignores transactions.
tx.commit();
}
@@ -2960,7 +2963,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put("key", 1);
cache.remove("key");
- assertNull(cache.localPeek("key", CachePeekMode.ONHEAP));
+ assertNull(peek(cache, "key"));
}
/**
@@ -2986,11 +2989,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
// Expired entry should not be swapped.
cache.localEvict(Collections.singleton(key));
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(peek(cache, "key"));
cache.localPromote(Collections.singleton(key));
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(cache.localPeek(key, ONHEAP));
assertTrue(cache.localSize() == 0);
@@ -3021,7 +3024,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
c.put(key, 1);
- assertEquals(Integer.valueOf(1), c.localPeek(key, CachePeekMode.ONHEAP));
+ assertEquals(Integer.valueOf(1), peek(c, key));
int ttl = 500;
@@ -3031,7 +3034,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Thread.sleep(ttl + 100);
- assert c.localPeek(key, CachePeekMode.ONHEAP) == null;
+ assert peek(c, key) == null;
assert c.localSize() == 0 : "Cache is not empty.";
}
@@ -3058,7 +3061,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Thread.sleep(ttl + 100);
- assertNull(c.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(c.localPeek(key, ONHEAP));
assert c.localSize() == 0;
}
@@ -3092,6 +3095,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
private void checkTtl(boolean inTx, boolean oldEntry) throws Exception {
+ if (memoryMode() == OFFHEAP_TIERED)
+ return;
+
int ttl = 1000;
final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(MILLISECONDS, ttl));
@@ -3361,15 +3367,15 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put(key2, 2);
cache.put(key3, 3);
- assert cache.localPeek(key1, CachePeekMode.ONHEAP) == 1;
- assert cache.localPeek(key2, CachePeekMode.ONHEAP) == 2;
- assert cache.localPeek(key3, CachePeekMode.ONHEAP) == 3;
+ assert peek(cache, key1) == 1;
+ assert peek(cache, key2) == 2;
+ assert peek(cache, key3) == 3;
cache.localEvict(F.asList(key1, key2));
- assert cache.localPeek(key1, CachePeekMode.ONHEAP) == null;
- assert cache.localPeek(key2, CachePeekMode.ONHEAP) == null;
- assert cache.localPeek(key3, CachePeekMode.ONHEAP) == 3;
+ assert cache.localPeek(key1, ONHEAP) == null;
+ assert cache.localPeek(key2, ONHEAP) == null;
+ assert peek(cache, key3) == 3;
loadAll(cache, ImmutableSet.of(key1, key2), true);
@@ -3391,7 +3397,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testUnswap() throws Exception {
- GridCacheAdapter<String, Integer> cache = ((IgniteKernal)grid(0)).internalCache();
+ IgniteCache<String, Integer> cache = grid(0).cache(null);
List<String> keys = primaryKeysForCache(jcache(), 3);
@@ -3408,17 +3414,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Collection<String> locKeys = new HashSet<>();
- if (cache.context().affinityNode()) {
- locKeys.addAll(cache.primaryKeySet());
+ if (grid(0).context().cache().cache(null).context().affinityNode()) {
+ Iterable<Cache.Entry<String, Integer>> entries = cache.localEntries(PRIMARY, BACKUP);
- info("Local keys (primary): " + locKeys);
-
- locKeys.addAll(cache.keySet(new CacheEntryPredicateAdapter() {
- @Override public boolean apply(GridCacheEntryEx e) {
- return grid(0).affinity(null).isBackup(grid(0).localNode(),
- e.key().value(e.context().cacheObjectContext(), false));
- }
- }));
+ for (Cache.Entry<String, Integer> entry : entries)
+ locKeys.add(entry.getKey());
info("Local keys (primary + backup): " + locKeys);
}
@@ -3444,57 +3444,67 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}, EVT_CACHE_OBJECT_SWAPPED, EVT_CACHE_OBJECT_UNSWAPPED);
}
- cache.evictAll(Collections.singleton(k2));
- cache.evictAll(Collections.singleton(k3));
+ cache.localEvict(F.asList(k2, k3));
- assertNotNull(cache.localPeek(k1, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k2, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k3, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
+ if (memoryMode() == OFFHEAP_TIERED) {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
+ else {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
int cnt = 0;
if (locKeys.contains(k2)) {
- assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES));
- cache.promoteAll(Collections.singleton(k2));
+ cache.localPromote(Collections.singleton(k2));
- assertEquals((Integer) 2, cache.localPeek(k2, ONHEAP_PEEK_MODES, null));
+ assertEquals((Integer) 2, cache.localPeek(k2, ONHEAP_PEEK_MODES));
cnt++;
}
else {
- cache.promoteAll(Collections.singleton(k2));
+ cache.localPromote(Collections.singleton(k2));
- assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k2, ONHEAP_PEEK_MODES));
}
if (locKeys.contains(k3)) {
- assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES));
- cache.promoteAll(Collections.singleton(k3));
+ cache.localPromote(Collections.singleton(k3));
- assertEquals((Integer)3, cache.localPeek(k3, ONHEAP_PEEK_MODES, null));
+ assertEquals((Integer)3, cache.localPeek(k3, ONHEAP_PEEK_MODES));
cnt++;
}
else {
- cache.promoteAll(Collections.singleton(k3));
+ cache.localPromote(Collections.singleton(k3));
- assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES, null));
+ assertNull(cache.localPeek(k3, ONHEAP_PEEK_MODES));
}
- assertEquals(cnt, swapEvts.get());
- assertEquals(cnt, unswapEvts.get());
+ if (memoryMode() != OFFHEAP_TIERED) {
+ assertEquals(cnt, swapEvts.get());
+ assertEquals(cnt, unswapEvts.get());
+ }
- cache.evictAll(Collections.singleton(k1));
+ cache.localEvict(Collections.singleton(k1));
assertEquals((Integer)1, cache.get(k1));
if (locKeys.contains(k1))
cnt++;
- assertEquals(cnt, swapEvts.get());
- assertEquals(cnt, unswapEvts.get());
+ if (memoryMode() != OFFHEAP_TIERED) {
+ assertEquals(cnt, swapEvts.get());
+ assertEquals(cnt, unswapEvts.get());
+ }
cache.clear();
@@ -3506,14 +3516,21 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
swapEvts.set(0);
unswapEvts.set(0);
- cache.evictAll(Collections.singleton(k2));
- cache.evictAll(Collections.singleton(k3));
+ cache.localEvict(Collections.singleton(k2));
+ cache.localEvict(Collections.singleton(k3));
- assertNotNull(cache.localPeek(k1, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k2, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
- assertNull(cache.localPeek(k3, new CachePeekMode[] {CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP}, null));
+ if (memoryMode() == OFFHEAP_TIERED) {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNotNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
+ else {
+ assertNotNull(cache.localPeek(k1, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k2, ONHEAP, OFFHEAP));
+ assertNull(cache.localPeek(k3, ONHEAP, OFFHEAP));
+ }
- cache.promoteAll(F.asList(k2, k3));
+ cache.localPromote(F.asSet(k2, k3));
cnt = 0;
@@ -3523,8 +3540,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (locKeys.contains(k3))
cnt++;
- assertEquals(cnt, swapEvts.get());
- assertEquals(cnt, unswapEvts.get());
+ if (memoryMode() != OFFHEAP_TIERED) {
+ assertEquals(cnt, swapEvts.get());
+ assertEquals(cnt, unswapEvts.get());
+ }
}
/**
@@ -3557,7 +3576,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
Thread.sleep(ttl + 100);
// Peek will actually remove entry from cache.
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
+ assertNull(cache.localPeek(key, ONHEAP));
assert cache.localSize() == 0;
@@ -3654,6 +3673,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertTrue(cache.remove("key" + i));
}
});
+
+ CU.inTx(ignite(0), jcache(), concurrency, isolation, new CIX1<IgniteCache<String, Integer>>() {
+ @Override public void applyx(IgniteCache<String, Integer> cache) {
+ for (int i = 0; i < cnt; i++)
+ assertNull(cache.get("key" + i));
+ }
+ });
}
}
@@ -3745,6 +3771,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
protected void checkSize(Collection<String> keys) throws Exception {
+ if (memoryMode() == OFFHEAP_TIERED)
+ return;
+
if (nearEnabled())
assertEquals(keys.size(), jcache().localSize(CachePeekMode.ALL));
else {
@@ -3768,7 +3797,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
}
- assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize(CachePeekMode.ALL));
+ assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize(ALL));
}
}
}
@@ -3779,8 +3808,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
*/
protected void checkKeySize(Collection<String> keys) throws Exception {
if (nearEnabled())
- assertEquals("Invalid key size: " + jcache().localSize(CachePeekMode.ALL),
- keys.size(), jcache().localSize(CachePeekMode.ALL));
+ assertEquals("Invalid key size: " + jcache().localSize(ALL),
+ keys.size(), jcache().localSize(ALL));
else {
for (int i = 0; i < gridCount(); i++) {
GridCacheContext<String, Integer> ctx = context(i);
@@ -3791,7 +3820,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
size++;
- assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize(CachePeekMode.ALL));
+ assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize(ALL));
}
}
}
@@ -4390,7 +4419,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertFalse(cacheSkipStore.iterator().hasNext());
assertTrue(map.size() == 0);
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
// putAll/removeAll from multiple nodes.
@@ -4479,8 +4508,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertTrue(map.containsKey(rmvKey));
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
- assertTrue(cacheSkipStore.size(CachePeekMode.ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
+ assertTrue(cacheSkipStore.size(ALL) == 0);
cache.remove(rmvKey);
@@ -4723,8 +4752,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
for (int i = 0; i < keys.size(); i++)
putToStore(keys.get(i), i);
- assertTrue(cacheSkipStore.size(CachePeekMode.ALL) == 0);
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
+ assertTrue(cacheSkipStore.size(ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
assertTrue(map.size() != 0);
try (Transaction tx = txs.txStart(txConcurrency, txIsolation)) {
@@ -4813,8 +4842,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
*/
private void checkEmpty(IgniteCache<String, Integer> cache, IgniteCache<String, Integer> cacheSkipStore)
throws Exception {
- assertTrue(cache.size(CachePeekMode.ALL) == 0);
- assertTrue(cacheSkipStore.size(CachePeekMode.ALL) == 0);
+ assertTrue(cache.size(ALL) == 0);
+ assertTrue(cacheSkipStore.size(ALL) == 0);
assertTrue(map.size() == 0);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index 342eb5a..efd0185 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -393,8 +393,8 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
@Nullable protected <K, V> V peek(IgniteCache<K, V> cache, K key) throws Exception {
- return offheapTiered(cache) ? cache.localPeek(key, CachePeekMode.SWAP) : cache.localPeek(key,
- CachePeekMode.ONHEAP);
+ return offheapTiered(cache) ? cache.localPeek(key, CachePeekMode.SWAP, CachePeekMode.OFFHEAP) :
+ cache.localPeek(key, CachePeekMode.ONHEAP);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java
new file mode 100644
index 0000000..671d6c4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java
@@ -0,0 +1,127 @@
+/*
+ * 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 org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ * Off-heap tiered test.
+ */
+public class OffHeapTieredTransactionSelfTest extends GridCommonAbstractTest {
+ /** IP finder. */
+ private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration ccfg = defaultCacheConfiguration();
+
+ ccfg.setMemoryMode(OFFHEAP_TIERED);
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+ ccfg.setOffHeapMaxMemory(0);
+ ccfg.setSwapEnabled(true);
+ ccfg.setCacheMode(REPLICATED);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(ipFinder);
+
+ cfg.setDiscoverySpi(disco);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 30_000;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGrids(2);
+
+ awaitPartitionMapExchange();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception In case of error.
+ */
+ public void testPutAll() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).cache(null);
+
+ final int KEYS = 5;
+
+ Map<String, Integer> data = new LinkedHashMap<>();
+
+ for (int i = 0; i < KEYS; i++)
+ data.put("key_" + i, i);
+
+ checkPutAll(cache, data, OPTIMISTIC, READ_COMMITTED);
+
+ checkPutAll(cache, data, OPTIMISTIC, REPEATABLE_READ);
+
+ checkPutAll(cache, data, OPTIMISTIC, SERIALIZABLE);
+
+ checkPutAll(cache, data, PESSIMISTIC, READ_COMMITTED);
+
+ checkPutAll(cache, data, PESSIMISTIC, REPEATABLE_READ);
+
+ checkPutAll(cache, data, PESSIMISTIC, SERIALIZABLE);
+ }
+
+ /**
+ * @throws Exception In case of error.
+ */
+ private void checkPutAll(IgniteCache<String, Integer> cache, Map<String, Integer> data,
+ TransactionConcurrency txConcurrency, TransactionIsolation txIsolation) throws Exception {
+ IgniteTransactions txs = cache.unwrap(Ignite.class).transactions();
+
+ try (Transaction tx = txs.txStart(txConcurrency, txIsolation)) {
+ cache.putAll(data);
+
+ tx.commit();
+ }
+
+ for (Map.Entry<String, Integer> entry : data.entrySet())
+ assertEquals(entry.getValue(), cache.get(entry.getKey()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
new file mode 100644
index 0000000..686cc31
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.distributed.dht;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ * Tests colocated cache with off-heap tiered mode.
+ */
+public class GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean txEnabled() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean lockingEnabled() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
index c3a69e2..2dd07ff 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.java
@@ -17,13 +17,17 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMemoryMode.*;
+
/**
* Tests colocated cache with values being stored off-heap.
*/
public class GridCachePartitionedNearDisabledOffHeapFullApiSelfTest extends
GridCachePartitionedNearDisabledFullApiSelfTest {
/** {@inheritDoc} */
- @Override protected boolean offHeapValues() {
- return true;
+ @Override protected CacheMemoryMode memoryMode() {
+ return OFFHEAP_VALUES;
}
}
[37/50] [abbrv] incubator-ignite git commit: devnotes security fix
Posted by vo...@apache.org.
devnotes security fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2d4a3fb7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2d4a3fb7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2d4a3fb7
Branch: refs/heads/ignite-gg-9614
Commit: 2d4a3fb790e64df897247820013d80cb4fefbbae
Parents: e9f2e6d
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 12:49:06 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 12:49:06 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 6 ------
1 file changed, 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2d4a3fb7/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index 7618e6c..dfba3a9 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -58,12 +58,6 @@ Deploy Ignite release to maven repository and site:
mvn deploy -P apache-release,gpg,release,scala,lgpl,deploy-ignite-site -Dignite.edition=fabric -DskipTests -Dignite.site=scp://people.apache.org:/home/<username>/public_html -B
-You might need to allow connection to people.apache.org. Just do following at console:
-
-ssh people.apache.org
-
-and type "yes" + enter.
-
In case you want to release both fabric and hadoop editions you have to build hadoop first, save /target/bin/*.zip, make "mvn clean" and
restore them before deploy step.
[03/50] [abbrv] incubator-ignite git commit: ignite-855
Posted by vo...@apache.org.
ignite-855
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/eab2e538
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/eab2e538
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/eab2e538
Branch: refs/heads/ignite-gg-9614
Commit: eab2e538a53042c2a8f252d22ff50957a48ae364
Parents: 07a4258
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed May 6 11:21:57 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed May 6 11:21:57 2015 +0300
----------------------------------------------------------------------
.../cache/query/GridCacheSqlQuery.java | 2 +-
.../cache/query/GridCacheTwoStepQuery.java | 17 +++
.../processors/query/h2/IgniteH2Indexing.java | 4 +
.../processors/query/h2/sql/GridSqlQuery.java | 20 ++++
.../query/h2/sql/GridSqlQueryParser.java | 10 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 11 +-
.../processors/query/h2/sql/GridSqlSelect.java | 2 +-
.../processors/query/h2/sql/GridSqlUnion.java | 2 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 3 +
.../h2/twostep/GridReduceQueryExecutor.java | 119 +++++++++++++++----
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 21 ++++
11 files changed, 184 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
index 0c1c822..7a0e140 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
@@ -64,7 +64,7 @@ public class GridCacheSqlQuery implements Message {
* @param qry Query.
* @param params Query parameters.
*/
- GridCacheSqlQuery(String alias, String qry, Object[] params) {
+ public GridCacheSqlQuery(String alias, String qry, Object[] params) {
A.ensure(!F.isEmpty(qry), "qry must not be empty");
this.alias = alias;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
index ce12a85..53fc7a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
@@ -43,6 +43,9 @@ public class GridCacheTwoStepQuery {
/** */
private int pageSize = DFLT_PAGE_SIZE;
+ /** */
+ private boolean explain;
+
/**
* @param qry Reduce query.
* @param params Reduce query parameters.
@@ -52,6 +55,20 @@ public class GridCacheTwoStepQuery {
}
/**
+ * @return If this is explain query.
+ */
+ public boolean explain() {
+ return explain;
+ }
+
+ /**
+ * @param explain If this is explain query.
+ */
+ public void explain(boolean explain) {
+ this.explain = explain;
+ }
+
+ /**
* @param pageSize Page size.
*/
public void pageSize(int pageSize) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 9579de3..975378c 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -1321,6 +1321,10 @@ public class IgniteH2Indexing implements GridQueryIndexing {
throw new IgniteCheckedException("Cache already registered: " + U.maskName(ccfg.getName()));
createSchema(schema);
+
+ executeStatement(schema, "CREATE ALIAS " + GridSqlQuerySplitter.TABLE_FUNC_NAME +
+ " NOBUFFER FOR \"" + GridReduceQueryExecutor.class.getName() + ".mergeTableFunction\"");
+
createSqlFunctions(schema, ccfg.getSqlFunctionClasses());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuery.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuery.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuery.java
index c40632f..207588e 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuery.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuery.java
@@ -37,6 +37,26 @@ public abstract class GridSqlQuery implements Cloneable {
/** */
protected GridSqlElement limit;
+ /** */
+ private boolean explain;
+
+ /**
+ * @param explain Explain.
+ * @return {@code this}.
+ */
+ public GridSqlQuery explain(boolean explain) {
+ this.explain = explain;
+
+ return this;
+ }
+
+ /**
+ * @return {@code true} If explain.
+ */
+ public boolean explain() {
+ return explain;
+ }
+
/**
* @return Offset.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
index 62ec72f..74e4748 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
@@ -158,6 +158,9 @@ public class GridSqlQueryParser {
private static final Getter<SelectUnion, SortOrder> UNION_SORT = getter(SelectUnion.class, "sort");
/** */
+ private static final Getter<Explain, Prepared> EXPLAIN_COMMAND = getter(Explain.class, "command");
+
+ /** */
private static volatile Getter<Command,Prepared> prepared;
/** */
@@ -182,7 +185,7 @@ public class GridSqlQueryParser {
Prepared statement = p.get(cmd);
- return new GridSqlQueryParser().parse((Query)statement);
+ return new GridSqlQueryParser().parse(statement);
}
/**
@@ -321,13 +324,16 @@ public class GridSqlQueryParser {
/**
* @param qry Select.
*/
- public GridSqlQuery parse(Query qry) {
+ public GridSqlQuery parse(Prepared qry) {
if (qry instanceof Select)
return parse((Select)qry);
if (qry instanceof SelectUnion)
return parse((SelectUnion)qry);
+ if (qry instanceof Explain)
+ return parse(EXPLAIN_COMMAND.get((Explain)qry)).explain(true);
+
throw new UnsupportedOperationException("Unknown query type: " + qry);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
index 73d7751..6c7e2e2 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
@@ -78,7 +78,7 @@ public class GridSqlQuerySplitter {
if (params == null)
params = GridCacheSqlQuery.EMPTY_PARAMS;
- GridSqlQuery qry0 = GridSqlQueryParser.parse(stmt);
+ final GridSqlQuery qry0 = GridSqlQueryParser.parse(stmt);
GridSqlSelect srcQry;
@@ -87,6 +87,8 @@ public class GridSqlQuerySplitter {
else { // Handle UNION.
srcQry = new GridSqlSelect().from(new GridSqlSubquery(qry0));
+ srcQry.explain(qry0.explain());
+
GridSqlSelect left = leftest(qry0);
int c = 0;
@@ -127,7 +129,10 @@ public class GridSqlQuerySplitter {
// Create map and reduce queries.
GridSqlSelect mapQry = srcQry.clone();
- GridSqlSelect rdcQry = new GridSqlSelect().from(new GridSqlFunction("PUBLIC", TABLE_FUNC_NAME)); // table(mergeTable)); TODO
+
+ mapQry.explain(false);
+
+ GridSqlSelect rdcQry = new GridSqlSelect().from(new GridSqlFunction(null, TABLE_FUNC_NAME)); // table(mergeTable)); TODO
// Split all select expressions into map-reduce parts.
List<GridSqlElement> mapExps = F.addAll(
@@ -213,6 +218,8 @@ public class GridSqlQuerySplitter {
res.addMapQuery(mergeTable, mapQry.getSQL(),
findParams(mapQry, params, new ArrayList<>(params.length)).toArray());
+ res.explain(qry0.explain());
+
return res;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
index 0786eac..9972bba 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
@@ -68,7 +68,7 @@ public class GridSqlSelect extends GridSqlQuery {
/** {@inheritDoc} */
@Override public String getSQL() {
- StatementBuilder buff = new StatementBuilder("SELECT");
+ StatementBuilder buff = new StatementBuilder(explain() ? "EXPLAIN SELECT" : "SELECT");
if (distinct)
buff.append(" DISTINCT");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlUnion.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlUnion.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlUnion.java
index 23c18ed..96beb6b 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlUnion.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlUnion.java
@@ -47,7 +47,7 @@ public class GridSqlUnion extends GridSqlQuery {
/** {@inheritDoc} */
@Override public String getSQL() {
- StatementBuilder buff = new StatementBuilder();
+ StatementBuilder buff = new StatementBuilder(explain() ? "EXPLAIN \n" : "");
buff.append('(').append(left.getSQL()).append(')');
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 66b3636..f15a2da 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -141,6 +141,9 @@ public class GridMapQueryExecutor {
ClusterNode node = ctx.discovery().node(nodeId);
+ if (node == null)
+ return; // Node left, ignore.
+
boolean processed = true;
if (msg instanceof GridQueryRequest)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index e175a43..09a238f 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -28,13 +28,13 @@ import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.processors.query.h2.*;
-import org.apache.ignite.internal.processors.query.h2.sql.*;
import org.apache.ignite.internal.processors.query.h2.twostep.messages.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.marshaller.*;
import org.apache.ignite.plugin.extensions.communication.*;
+import org.h2.command.*;
import org.h2.command.ddl.*;
import org.h2.command.dml.Query;
import org.h2.engine.*;
@@ -152,9 +152,6 @@ public class GridReduceQueryExecutor {
}
}
}, EventType.EVT_NODE_FAILED, EventType.EVT_NODE_LEFT);
-
- h2.executeStatement("PUBLIC", "CREATE ALIAS " + GridSqlQuerySplitter.TABLE_FUNC_NAME +
- " NOBUFFER FOR \"" + GridReduceQueryExecutor.class.getName() + ".mergeTableFunction\"");
}
/**
@@ -167,6 +164,9 @@ public class GridReduceQueryExecutor {
ClusterNode node = ctx.discovery().node(nodeId);
+ if (node == null)
+ return; // Node left, ignore.
+
boolean processed = true;
if (msg instanceof GridQueryNextPageResponse)
@@ -280,15 +280,16 @@ public class GridReduceQueryExecutor {
String space = cctx.name();
- r.conn = h2.connectionForSpace(space);
+ r.conn = (JdbcConnection)h2.connectionForSpace(space);
// TODO Add topology version.
ClusterGroup dataNodes = ctx.grid().cluster().forDataNodes(space);
- if (cctx.isReplicated()) {
- assert dataNodes.node(ctx.localNodeId()) == null : "We must be on a client node.";
+ if (cctx.isReplicated() || qry.explain()) {
+ assert qry.explain() || dataNodes.node(ctx.localNodeId()) == null : "We must be on a client node.";
- dataNodes = dataNodes.forRandom(); // Select random data node to run query on a replicated data.
+ // Select random data node to run query on a replicated data or get EXPLAIN PLAN from a single node.
+ dataNodes = dataNodes.forRandom();
}
final Collection<ClusterNode> nodes = dataNodes.nodes();
@@ -297,7 +298,7 @@ public class GridReduceQueryExecutor {
GridMergeTable tbl;
try {
- tbl = createFunctionTable((JdbcConnection)r.conn, mapQry); // createTable(r.conn, mapQry); TODO
+ tbl = createFunctionTable(r.conn, mapQry, qry.explain()); // createTable(r.conn, mapQry); TODO
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -318,20 +319,32 @@ public class GridReduceQueryExecutor {
runs.put(qryReqId, r);
try {
+ Collection<GridCacheSqlQuery> mapQrys = qry.mapQueries();
+
+ if (qry.explain()) {
+ mapQrys = new ArrayList<>(qry.mapQueries().size());
+
+ for (GridCacheSqlQuery mapQry : qry.mapQueries())
+ mapQrys.add(new GridCacheSqlQuery(mapQry.alias(), "EXPLAIN " + mapQry.query(), mapQry.parameters()));
+ }
+
if (nodes.size() != 1 || !F.first(nodes).isLocal()) { // Marshall params for remotes.
Marshaller m = ctx.config().getMarshaller();
- for (GridCacheSqlQuery mapQry : qry.mapQueries())
+ for (GridCacheSqlQuery mapQry : mapQrys)
mapQry.marshallParams(m);
}
- send(nodes, new GridQueryRequest(qryReqId, r.pageSize, space, qry.mapQueries()));
+ send(nodes, new GridQueryRequest(qryReqId, r.pageSize, space, mapQrys));
r.latch.await();
if (r.rmtErr != null)
throw new CacheException("Failed to run map query remotely.", r.rmtErr);
+ if (qry.explain())
+ return explainPlan(r.conn, space, qry);
+
GridCacheSqlQuery rdc = qry.reduceQuery();
final ResultSet res = h2.executeSqlQueryWithTimer(space, r.conn, rdc.query(), F.asList(rdc.parameters()));
@@ -362,6 +375,55 @@ public class GridReduceQueryExecutor {
}
/**
+ * @param c Connection.
+ * @param space Space.
+ * @param qry Query.
+ * @return Cursor for plans.
+ * @throws IgniteCheckedException if failed.
+ */
+ private QueryCursor<List<?>> explainPlan(JdbcConnection c, String space, GridCacheTwoStepQuery qry)
+ throws IgniteCheckedException {
+ List<List<?>> lists = new ArrayList<>();
+
+ for (GridCacheSqlQuery mapQry : qry.mapQueries()) {
+ ResultSet rs = h2.executeSqlQueryWithTimer(space, c, "SELECT PLAN FROM " + mapQry.alias(), null);
+
+ lists.add(F.asList(getPlan(rs)));
+ }
+
+ for (GridCacheSqlQuery mapQry : qry.mapQueries()) {
+ GridMergeTable tbl = createFunctionTable(c, mapQry, false);
+
+ curFunTbl.set(tbl); // Now it will be only a single table.
+ }
+
+ GridCacheSqlQuery rdc = qry.reduceQuery();
+
+ ResultSet rs = h2.executeSqlQueryWithTimer(space, c, "EXPLAIN " + rdc.query(), F.asList(rdc.parameters()));
+
+ lists.add(F.asList(getPlan(rs)));
+
+ return new QueryCursorImpl<>(lists.iterator());
+ }
+
+ /**
+ * @param rs Result set.
+ * @return Plan.
+ * @throws IgniteCheckedException If failed.
+ */
+ private String getPlan(ResultSet rs) throws IgniteCheckedException {
+ try {
+ if (!rs.next())
+ throw new IllegalStateException();
+
+ return rs.getString(1);
+ }
+ catch (SQLException e) {
+ throw new IgniteCheckedException(e);
+ }
+ }
+
+ /**
* @param nodes Nodes.
* @param msg Message.
* @throws IgniteCheckedException If failed.
@@ -502,10 +564,12 @@ public class GridReduceQueryExecutor {
/**
* @param conn Connection.
* @param qry Query.
+ * @param explain Explain.
* @return Table.
* @throws IgniteCheckedException
*/
- private GridMergeTable createFunctionTable(JdbcConnection conn, GridCacheSqlQuery qry) throws IgniteCheckedException {
+ private GridMergeTable createFunctionTable(JdbcConnection conn, GridCacheSqlQuery qry, boolean explain)
+ throws IgniteCheckedException {
try {
Session ses = (Session)conn.getSession();
@@ -515,17 +579,21 @@ public class GridReduceQueryExecutor {
data.schema = ses.getDatabase().getSchema(ses.getCurrentSchemaName());
data.create = true;
- Query prepare = (Query)ses.prepare(qry.query(), false);
+ if (!explain) {
+ Prepared prepare = ses.prepare(qry.query(), false);
- List<org.h2.expression.Parameter> parsedParams = prepare.getParameters();
+ List<org.h2.expression.Parameter> parsedParams = prepare.getParameters();
- for (int i = Math.min(parsedParams.size(), qry.parameters().length); --i >= 0; ) {
- Object val = qry.parameters()[i];
+ for (int i = Math.min(parsedParams.size(), qry.parameters().length); --i >= 0; ) {
+ Object val = qry.parameters()[i];
- parsedParams.get(i).setValue(DataType.convertToValue(ses, val, Value.UNKNOWN));
- }
+ parsedParams.get(i).setValue(DataType.convertToValue(ses, val, Value.UNKNOWN));
+ }
- data.columns = generateColumnsFromQuery(prepare);
+ data.columns = generateColumnsFromQuery((Query)prepare);
+ }
+ else
+ data.columns = planColumns();
return new GridMergeTable(data);
}
@@ -537,6 +605,17 @@ public class GridReduceQueryExecutor {
}
/**
+ * @return Columns.
+ */
+ private static ArrayList<Column> planColumns() {
+ ArrayList<Column> res = new ArrayList<>(1);
+
+ res.add(new Column("PLAN", Value.STRING));
+
+ return res;
+ }
+
+ /**
* @param conn Connection.
* @param qry Query.
* @return Table.
@@ -573,7 +652,7 @@ public class GridReduceQueryExecutor {
private CountDownLatch latch;
/** */
- private Connection conn;
+ private JdbcConnection conn;
/** */
private int pageSize;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eab2e538/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index c2722fa..3159589 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.processors.datastructures.*;
import org.apache.ignite.internal.processors.query.*;
+import org.apache.ignite.internal.processors.query.h2.sql.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.*;
@@ -298,6 +299,26 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
}
}
+ /**
+ *
+ */
+ public void testExplain() {
+ List<List<?>> res = grid(0).cache(null).query(new SqlFieldsQuery(
+ "explain select p.age, p.name, o.name " +
+ "from Person p, Organization o where p.orgId = o.id")).getAll();
+
+ for (List<?> row : res)
+ X.println("____ : " + row);
+
+ if (cacheMode() == PARTITIONED) {
+ assertEquals(2, res.size());
+
+ assertTrue(((String)res.get(1).get(0)).contains(GridSqlQuerySplitter.TABLE_FUNC_NAME));
+ }
+ else
+ assertEquals(1, res.size());
+ }
+
/** @throws Exception If failed. */
public void testExecuteWithMetaData() throws Exception {
QueryCursorImpl<List<?>> cursor = (QueryCursorImpl<List<?>>)grid(0).cache(null).query(new SqlFieldsQuery(
[31/50] [abbrv] incubator-ignite git commit: sprint-4 -> sprint-5
merge fix
Posted by vo...@apache.org.
sprint-4 -> sprint-5 merge fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e8a38e04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e8a38e04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e8a38e04
Branch: refs/heads/ignite-gg-9614
Commit: e8a38e04e9ff6fca30953d72bd657889c1c17456
Parents: 17bf271
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 11:58:48 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 11:58:48 2015 +0300
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8a38e04/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 86b77fa..c445fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -508,8 +508,8 @@
<configuration>
<failOnError>false</failOnError>
<target>
- <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}-incubating.zip" classifier="fabric" type="zip" />
- <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}-incubating.zip" classifier="hadoop" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-fabric-${project.version}.zip" classifier="fabric" type="zip" />
+ <attachartifact file="${basedir}/target/bin/ignite-hadoop-${project.version}.zip" classifier="hadoop" type="zip" />
</target>
</configuration>
</execution>
[41/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-5' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-sprint-5
Posted by vo...@apache.org.
Merge branch 'ignite-sprint-5' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/23616406
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/23616406
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/23616406
Branch: refs/heads/ignite-gg-9614
Commit: 23616406ee0989c743bbb2e9f088db3dcdc6d6e1
Parents: a983125 f62afc6
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri May 8 15:16:37 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri May 8 15:16:37 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../processors/cache/GridCacheAdapter.java | 26 ++-
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheProxyImpl.java | 24 --
.../processors/cache/GridCacheSwapManager.java | 215 +++++++++++++-----
.../processors/cache/IgniteInternalCache.java | 27 ---
.../colocated/GridDhtColocatedLockFuture.java | 2 +
.../distributed/near/GridNearCacheAdapter.java | 10 -
.../processors/cache/local/GridLocalCache.java | 8 +-
.../local/atomic/GridLocalAtomicCache.java | 27 ++-
.../cache/query/GridCacheQueryManager.java | 21 +-
.../transactions/IgniteTxLocalAdapter.java | 12 +-
.../processors/igfs/IgfsDeleteWorker.java | 4 +
.../offheap/GridOffHeapProcessor.java | 17 ++
.../util/offheap/GridOffHeapPartitionedMap.java | 9 +
.../unsafe/GridUnsafePartitionedMap.java | 155 ++++++-------
.../core/src/main/resources/ignite.properties | 2 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 227 +++++++++++--------
.../cache/GridCacheAbstractSelfTest.java | 4 +-
.../cache/OffHeapTieredTransactionSelfTest.java | 127 +++++++++++
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 43 ++++
...ionedNearDisabledOffHeapFullApiSelfTest.java | 8 +-
...DisabledOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...abledOffHeapTieredAtomicFullApiSelfTest.java | 56 +++++
...earDisabledOffHeapTieredFullApiSelfTest.java | 33 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...CacheAtomicOffHeapTieredFullApiSelfTest.java | 32 +++
...icOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...yWriteOrderOffHeapTieredFullApiSelfTest.java | 33 +++
...erOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...achePartitionedMultiNodeFullApiSelfTest.java | 15 +-
...dCachePartitionedOffHeapFullApiSelfTest.java | 8 +-
...titionedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...PartitionedOffHeapTieredFullApiSelfTest.java | 32 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 72 ++++++
...idCacheReplicatedOffHeapFullApiSelfTest.java | 8 +-
...plicatedOffHeapMultiNodeFullApiSelfTest.java | 8 +-
...eReplicatedOffHeapTieredFullApiSelfTest.java | 33 +++
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 33 +++
...LocalAtomicOffHeapTieredFullApiSelfTest.java | 32 +++
.../GridCacheLocalOffHeapFullApiSelfTest.java | 6 +-
...dCacheLocalOffHeapTieredFullApiSelfTest.java | 32 +++
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 +
.../IgniteCacheFullApiSelfTestSuite.java | 18 ++
.../testsuites/IgniteCacheTestSuite3.java | 3 -
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
...eQueryMultiThreadedOffHeapTiredSelfTest.java | 37 +++
.../IgniteCacheQueryMultiThreadedSelfTest.java | 29 ++-
.../IgniteCacheQuerySelfTestSuite.java | 1 +
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 6 +-
78 files changed, 1269 insertions(+), 404 deletions(-)
----------------------------------------------------------------------
[45/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-4' into ignite-sprint-5
Conflicts:
DEVNOTES.txt
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c9cd92ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c9cd92ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c9cd92ef
Branch: refs/heads/ignite-gg-9614
Commit: c9cd92ef29e2387e3290310a04809347808419d4
Parents: 2361640 ecc7a50
Author: avinogradov <av...@gridgain.com>
Authored: Fri May 8 17:50:26 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Fri May 8 17:50:26 2015 +0300
----------------------------------------------------------------------
parent/pom.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
[11/50] [abbrv] incubator-ignite git commit: ignite-848 Excessive
memory and CPU consumption by TTL manager
Posted by vo...@apache.org.
ignite-848 Excessive memory and CPU consumption by TTL manager
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/70872aa6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/70872aa6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/70872aa6
Branch: refs/heads/ignite-gg-9614
Commit: 70872aa6ad3c90fca974f308bf8d293c9f2a1e5a
Parents: 8b5a1ce
Author: agura <ag...@gridgain.com>
Authored: Wed May 6 14:30:01 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Wed May 6 14:30:01 2015 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheMapEntry.java | 10 +++++++---
.../processors/cache/GridCacheTtlManager.java | 14 +++++---------
.../internal/processors/cache/GridCacheUtils.java | 4 ++--
3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/70872aa6/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 614da6b..71858d1 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
@@ -3292,6 +3292,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
@Override public boolean onTtlExpired(GridCacheVersion obsoleteVer) {
boolean obsolete = false;
boolean deferred = false;
+ GridCacheVersion ver0 = null;
try {
synchronized (this) {
@@ -3305,7 +3306,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
if (!obsolete()) {
if (cctx.deferredDelete() && !detached() && !isInternal()) {
if (!deletedUnlocked()) {
- update(null, 0L, 0L, ver);
+ update(null, 0L, 0L, ver0 = ver);
deletedUnlocked(true);
@@ -3351,8 +3352,11 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
cctx.cache().removeEntry(this);
}
- if (deferred)
- cctx.onDeferredDelete(this, ver);
+ if (deferred) {
+ assert ver0 != null;
+
+ cctx.onDeferredDelete(this, ver0);
+ }
if ((obsolete || deferred) && cctx.cache().configuration().isStatisticsEnabled())
cctx.cache().metrics0().onEvict();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/70872aa6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
index ef5ac19..5f9049a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java
@@ -88,17 +88,13 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
/**
* Expires entries by TTL.
- *
- * @param sizeLimited Size limited.
*/
- public void expire(boolean sizeLimited) {
+ public void expire() {
long now = U.currentTimeMillis();
- int size = pendingEntries.sizex();
-
GridCacheVersion obsoleteVer = null;
- while (!sizeLimited || size-- > 0) {
+ for (int size = pendingEntries.sizex(); size > 0; size--) {
EntryWrapper e = pendingEntries.firstx();
if (e == null || e.expireTime > now)
@@ -108,8 +104,8 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
if (obsoleteVer == null)
obsoleteVer = cctx.versions().next();
- if (log.isDebugEnabled())
- log.debug("Trying to remove expired entry from cache: " + e);
+ if (log.isTraceEnabled())
+ log.trace("Trying to remove expired entry from cache: " + e);
e.entry.onTtlExpired(obsoleteVer);
}
@@ -130,7 +126,7 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter {
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException, IgniteInterruptedCheckedException {
while (!isCancelled()) {
- expire(false);
+ expire();
EntryWrapper first = pendingEntries.firstx();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/70872aa6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 9a98358..549f42f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1157,7 +1157,7 @@ public class GridCacheUtils {
if (ctx.isNear())
ctx.near().dht().context().evicts().unwind();
- ctx.ttl().expire(true);
+ ctx.ttl().expire();
}
/**
@@ -1172,7 +1172,7 @@ public class GridCacheUtils {
if (cacheCtx.isNear())
cacheCtx.near().dht().context().evicts().unwind();
- cacheCtx.ttl().expire(true);
+ cacheCtx.ttl().expire();
}
}