You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/03/02 17:29:47 UTC

[01/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-1' into ignite-239

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-368 141067acd -> c7fc2970d


Merge remote-tracking branch 'remotes/origin/sprint-1' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/706f6054
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/706f6054
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/706f6054

Branch: refs/heads/ignite-368
Commit: 706f60546a04c11f8301565a0875e91be921e757
Parents: b200912 f27a989
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Feb 16 17:16:09 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Feb 16 17:16:09 2015 +0300

----------------------------------------------------------------------
 assembly/docfiles/tools.js                      |   30 -
 .../examples/datagrid/CacheQueryExample.java    |    6 +-
 .../clients/src/test/resources/spring-cache.xml |   12 -
 .../src/test/resources/spring-server-node.xml   |   21 -
 .../test/resources/spring-server-ssl-node.xml   |   20 +-
 .../java/org/apache/ignite/IgniteCache.java     |    4 +-
 .../apache/ignite/cache/CacheInterceptor.java   |    1 +
 .../apache/ignite/cache/CacheProjection.java    | 1925 ------------------
 .../java/org/apache/ignite/cache/GridCache.java |    1 +
 .../configuration/CacheConfiguration.java       |    1 +
 .../internal/processors/cache/CacheFlag.java    |    6 +-
 .../processors/cache/CacheProjection.java       | 1925 ++++++++++++++++++
 .../processors/cache/GridCacheAdapter.java      |    2 +-
 .../processors/cache/GridCacheMapAdapter.java   |    1 -
 .../processors/cache/GridCachePeekMode.java     |    2 +-
 .../processors/cache/GridCacheProjectionEx.java |    1 -
 .../cache/query/GridCacheQueriesProxy.java      |    1 -
 .../datastructures/GridCacheAtomicLongImpl.java |    1 -
 .../GridCacheAtomicReferenceImpl.java           |    1 -
 .../GridCacheAtomicSequenceImpl.java            |    1 -
 .../GridCacheAtomicStampedImpl.java             |    1 -
 .../GridCacheCountDownLatchImpl.java            |    1 -
 .../internal/visor/query/VisorQueryTask.java    |    1 +
 .../apache/ignite/transactions/Transaction.java |    3 +-
 ...dCacheAbstractReduceFieldsQuerySelfTest.java |    1 +
 .../hadoop/jobtracker/GridHadoopJobTracker.java |    1 -
 .../GridHibernateAccessStrategyAdapter.java     |    2 +-
 .../cache/GridCacheOffHeapAndSwapSelfTest.java  |    3 +-
 .../apache/ignite/cache/spring/SpringCache.java |    2 +-
 29 files changed, 1947 insertions(+), 2030 deletions(-)
----------------------------------------------------------------------



[35/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0b1eccf9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0b1eccf9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0b1eccf9

Branch: refs/heads/ignite-368
Commit: 0b1eccf96a260b3208c153ead6b4e314798726ad
Parents: 0dfe349 c9f46c1
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 11:40:06 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 11:40:06 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       |  90 ++++++++++--
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 137 +++++++++++--------
 .../discovery/tcp/TcpDiscoverySpiAdapter.java   | 116 ++++++++++++++++
 3 files changed, 275 insertions(+), 68 deletions(-)
----------------------------------------------------------------------



[49/50] incubator-ignite git commit: Merge branches 'ignite-368' and 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-368

Posted by ak...@apache.org.
Merge branches 'ignite-368' and 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-368


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e1c7e120
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e1c7e120
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e1c7e120

Branch: refs/heads/ignite-368
Commit: e1c7e120c9f702203b23cb783ea585695770d354
Parents: 141067a b2675bc
Author: AKuznetsov <ak...@gridgain.com>
Authored: Mon Mar 2 22:30:02 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Mon Mar 2 22:30:02 2015 +0700

----------------------------------------------------------------------
 examples/pom-standalone.xml                     |   2 +-
 .../java/org/apache/ignite/IgniteCluster.java   |   8 +-
 .../configuration/IgniteConfiguration.java      |   5 +-
 .../org/apache/ignite/internal/IgnitionEx.java  | 592 +++++++++----------
 .../affinity/GridAffinityAssignmentCache.java   |  13 +-
 .../processors/cache/CacheMetricsImpl.java      |   4 +
 .../processors/cache/GridCacheContext.java      |  19 +
 .../processors/cache/GridCacheMapEntry.java     |   9 +
 .../processors/cache/GridCacheProcessor.java    |  15 +
 .../processors/cache/GridCacheStoreManager.java |  12 +-
 .../GridDistributedCacheAdapter.java            |   2 +
 .../distributed/dht/GridDhtCacheEntry.java      |   3 +
 .../distributed/dht/GridDhtLocalPartition.java  |   5 +
 .../dht/atomic/GridDhtAtomicCache.java          |   2 +-
 .../dht/colocated/GridDhtColocatedCache.java    |   2 +-
 .../cache/transactions/IgniteTxManager.java     |   7 +-
 .../dataload/IgniteDataLoaderImpl.java          |  29 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../GridCacheAbstractLocalStoreSelfTest.java    | 440 ++++++++++++++
 .../cache/GridCacheAbstractMetricsSelfTest.java |  42 ++
 ...acheAbstractUsersAffinityMapperSelfTest.java | 207 +++++++
 ...dCacheAtomicUsersAffinityMapperSelfTest.java |  45 ++
 .../GridCachePartitionedLocalStoreSelfTest.java |  51 ++
 ...chePartitionedOffHeapLocalStoreSelfTest.java |  56 ++
 .../GridCacheReplicatedLocalStoreSelfTest.java  |  51 ++
 ...heReplicatedUsersAffinityMapperSelfTest.java |  45 ++
 ...ridCacheTxPartitionedLocalStoreSelfTest.java |  51 ++
 .../GridCacheTxUsersAffinityMapperSelfTest.java |  45 ++
 .../GridCacheQueueCleanupSelfTest.java          |   1 -
 .../ignite/testsuites/IgniteCacheTestSuite.java |   4 +
 modules/scalar/pom.xml                          |   6 +
 pom.xml                                         |   4 +-
 32 files changed, 1422 insertions(+), 357 deletions(-)
----------------------------------------------------------------------



[23/50] incubator-ignite git commit: #ignite-239: fix logger.

Posted by ak...@apache.org.
#ignite-239: fix logger.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/39428532
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/39428532
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/39428532

Branch: refs/heads/ignite-368
Commit: 39428532fbd3fc402323b7e4580328fcc11cf653
Parents: 535aaf4
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 12:23:51 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 12:23:51 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/internal/IgnitionEx.java   | 6 ++++--
 .../cache/datastructures/GridCacheQueueCleanupSelfTest.java    | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39428532/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index f70836c..32a3d71 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1307,11 +1307,13 @@ public class IgnitionEx {
                 System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
 
             // Initialize factory's log.
-            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), cfg.getNodeId());
+            UUID nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
+
+            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
 
             assert cfgLog != null;
 
-            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(cfg.getNodeId()));
+            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(nodeId));
 
             log = cfgLog.getLogger(G.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/39428532/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
index e61d15b..1192426 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.datastructures.*;


[03/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/890d6c62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/890d6c62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/890d6c62

Branch: refs/heads/ignite-368
Commit: 890d6c62df3b8b7a29917700341f0f58800be7ab
Parents: bfb09c4 36e9236
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 20 16:06:27 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 20 16:06:27 2015 +0300

----------------------------------------------------------------------
 bin/setup-hadoop.sh                             |  2 +-
 .../processors/cache/GridCacheAdapter.java      |  2 +-
 .../processors/cache/GridCacheUtils.java        | 18 +++++++++++++
 .../processors/cache/IgniteCacheProxy.java      |  2 +-
 .../ignite/internal/util/IgniteUtils.java       | 28 +++++++-------------
 .../GridCacheAbstractJobExecutionTest.java      | 15 ++++-------
 modules/hadoop/pom.xml                          |  6 -----
 7 files changed, 35 insertions(+), 38 deletions(-)
----------------------------------------------------------------------



[20/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e13b3b1b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e13b3b1b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e13b3b1b

Branch: refs/heads/ignite-368
Commit: e13b3b1b5f11587786071f462a63a1194855b4b7
Parents: 631a953 4e57996
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 13:29:47 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 13:29:47 2015 +0300

----------------------------------------------------------------------
 README.md                                       |  179 --
 .../hibernate/example-hibernate-L2-cache.xml    |    2 +-
 .../ComputeFibonacciContinuationExample.java    |   17 +-
 .../examples/datagrid/CacheApiExample.java      |    4 +-
 .../datagrid/CacheContinuousQueryExample.java   |    6 +-
 .../examples/datagrid/CacheQueryExample.java    |    2 +-
 .../IgniteCountDownLatchExample.java            |    3 +-
 .../MessagingPingPongListenActorExample.java    |    3 +-
 .../examples/ScalarContinuationExample.scala    |   20 +-
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |   10 +-
 .../internal/client/ClientStartNodeTask.java    |    5 +-
 .../ClientAbstractMultiNodeSelfTest.java        |    2 +-
 .../processors/rest/RestProcessorTest.java      |    8 +-
 .../processors/rest/TestBinaryClient.java       |    1 -
 .../processors/rest/TestMemcacheClient.java     |   13 +-
 .../protocols/tcp/TcpRestParserSelfTest.java    |    2 +-
 .../ignite/codegen/MessageCodeGenerator.java    |  161 +-
 .../java/org/apache/ignite/IgniteCache.java     |   69 +
 .../java/org/apache/ignite/IgniteCluster.java   |    3 +-
 .../apache/ignite/IgniteSystemProperties.java   |    5 +
 .../ignite/cache/IgniteEntryProcessor.java      |   28 +
 .../CacheRendezvousAffinityFunction.java        |    1 +
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   28 +-
 .../ignite/cluster/ClusterNodeLocalMap.java     |   60 -
 .../ignite/events/DiscoveryCustomEvent.java     |   56 +
 .../org/apache/ignite/events/EventType.java     |   12 +
 .../IgfsByteDelimiterRecordResolver.java        |    1 +
 .../ignite/internal/ClusterMetricsSnapshot.java |    9 +-
 .../internal/GridEventConsumeHandler.java       |    1 +
 .../ignite/internal/GridJobCancelRequest.java   |   26 +-
 .../ignite/internal/GridJobExecuteRequest.java  |   70 +-
 .../ignite/internal/GridJobExecuteResponse.java |   34 +-
 .../ignite/internal/GridJobSiblingsRequest.java |   24 +-
 .../internal/GridJobSiblingsResponse.java       |   22 +-
 .../ignite/internal/GridKernalContext.java      |   16 +-
 .../ignite/internal/GridKernalContextImpl.java  |   23 +-
 .../internal/GridMessageListenHandler.java      |    1 +
 .../ignite/internal/GridTaskCancelRequest.java  |   22 +-
 .../ignite/internal/GridTaskSessionRequest.java |   26 +-
 .../apache/ignite/internal/IgniteKernal.java    |   11 +-
 .../cluster/ClusterNodeLocalMapImpl.java        |   27 +-
 .../cluster/IgniteClusterAsyncImpl.java         |    3 +-
 .../internal/cluster/IgniteClusterImpl.java     |    4 +-
 .../internal/direct/DirectByteBufferStream.java |   44 +-
 .../internal/direct/DirectMessageReader.java    |   33 +-
 .../internal/direct/DirectMessageWriter.java    |   23 +-
 .../direct/DirectMessageWriterState.java        |   13 +-
 .../igfs/common/IgfsControlResponse.java        |    1 +
 .../internal/igfs/common/IgfsMarshaller.java    |    1 +
 .../internal/managers/GridManagerAdapter.java   |    9 +-
 .../checkpoint/GridCheckpointRequest.java       |   26 +-
 .../managers/communication/GridIoManager.java   |   30 +-
 .../managers/communication/GridIoMessage.java   |   38 +-
 .../communication/GridIoMessageFactory.java     |   33 +-
 .../communication/GridIoUserMessage.java        |   38 +-
 .../deployment/GridDeploymentCommunication.java |    4 +-
 .../deployment/GridDeploymentInfoBean.java      |   35 +-
 .../deployment/GridDeploymentRequest.java       |   34 +-
 .../deployment/GridDeploymentResponse.java      |   26 +-
 .../discovery/GridDiscoveryManager.java         |  104 +-
 .../eventstorage/GridEventStorageMessage.java   |   42 +-
 .../affinity/GridAffinityMessage.java           |    1 +
 .../processors/cache/GridCacheEntryInfo.java    |    5 +-
 .../cache/GridCacheEvictionRequest.java         |   26 +-
 .../cache/GridCacheEvictionResponse.java        |   30 +-
 .../processors/cache/GridCacheMapEntry.java     |  562 ++--
 .../processors/cache/GridCacheMessage.java      |   21 +-
 .../processors/cache/GridCacheSwapManager.java  |    4 +-
 .../processors/cache/GridCacheUtils.java        |    4 +
 .../processors/cache/GridCacheValueBytes.java   |   24 +-
 .../processors/cache/IgniteCacheProxy.java      |   63 +
 ...idCacheOptimisticCheckPreparedTxRequest.java |   30 +-
 ...dCacheOptimisticCheckPreparedTxResponse.java |   26 +-
 .../distributed/GridCacheTtlUpdateRequest.java  |   58 +-
 .../distributed/GridDistributedBaseMessage.java |   33 +-
 .../distributed/GridDistributedLockRequest.java |   52 +-
 .../GridDistributedLockResponse.java            |   30 +-
 .../GridDistributedTxFinishRequest.java         |   42 +-
 .../GridDistributedTxFinishResponse.java        |   24 +-
 .../GridDistributedTxPrepareRequest.java        |   58 +-
 .../GridDistributedTxPrepareResponse.java       |   24 +-
 .../GridDistributedTxRemoteAdapter.java         |   66 +-
 .../GridDistributedUnlockRequest.java           |   26 +-
 .../dht/GridDhtAffinityAssignmentRequest.java   |   22 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |   24 +-
 .../distributed/dht/GridDhtLockRequest.java     |   42 +-
 .../distributed/dht/GridDhtLockResponse.java    |   40 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |   42 +-
 .../dht/GridDhtTxFinishResponse.java            |   22 +-
 .../dht/GridDhtTxPrepareRequest.java            |   48 +-
 .../dht/GridDhtTxPrepareResponse.java           |   42 +-
 .../distributed/dht/GridDhtUnlockRequest.java   |   26 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   44 +-
 .../GridDhtAtomicDeferredUpdateResponse.java    |   26 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |   92 +-
 .../dht/atomic/GridDhtAtomicUpdateResponse.java |   32 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |   84 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |   78 +-
 .../atomic/GridNearAtomicUpdateResponse.java    |   54 +-
 .../dht/preloader/GridDhtForceKeysRequest.java  |   32 +-
 .../dht/preloader/GridDhtForceKeysResponse.java |   32 +-
 .../GridDhtPartitionDemandMessage.java          |   36 +-
 .../preloader/GridDhtPartitionExchangeId.java   |   27 +-
 .../GridDhtPartitionSupplyMessage.java          |   40 +-
 .../GridDhtPartitionsAbstractMessage.java       |   19 +-
 .../preloader/GridDhtPartitionsFullMessage.java |   24 +-
 .../GridDhtPartitionsSingleMessage.java         |   22 +-
 .../GridDhtPartitionsSingleRequest.java         |   18 +-
 .../distributed/near/GridNearAtomicCache.java   |    3 -
 .../distributed/near/GridNearGetRequest.java    |   47 +-
 .../distributed/near/GridNearGetResponse.java   |   38 +-
 .../distributed/near/GridNearLockRequest.java   |   52 +-
 .../distributed/near/GridNearLockResponse.java  |   42 +-
 .../near/GridNearTxFinishRequest.java           |   32 +-
 .../near/GridNearTxFinishResponse.java          |   26 +-
 .../near/GridNearTxPrepareRequest.java          |   44 +-
 .../near/GridNearTxPrepareResponse.java         |   48 +-
 .../distributed/near/GridNearUnlockRequest.java |   18 +-
 .../query/GridCacheDistributedQueryManager.java |    4 +-
 .../cache/query/GridCacheQueryManager.java      |    2 +-
 .../cache/query/GridCacheQueryRequest.java      |   58 +-
 .../cache/query/GridCacheQueryResponse.java     |   40 +-
 .../continuous/CacheContinuousQueryEntry.java   |    1 +
 .../continuous/CacheContinuousQueryHandler.java |    1 +
 .../cache/transactions/IgniteTxAdapter.java     |   58 +-
 .../cache/transactions/IgniteTxEntry.java       |   17 +-
 .../transactions/IgniteTxLocalAdapter.java      |   48 +-
 .../version/GridCacheRawVersionedEntry.java     |    1 +
 .../cache/version/GridCacheVersion.java         |   32 +-
 .../GridCacheVersionConflictContext.java        |   35 +-
 .../cache/version/GridCacheVersionEx.java       |    2 +-
 .../clock/GridClockDeltaSnapshotMessage.java    |   28 +-
 .../processors/clock/GridClockDeltaVersion.java |   24 +-
 .../processors/clock/GridClockMessage.java      |    1 +
 .../closure/GridClosureProcessor.java           |   82 +-
 .../continuous/GridContinuousMessage.java       |   28 +-
 .../dataload/GridDataLoadRequest.java           |   50 +-
 .../dataload/GridDataLoadResponse.java          |   26 +-
 .../dataload/GridDataLoaderProcessor.java       |    2 +-
 .../datastructures/DataStructuresProcessor.java |    2 +-
 .../dr/GridDrDataLoadCacheUpdater.java          |    6 +-
 .../processors/igfs/IgfsAckMessage.java         |   26 +-
 .../internal/processors/igfs/IgfsBlockKey.java  |   28 +-
 .../processors/igfs/IgfsBlocksMessage.java      |   30 +-
 .../igfs/IgfsCommunicationMessage.java          |   18 +-
 .../processors/igfs/IgfsDataManager.java        |    4 +-
 .../processors/igfs/IgfsDeleteMessage.java      |   24 +-
 .../processors/igfs/IgfsFileAffinityRange.java  |   30 +-
 .../igfs/IgfsFragmentizerRequest.java           |   28 +-
 .../igfs/IgfsFragmentizerResponse.java          |   22 +-
 .../internal/processors/igfs/IgfsImpl.java      |    6 +-
 .../processors/igfs/IgfsOutputStreamImpl.java   |    4 +-
 .../internal/processors/igfs/IgfsServer.java    |    1 +
 .../processors/igfs/IgfsSyncMessage.java        |   24 +-
 .../internal/processors/job/GridJobWorker.java  |    2 +-
 .../plugin/IgnitePluginProcessor.java           |    2 +-
 .../processors/rest/GridRestProcessor.java      |   85 +-
 .../processors/rest/GridRestResponse.java       |    1 +
 .../message/GridClientAbstractMessage.java      |    1 +
 .../message/GridClientHandshakeRequest.java     |    1 +
 .../cache/GridCacheQueryCommandHandler.java     |    7 +-
 .../handlers/task/GridTaskResultRequest.java    |   24 +-
 .../handlers/task/GridTaskResultResponse.java   |   28 +-
 .../protocols/tcp/GridMemcachedMessage.java     |    3 +-
 .../rest/protocols/tcp/GridTcpRestParser.java   |   10 +-
 .../securesession/GridSecureSession.java        |   60 -
 .../GridSecureSessionProcessor.java             |   59 -
 .../os/GridOsSecureSessionProcessor.java        |   61 -
 .../security/GridSecurityContext.java           |  251 --
 .../security/GridSecurityProcessor.java         |    6 +-
 .../processors/security/SecurityContext.java    |   56 +
 .../security/os/GridOsSecurityProcessor.java    |  146 +-
 .../streamer/GridStreamerCancelRequest.java     |   22 +-
 .../streamer/GridStreamerExecutionRequest.java  |   38 +-
 .../streamer/GridStreamerResponse.java          |   24 +-
 .../processors/streamer/IgniteStreamerImpl.java |    4 +-
 .../processors/task/GridTaskWorker.java         |    4 +-
 .../ignite/internal/util/GridByteArrayList.java |   24 +-
 .../ignite/internal/util/GridLongList.java      |   24 +-
 .../internal/util/IgniteExceptionRegistry.java  |  259 ++
 .../ignite/internal/util/IgniteUtils.java       | 2573 ++++++++----------
 .../internal/util/ipc/IpcToNioAdapter.java      |    4 +-
 .../util/nio/GridCommunicationClient.java       |    2 +-
 .../nio/GridConnectionBytesVerifyFilter.java    |    1 +
 .../internal/util/nio/GridDirectParser.java     |   33 +-
 .../internal/util/nio/GridNioMessageReader.java |    2 +-
 .../internal/util/nio/GridNioMessageWriter.java |    4 +-
 .../ignite/internal/util/nio/GridNioServer.java |   59 +-
 .../util/nio/GridShmemCommunicationClient.java  |    2 +-
 .../util/nio/GridTcpCommunicationClient.java    |    3 +-
 .../util/nio/GridTcpNioCommunicationClient.java |    2 +-
 .../apache/ignite/internal/util/typedef/X.java  |    3 +-
 .../VisorComputeToggleMonitoringTask.java       |    4 +-
 .../visor/node/VisorNodeDataCollectorJob.java   |    4 +-
 .../node/VisorNodeEventsCollectorTask.java      |    3 +-
 .../visor/query/VisorQueryCleanupTask.java      |    4 +-
 .../visor/query/VisorQueryNextPageTask.java     |    6 +-
 .../internal/visor/query/VisorQueryTask.java    |    4 +-
 .../internal/visor/util/VisorTaskUtils.java     |   45 +-
 .../ignite/lang/IgniteProductVersion.java       |    1 +
 .../optimized/optimized-classnames.properties   |    3 +-
 .../org/apache/ignite/mxbean/IgniteMXBean.java  |    6 +
 .../extensions/communication/Message.java       |   58 +
 .../communication/MessageAdapter.java           |  143 -
 .../MessageCollectionItemType.java              |  101 +
 .../communication/MessageFactory.java           |    4 +-
 .../communication/MessageFormatter.java         |    3 +-
 .../extensions/communication/MessageReader.java |   24 +-
 .../extensions/communication/MessageWriter.java |   26 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   15 +
 .../org/apache/ignite/spi/IgniteSpiContext.java |    8 +
 .../ignite/spi/IgniteSpiThreadFactory.java      |    2 +-
 .../jobstealing/JobStealingRequest.java         |   22 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  134 +-
 .../ignite/spi/discovery/DiscoverySpi.java      |    7 +
 .../spi/discovery/DiscoverySpiListener.java     |   11 +-
 .../DiscoverySpiNodeAuthenticator.java          |    2 +-
 .../discovery/tcp/TcpClientDiscoverySpi.java    |    7 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  275 +-
 .../discovery/tcp/TcpDiscoverySpiAdapter.java   |    3 +
 .../tcp/internal/TcpDiscoveryNode.java          |    1 +
 .../TcpDiscoveryMulticastIpFinder.java          |    1 +
 .../messages/TcpDiscoveryAuthFailedMessage.java |    1 +
 .../TcpDiscoveryCustomEventMessage.java         |   66 +
 .../messages/TcpDiscoveryHeartbeatMessage.java  |    1 +
 .../spi/swapspace/file/FileSwapSpaceSpi.java    |    2 +-
 .../core/src/main/resources/ignite.properties   |    2 +-
 .../internal/GridDiscoveryEventSelfTest.java    |   43 +
 .../internal/GridEventStorageSelfTest.java      |    3 +-
 .../GridJobMasterLeaveAwareSelfTest.java        |   28 +-
 .../internal/GridMultipleJobsSelfTest.java      |    2 +-
 .../ignite/internal/GridNodeLocalSelfTest.java  |    4 +-
 .../GridTaskContinuousMapperSelfTest.java       |    3 +-
 .../GridTaskExecutionContextSelfTest.java       |    2 +-
 .../GridCheckpointManagerAbstractSelfTest.java  |   20 +-
 .../GridCommunicationSendMessageSelfTest.java   |   13 +-
 .../communication/GridIoManagerSelfTest.java    |   18 +-
 .../GridDeploymentMessageCountSelfTest.java     |    2 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |  101 +-
 .../GridCacheAtomicMessageCountSelfTest.java    |    2 +-
 .../GridCacheConcurrentTxMultiNodeTest.java     |   13 +-
 .../cache/GridCachePutAllFailoverSelfTest.java  |    5 +-
 ...ridCacheReplicatedSynchronousCommitTest.java |    2 +-
 .../IgniteCacheAbstractStopBusySelfTest.java    |    5 +-
 .../cache/IgniteTxMultiNodeAbstractTest.java    |   33 +-
 .../cache/IgniteTxReentryAbstractSelfTest.java  |    2 +-
 ...cheAtomicReferenceMultiNodeAbstractTest.java |   12 +-
 .../GridCacheMultiNodeDataStructureTest.java    |    3 +-
 ...dCacheSequenceMultiNodeAbstractSelfTest.java |    2 +-
 ...titionedAtomicSequenceMultiThreadedTest.java |   16 +-
 ...dCachePartitionedQueueEntryMoveSelfTest.java |    2 +-
 .../GridCacheAbstractJobExecutionTest.java      |    2 +-
 .../GridCacheAtomicTimeoutSelfTest.java         |    3 +-
 .../distributed/GridCacheEventAbstractTest.java |    4 +-
 ...xOriginatingNodeFailureAbstractSelfTest.java |    2 +-
 ...cOriginatingNodeFailureAbstractSelfTest.java |    2 +-
 .../dht/GridCacheDhtInternalEntrySelfTest.java  |    6 +-
 .../dht/GridCacheDhtMultiBackupTest.java        |    2 +-
 .../GridCacheDhtPreloadMessageCountTest.java    |    2 +-
 ...eAtomicInvalidPartitionHandlingSelfTest.java |    2 +-
 ...idCachePartitionedHitsAndMissesSelfTest.java |    3 +-
 ...ePartitionedMultiThreadedPutGetSelfTest.java |    2 +-
 .../near/IgniteCacheNearReadCommittedTest.java  |    3 +
 .../GridCacheReplicatedInvalidateSelfTest.java  |    2 +-
 .../GridCacheRandomEvictionPolicySelfTest.java  |    2 +-
 .../IgniteCacheLoaderWriterAbstractTest.java    |   47 +
 .../closure/GridClosureProcessorSelfTest.java   |   14 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |    5 +-
 .../igfs/IgfsDataManagerSelfTest.java           |    1 +
 .../processors/igfs/IgfsProcessorSelfTest.java  |    3 +-
 .../streamer/GridStreamerEvictionSelfTest.java  |    2 +-
 .../streamer/GridStreamerSelfTest.java          |    2 +-
 .../util/IgniteExceptionRegistrySelfTest.java   |   89 +
 .../internal/util/IgniteUtilsSelfTest.java      |    6 +-
 .../internal/util/nio/GridRoundTripTest.java    |    1 +
 .../offheap/GridOffHeapMapAbstractSelfTest.java |    1 +
 .../cache/GridCacheDataStructuresLoadTest.java  |   36 +-
 .../loadtests/cache/GridCacheLoadTest.java      |    6 +-
 .../loadtests/cache/GridCacheSwapLoadTest.java  |    5 +-
 .../loadtests/colocation/GridTestMain.java      |    3 +-
 .../communication/GridIoManagerBenchmark.java   |    3 +-
 .../communication/GridIoManagerBenchmark0.java  |    6 +-
 .../communication/GridTestMessage.java          |    9 +-
 .../GridMultiSplitsRedeployLoadTest.java        |    5 +-
 .../loadtests/discovery/GridGcTimeoutTest.java  |    3 +-
 .../ignite/loadtests/dsi/GridDsiPerfJob.java    |   16 +-
 .../job/GridJobExecutionSingleNodeLoadTest.java |    2 +-
 .../mapper/GridContinuousMapperLoadTest1.java   |    3 +-
 .../loadtests/mapper/GridNodeStartup.java       |    3 +-
 .../mergesort/GridMergeSortLoadTest.java        |    3 +-
 .../streamer/GridStreamerIndexLoadTest.java     |    4 +-
 .../swap/GridSwapEvictAllBenchmark.java         |    3 +-
 .../marshaller/GridMarshallerAbstractTest.java  |    6 +-
 ...idSessionFutureWaitJobAttributeSelfTest.java |    3 +-
 .../GridSessionSetTaskAttributeSelfTest.java    |    3 +-
 ...GridSessionTaskWaitJobAttributeSelfTest.java |    3 +-
 .../GridAbstractCommunicationSelfTest.java      |   22 +-
 .../spi/communication/GridTestMessage.java      |   25 +-
 .../tcp/GridCacheDhtLockBackupSelfTest.java     |    4 +-
 .../GridTcpCommunicationSpiAbstractTest.java    |    2 +-
 ...mmunicationSpiConcurrentConnectSelfTest.java |   16 +-
 .../tcp/GridTcpCommunicationSpiLanTest.java     |    4 +-
 ...cpCommunicationSpiMultithreadedSelfTest.java |   22 +-
 ...dTcpCommunicationSpiRecoveryAckSelfTest.java |   10 +-
 ...GridTcpCommunicationSpiRecoverySelfTest.java |   10 +-
 .../discovery/AbstractDiscoverySelfTest.java    |   22 +-
 .../tcp/TcpDiscoverySpiStartStopSelfTest.java   |   23 -
 .../roundrobin/GridRoundRobinTestUtils.java     |    6 +-
 .../file/GridFileSwapSpaceSpiSelfTest.java      |    1 +
 .../index/GridStreamerIndexSelfTest.java        |   17 +-
 .../window/GridStreamerWindowSelfTest.java      |    3 +-
 .../testframework/GridSpiTestContext.java       |   12 +-
 .../junits/GridTestKernalContext.java           |    2 +
 .../ignite/testframework/junits/IgniteMock.java |    1 -
 .../cache/GridAbstractCacheStoreSelfTest.java   |    3 +-
 .../junits/spi/GridSpiAbstractTest.java         |   12 -
 .../ignite/testsuites/IgniteCacheTestSuite.java |    3 +-
 .../testsuites/IgniteUtilSelfTestSuite.java     |    1 +
 .../tests/p2p/GridP2PAwareTestUserResource.java |    5 +-
 .../tests/p2p/GridTestMessageListener.java      |    4 +-
 modules/hadoop/pom.xml                          |   10 -
 .../client/hadoop/GridHadoopClientProtocol.java |    3 +-
 .../internal/igfs/hadoop/IgfsHadoopWrapper.java |    2 +-
 .../hadoop/GridHadoopDefaultJobInfo.java        |    5 +-
 .../processors/hadoop/GridHadoopSetup.java      |    3 +-
 .../GridHadoopDefaultMapReducePlanner.java      |    3 +-
 .../shuffle/GridHadoopShuffleMessage.java       |    1 +
 .../taskexecutor/GridHadoopExecutorService.java |    2 +-
 .../hadoop/v2/GridHadoopSplitWrapper.java       |    3 +-
 .../hadoop/GridHadoopGroupingTest.java          |   10 +-
 .../hadoop/GridHadoopJobTrackerSelfTest.java    |    2 +-
 .../hadoop/GridHadoopSortingTest.java           |    9 +-
 .../processors/hadoop/GridHadoopStartup.java    |    2 +-
 .../ignite/loadtests/igfs/IgfsNodeStartup.java  |    3 +-
 ...idHibernateAbstractRegionAccessStrategy.java |   97 -
 .../GridHibernateAccessStrategyAdapter.java     |  369 ---
 .../GridHibernateCollectionRegion.java          |   99 -
 .../hibernate/GridHibernateEntityRegion.java    |  110 -
 .../GridHibernateGeneralDataRegion.java         |   69 -
 .../hibernate/GridHibernateNaturalIdRegion.java |   98 -
 .../GridHibernateNonStrictAccessStrategy.java   |  220 --
 .../GridHibernateQueryResultsRegion.java        |   71 -
 .../GridHibernateReadOnlyAccessStrategy.java    |  106 -
 .../GridHibernateReadWriteAccessStrategy.java   |  282 --
 .../cache/hibernate/GridHibernateRegion.java    |  101 -
 .../hibernate/GridHibernateRegionFactory.java   |  231 --
 .../GridHibernateTimestampsRegion.java          |   40 -
 ...ridHibernateTransactionalAccessStrategy.java |  139 -
 .../GridHibernateTransactionalDataRegion.java   |   96 -
 .../HibernateAbstractRegionAccessStrategy.java  |   97 +
 .../HibernateAccessStrategyAdapter.java         |  369 +++
 .../hibernate/HibernateCollectionRegion.java    |   99 +
 .../cache/hibernate/HibernateEntityRegion.java  |  110 +
 .../hibernate/HibernateGeneralDataRegion.java   |   69 +
 .../hibernate/HibernateNaturalIdRegion.java     |   98 +
 .../HibernateNonStrictAccessStrategy.java       |  220 ++
 .../hibernate/HibernateQueryResultsRegion.java  |   71 +
 .../HibernateReadOnlyAccessStrategy.java        |  106 +
 .../HibernateReadWriteAccessStrategy.java       |  282 ++
 .../ignite/cache/hibernate/HibernateRegion.java |  101 +
 .../cache/hibernate/HibernateRegionFactory.java |  231 ++
 .../hibernate/HibernateTimestampsRegion.java    |   40 +
 .../HibernateTransactionalAccessStrategy.java   |  139 +
 .../HibernateTransactionalDataRegion.java       |   96 +
 .../apache/ignite/cache/hibernate/package.html  |    2 +-
 ...idHibernateL2CacheConfigurationSelfTest.java |  393 ---
 .../hibernate/GridHibernateL2CacheSelfTest.java | 1923 -------------
 ...idHibernateL2CacheTransactionalSelfTest.java |  135 -
 .../HibernateL2CacheConfigurationSelfTest.java  |  393 +++
 .../hibernate/HibernateL2CacheSelfTest.java     | 1925 +++++++++++++
 .../HibernateL2CacheTransactionalSelfTest.java  |  135 +
 .../testsuites/IgniteHibernateTestSuite.java    |    6 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |    2 +-
 .../GridCacheCrossCacheQuerySelfTestNewApi.java |    2 +-
 .../tcp/GridOrderedMessageCancelSelfTest.java   |    2 +-
 .../http/jetty/GridJettyRestHandler.java        |    1 +
 .../p2p/GridP2PUserVersionChangeSelfTest.java   |    4 +-
 ...gniteProjectionStartStopRestartSelfTest.java |    3 +-
 pom.xml                                         |    2 +-
 379 files changed, 10408 insertions(+), 9496 deletions(-)
----------------------------------------------------------------------



[30/50] incubator-ignite git commit: #ignite-239: review.

Posted by ak...@apache.org.
#ignite-239: 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/4ff4fd1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4ff4fd1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4ff4fd1d

Branch: refs/heads/ignite-368
Commit: 4ff4fd1d7ad0d7691bb911a5453d69d1a5ac627f
Parents: d1b9436
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 18:14:15 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 18:14:15 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 77 ++++++++++----------
 1 file changed, 38 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4ff4fd1d/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index ca3abe9..6b8b197 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1295,51 +1295,19 @@ public class IgnitionEx {
         private void start0(GridStartContext startCtx) throws IgniteCheckedException {
             assert grid == null : "Grid is already started: " + name;
 
-            IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new IgniteConfiguration();
-
-            String ggHome = cfg.getIgniteHome();
-
-            // Set Ignite home.
-            if (ggHome == null)
-                ggHome = U.getIgniteHome();
-            else
-                // If user provided IGNITE_HOME - set it as a system property.
-                U.setIgniteHome(ggHome);
+            // Set configuration URL, if any, into system property.
+            if (startCtx.configUrl() != null)
+                System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
 
-            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
+            IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new IgniteConfiguration();
 
             // Ensure invariant.
             // It's a bit dirty - but this is a result of late refactoring
             // and I don't want to reshuffle a lot of code.
             assert F.eq(name, cfg.getGridName());
 
-            // Set configuration URL, if any, into system property.
-            if (startCtx.configUrl() != null)
-                System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
-
-            // Initialize factory's log.
-            UUID nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
-
-            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
-
-            assert cfgLog != null;
-
-            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(nodeId));
-
-            log = cfgLog.getLogger(G.class);
-
-            // Check Ignite home folder (after log is available).
-            if (ggHome != null) {
-                File ggHomeFile = new File(ggHome);
-
-                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
-                    throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
-            }
-
             IgniteConfiguration myCfg = initializeConfiguration(cfg);
 
-            myCfg.setGridLogger(cfgLog);
-
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1521,9 +1489,41 @@ public class IgnitionEx {
          */
         private IgniteConfiguration initializeConfiguration(IgniteConfiguration cfg)
             throws IgniteCheckedException {
+            // Initialize factory's log.
+            UUID nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
+
+            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
+
+            assert cfgLog != null;
+
+            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(nodeId));
+
+            log = cfgLog.getLogger(G.class);
+
+            String ggHome = cfg.getIgniteHome();
+
+            // Set Ignite home.
+            if (ggHome == null)
+                ggHome = U.getIgniteHome();
+            else
+                // If user provided IGNITE_HOME - set it as a system property.
+                U.setIgniteHome(ggHome);
+
+            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
+
+            // Check Ignite home folder (after log is available).
+            if (ggHome != null) {
+                File ggHomeFile = new File(ggHome);
+
+                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
+                    throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
+            }
+
             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
 
-            myCfg.setIgniteHome(U.getIgniteHome());
+            myCfg.setIgniteHome(ggHome);
+
+            myCfg.setGridLogger(cfgLog);
 
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
@@ -1606,8 +1606,7 @@ public class IgnitionEx {
             if (myCfg.getMBeanServer() == null)
                 myCfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
 
-            if (myCfg.getNodeId() == null)
-               myCfg.setNodeId(UUID.randomUUID());
+            myCfg.setNodeId(nodeId);
 
             if (myCfg.getPeerClassLoadingLocalClassPathExclude() == null)
                 myCfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);


[22/50] incubator-ignite git commit: #ignite-239: small refactoring.

Posted by ak...@apache.org.
#ignite-239: small refactoring.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/535aaf46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/535aaf46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/535aaf46

Branch: refs/heads/ignite-368
Commit: 535aaf464fde5e035b594297a57ab3de06257d1f
Parents: 7aec19e
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 17:53:00 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 17:53:00 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      | 163 +------
 .../org/apache/ignite/internal/IgnitionEx.java  | 477 ++++++++++++-------
 2 files changed, 328 insertions(+), 312 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/535aaf46/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 037b7c8..bd24c4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -26,19 +26,7 @@ import org.apache.ignite.lang.*;
 import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.marshaller.*;
 import org.apache.ignite.plugin.*;
-import org.apache.ignite.spi.checkpoint.noop.*;
-import org.apache.ignite.spi.collision.noop.*;
-import org.apache.ignite.spi.communication.tcp.*;
-import org.apache.ignite.spi.deployment.local.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*;
-import org.apache.ignite.spi.eventstorage.memory.*;
-import org.apache.ignite.spi.failover.always.*;
 import org.apache.ignite.spi.indexing.*;
-import org.apache.ignite.spi.indexing.noop.*;
-import org.apache.ignite.spi.loadbalancing.roundrobin.*;
-import org.apache.ignite.spi.swapspace.file.*;
-import org.apache.ignite.spi.swapspace.noop.*;
 import org.apache.ignite.streamer.*;
 import org.apache.ignite.plugin.segmentation.*;
 import org.apache.ignite.services.*;
@@ -383,9 +371,6 @@ public class IgniteConfiguration {
     /** User's class loader. */
     private ClassLoader classLdr;
 
-    /** */
-    private static final String[] EMPTY_STR_ARR = new String[0];
-
     /**
      * Creates valid grid configuration with all default values.
      */
@@ -403,189 +388,75 @@ public class IgniteConfiguration {
         assert cfg != null;
 
         // SPIs.
-        discoSpi = cfg.getDiscoverySpi() != null ? cfg.getDiscoverySpi() : new TcpDiscoverySpi();
-
-        if (discoSpi instanceof TcpDiscoverySpi) {
-            TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
-
-            if (tcpDisco.getIpFinder() == null)
-                tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
-        }
-
-        commSpi = cfg.getCommunicationSpi() != null ? cfg.getCommunicationSpi() : new TcpCommunicationSpi();
-
-        deploySpi = cfg.getDeploymentSpi() != null ? cfg.getDeploymentSpi() : new LocalDeploymentSpi();
-
-        evtSpi = cfg.getEventStorageSpi() != null ? cfg.getEventStorageSpi() : new MemoryEventStorageSpi();
-
-        cpSpi = cfg.getCheckpointSpi() != null ? cfg.getCheckpointSpi() : new CheckpointSpi[] {new NoopCheckpointSpi()};
-
-        colSpi = cfg.getCollisionSpi() != null ? cfg.getCollisionSpi() : new NoopCollisionSpi();
-
-        failSpi = cfg.getFailoverSpi() != null ? cfg.getFailoverSpi() : new FailoverSpi[] {new AlwaysFailoverSpi()};
-
-        loadBalancingSpi = cfg.getLoadBalancingSpi() != null ? cfg.getLoadBalancingSpi() :
-            new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
-
-        indexingSpi = cfg.getIndexingSpi() != null ? cfg.getIndexingSpi() :  new NoopIndexingSpi();
-
+        discoSpi = cfg.getDiscoverySpi();
+        commSpi = cfg.getCommunicationSpi();
+        deploySpi = cfg.getDeploymentSpi();
+        evtSpi = cfg.getEventStorageSpi();
+        cpSpi = cfg.getCheckpointSpi();
+        colSpi = cfg.getCollisionSpi();
+        failSpi = cfg.getFailoverSpi();
+        loadBalancingSpi = cfg.getLoadBalancingSpi();
+        indexingSpi = cfg.getIndexingSpi();
         swapSpaceSpi = cfg.getSwapSpaceSpi();
 
-        if (swapSpaceSpi == null) {
-            boolean needSwap = false;
-
-            CacheConfiguration[] caches = cfg.getCacheConfiguration();
-
-            if (caches != null) {
-                for (CacheConfiguration c : caches) {
-                    if (c.isSwapEnabled()) {
-                        needSwap = true;
-
-                        break;
-                    }
-                }
-            }
-
-            swapSpaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
-        }
-
         /*
          * Order alphabetically for maintenance purposes.
          */
         addrRslvr = cfg.getAddressResolver();
-
         allResolversPassReq = cfg.isAllSegmentationResolversPassRequired();
-
         atomicCfg = cfg.getAtomicConfiguration();
-
         daemon = cfg.isDaemon();
-
         cacheCfg = cfg.getCacheConfiguration();
-
         cacheSanityCheckEnabled = cfg.isCacheSanityCheckEnabled();
-
-        connectorCfg = cfg.getConnectorConfiguration() != null ?
-            new ConnectorConfiguration(cfg.getConnectorConfiguration()) : null;
-
+        connectorCfg = cfg.getConnectorConfiguration();
         classLdr = cfg.getClassLoader();
-
         clockSyncFreq = cfg.getClockSyncFrequency();
-
         clockSyncSamples = cfg.getClockSyncSamples();
-
         deployMode = cfg.getDeploymentMode();
-
         discoStartupDelay = cfg.getDiscoveryStartupDelay();
-
         pubPoolSize = cfg.getPublicThreadPoolSize();
-
         ggHome = cfg.getIgniteHome();
-
         ggWork = cfg.getWorkDirectory();
-
         gridName = cfg.getGridName();
-
-        IgfsConfiguration[] igfsCfgs = cfg.getIgfsConfiguration();
-
-        if (igfsCfgs != null) {
-            IgfsConfiguration[] clone = igfsCfgs.clone();
-
-            for (int i = 0; i < igfsCfgs.length; i++)
-                clone[i] = new IgfsConfiguration(igfsCfgs[i]);
-
-            igfsCfg = clone;
-        }
-
+        igfsCfg = cfg.getIgfsConfiguration();
         igfsPoolSize = cfg.getIgfsThreadPoolSize();
-
         hadoopCfg = cfg.getHadoopConfiguration();
-
         inclEvtTypes = cfg.getIncludeEventTypes();
-
         includeProps = cfg.getIncludeProperties();
-
         lifecycleBeans = cfg.getLifecycleBeans();
-
         locHost = cfg.getLocalHost();
-
         log = cfg.getGridLogger();
-
         lsnrs = cfg.getLocalEventListeners();
-
         marsh = cfg.getMarshaller();
-
         marshLocJobs = cfg.isMarshalLocalJobs();
-
-        mbeanSrv = cfg.getMBeanServer() != null ? cfg.getMBeanServer() : ManagementFactory.getPlatformMBeanServer();
-
+        mbeanSrv = cfg.getMBeanServer();
         metricsHistSize = cfg.getMetricsHistorySize();
-
         metricsExpTime = cfg.getMetricsExpireTime();
-
         metricsLogFreq = cfg.getMetricsLogFrequency();
-
         metricsUpdateFreq = cfg.getMetricsUpdateFrequency();
-
         mgmtPoolSize = cfg.getManagementThreadPoolSize();
-
         netTimeout = cfg.getNetworkTimeout();
-
-        nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
-
+        nodeId = cfg.getNodeId();
         p2pEnabled = cfg.isPeerClassLoadingEnabled();
-
-        p2pLocClsPathExcl = cfg.getPeerClassLoadingLocalClassPathExclude() != null ?
-            cfg.getPeerClassLoadingLocalClassPathExclude() : EMPTY_STR_ARR;
-
+        p2pLocClsPathExcl = cfg.getPeerClassLoadingLocalClassPathExclude();
         p2pMissedCacheSize = cfg.getPeerClassLoadingMissedResourcesCacheSize();
-
         p2pPoolSize = cfg.getPeerClassLoadingThreadPoolSize();
-
         pluginCfgs = cfg.getPluginConfigurations();
-
         qryCfg = cfg.getQueryConfiguration();
-
         segChkFreq = cfg.getSegmentCheckFrequency();
-
         segPlc = cfg.getSegmentationPolicy();
-
         segResolveAttempts = cfg.getSegmentationResolveAttempts();
-
         segResolvers = cfg.getSegmentationResolvers();
-
         sndRetryCnt = cfg.getNetworkSendRetryCount();
-
         sndRetryDelay = cfg.getNetworkSendRetryDelay();
-
-        StreamerConfiguration[] streamerCfgs = cfg.getStreamerConfiguration();
-
-        if (streamerCfgs != null) {
-            StreamerConfiguration[] clone = streamerCfgs.clone();
-
-            for (int i = 0; i < streamerCfgs.length; i++)
-                clone[i] = new StreamerConfiguration(streamerCfgs[i]);
-
-            streamerCfg = clone;
-        }
-
+        streamerCfg = cfg.getStreamerConfiguration();
         svcCfgs = cfg.getServiceConfiguration();
-
         sysPoolSize = cfg.getSystemThreadPoolSize();
-
         timeSrvPortBase = cfg.getTimeServerPortBase();
-
         timeSrvPortRange = cfg.getTimeServerPortRange();
-
-        txCfg = cfg.getTransactionConfiguration() != null ?
-            new TransactionConfiguration(cfg.getTransactionConfiguration()) : null;
-
-        if (cfg.getUserAttributes() == null)
-            userAttrs = Collections.emptyMap();
-        else
-            userAttrs = cfg.getUserAttributes();
-
+        txCfg = cfg.getTransactionConfiguration();
+        userAttrs = cfg.getUserAttributes();
         waitForSegOnStart = cfg.isWaitForSegmentOnStart();
-
         warmupClos = cfg.getWarmupClosure();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/535aaf46/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 01c0cec..f70836c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -34,13 +34,29 @@ import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.mxbean.*;
 import org.apache.ignite.plugin.segmentation.*;
 import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.checkpoint.*;
+import org.apache.ignite.spi.checkpoint.noop.*;
+import org.apache.ignite.spi.collision.noop.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.deployment.local.*;
 import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*;
+import org.apache.ignite.spi.eventstorage.memory.*;
+import org.apache.ignite.spi.failover.*;
+import org.apache.ignite.spi.failover.always.*;
+import org.apache.ignite.spi.indexing.noop.*;
+import org.apache.ignite.spi.loadbalancing.*;
+import org.apache.ignite.spi.loadbalancing.roundrobin.*;
+import org.apache.ignite.spi.swapspace.file.*;
+import org.apache.ignite.spi.swapspace.noop.*;
+import org.apache.ignite.streamer.*;
 import org.apache.ignite.thread.*;
 import org.jdk8.backport.*;
 import org.jetbrains.annotations.*;
 
 import javax.management.*;
 import java.io.*;
+import java.lang.management.*;
 import java.lang.reflect.*;
 import java.net.*;
 import java.util.*;
@@ -103,6 +119,9 @@ public class IgnitionEx {
     /** */
     private static volatile boolean daemon;
 
+    /** */
+    private static final String[] EMPTY_STR_ARR = new String[0];
+
     /**
      * Checks runtime version to be 1.7.x or 1.8.x.
      * This will load pretty much first so we must do these checks here.
@@ -1278,17 +1297,6 @@ public class IgnitionEx {
 
             IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new IgniteConfiguration();
 
-            String ggHome = cfg.getIgniteHome();
-
-            // Set Ignite home.
-            if (ggHome == null)
-                ggHome = U.getIgniteHome();
-            else
-                // If user provided IGNITE_HOME - set it as a system property.
-                U.setIgniteHome(ggHome);
-
-            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
-
             // Ensure invariant.
             // It's a bit dirty - but this is a result of late refactoring
             // and I don't want to reshuffle a lot of code.
@@ -1298,60 +1306,18 @@ public class IgnitionEx {
             if (startCtx.configUrl() != null)
                 System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
 
-            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
-
-            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), myCfg.getNodeId());
+            // Initialize factory's log.
+            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), cfg.getNodeId());
 
             assert cfgLog != null;
 
-            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(myCfg.getNodeId()));
+            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(cfg.getNodeId()));
 
-            // Initialize factory's log.
             log = cfgLog.getLogger(G.class);
 
-            myCfg.setGridLogger(cfgLog);
-
-            // Check Ignite home folder (after log is available).
-            if (ggHome != null) {
-                File ggHomeFile = new File(ggHome);
-
-                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
-                    throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
-            }
-
-            myCfg.setIgniteHome(ggHome);
-
-            // Local host.
-            String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
-
-            myCfg.setLocalHost(F.isEmpty(locHost) ? cfg.getLocalHost() : locHost);
-
-            // Override daemon flag if it was set on the factory.
-            if (daemon)
-                myCfg.setDaemon(true);
-
-            // Check for deployment mode override.
-            String depModeName = IgniteSystemProperties.getString(IGNITE_DEP_MODE_OVERRIDE);
-
-            if (!F.isEmpty(depModeName)) {
-                if (!F.isEmpty(cfg.getCacheConfiguration())) {
-                    U.quietAndInfo(log, "Skipping deployment mode override for caches (custom closure " +
-                        "execution may not work for console Visor)");
-                }
-                else {
-                    try {
-                        DeploymentMode depMode = DeploymentMode.valueOf(depModeName);
+            IgniteConfiguration myCfg = initializeDefaultConfiguration(cfg);
 
-                        if (myCfg.getDeploymentMode() != depMode)
-                            myCfg.setDeploymentMode(depMode);
-                    }
-                    catch (IllegalArgumentException e) {
-                        throw new IgniteCheckedException("Failed to override deployment mode using system property " +
-                            "(are there any misspellings?)" +
-                            "[name=" + IGNITE_DEP_MODE_OVERRIDE + ", value=" + depModeName + ']', e);
-                    }
-                }
-            }
+            myCfg.setGridLogger(cfgLog);
 
             if (myCfg.getConnectorConfiguration() != null) {
                 restExecSvc = new IgniteThreadPoolExecutor(
@@ -1363,38 +1329,6 @@ public class IgnitionEx {
                 );
             }
 
-            Marshaller marsh = cfg.getMarshaller();
-
-            if (marsh == null) {
-                if (!U.isHotSpot()) {
-                    U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " +
-                        "(only Java HotSpot VMs are supported). Switching to standard JDK marshalling - " +
-                        "object serialization performance will be significantly slower.",
-                        "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
-
-                    marsh = new JdkMarshaller();
-                }
-                else if (!OptimizedMarshaller.available()) {
-                    U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " +
-                        "(only recent 1.6 and 1.7 versions HotSpot VMs are supported). " +
-                        "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release. " +
-                        "Switching to standard JDK marshalling - " +
-                        "object serialization performance will be significantly slower.",
-                        "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
-
-                    marsh = new JdkMarshaller();
-                }
-                else
-                    marsh = new OptimizedMarshaller();
-            }
-            else if (marsh instanceof OptimizedMarshaller && !U.isHotSpot()) {
-                U.warn(log, "Using GridOptimizedMarshaller on untested JVM (only Java HotSpot VMs were tested) - " +
-                    "object serialization behavior could yield unexpected results.",
-                    "Using GridOptimizedMarshaller on untested JVM.");
-            }
-
-            myCfg.setMarshaller(marsh);
-
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1418,82 +1352,6 @@ public class IgnitionEx {
                 ensureMultiInstanceSupport(myCfg.getSwapSpaceSpi());
             }
 
-            CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();
-
-            final boolean hasHadoop = IgniteComponentType.HADOOP.inClassPath();
-
-            final boolean hasAtomics = cfg.getAtomicConfiguration() != null;
-
-            final boolean clientDisco = myCfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi;
-
-            CacheConfiguration[] copies;
-
-            if (cacheCfgs != null && cacheCfgs.length > 0) {
-                if (!U.discoOrdered(myCfg.getDiscoverySpi()) && !U.relaxDiscoveryOrdered())
-                    throw new IgniteCheckedException("Discovery SPI implementation does not support node ordering and " +
-                        "cannot be used with cache (use SPI with @GridDiscoverySpiOrderSupport annotation, " +
-                        "like GridTcpDiscoverySpi)");
-
-                for (CacheConfiguration ccfg : cacheCfgs) {
-                    if (CU.isHadoopSystemCache(ccfg.getName()))
-                        throw new IgniteCheckedException("Cache name cannot be \"" + CU.SYS_CACHE_HADOOP_MR +
-                            "\" because it is reserved for internal purposes.");
-
-                    if (CU.isAtomicsCache(ccfg.getName()))
-                        throw new IgniteCheckedException("Cache name cannot be \"" + CU.ATOMICS_CACHE_NAME +
-                            "\" because it is reserved for internal purposes.");
-
-                    if (CU.isUtilityCache(ccfg.getName()))
-                        throw new IgniteCheckedException("Cache name cannot start with \"" + CU.UTILITY_CACHE_NAME +
-                            "\" because this prefix is reserved for internal purposes.");
-                }
-
-                int addCacheCnt = 1; // Always add utility cache.
-
-                if (hasHadoop)
-                    addCacheCnt++;
-
-                if (hasAtomics)
-                    addCacheCnt++;
-
-                copies = new CacheConfiguration[cacheCfgs.length + addCacheCnt];
-
-                int cloneIdx = 1;
-
-                if (hasHadoop)
-                    copies[cloneIdx++] = CU.hadoopSystemCache();
-
-                if (hasAtomics)
-                    copies[cloneIdx++] = atomicsSystemCache(cfg.getAtomicConfiguration(), clientDisco);
-
-                for (CacheConfiguration ccfg : cacheCfgs)
-                    copies[cloneIdx++] = new CacheConfiguration(ccfg);
-            }
-            else {
-                int cacheCnt = 1; // Always add utility cache.
-
-                if (hasHadoop)
-                    cacheCnt++;
-
-                if (hasAtomics)
-                    cacheCnt++;
-
-                copies = new CacheConfiguration[cacheCnt];
-
-                int cacheIdx = 1;
-
-                if (hasHadoop)
-                    copies[cacheIdx++] = CU.hadoopSystemCache();
-
-                if (hasAtomics)
-                    copies[cacheIdx] = atomicsSystemCache(cfg.getAtomicConfiguration(), clientDisco);
-            }
-
-            // Always add utility cache.
-            copies[0] = utilitySystemCache(clientDisco);
-
-            myCfg.setCacheConfiguration(copies);
-
             try {
                 // Use reflection to avoid loading undesired classes.
                 Class helperCls = Class.forName("org.apache.ignite.util.GridConfigurationHelper");
@@ -1636,6 +1494,293 @@ public class IgnitionEx {
         }
 
         /**
+         * @param cfg Ignite configuration copy to.
+         * @return New ignite configuration.
+         */
+        private IgniteConfiguration initializeDefaultConfiguration(IgniteConfiguration cfg)
+            throws IgniteCheckedException {
+            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
+            initializeDefaultConfigurationParameters(myCfg);
+            return myCfg;
+        }
+
+        /**
+         * Initialize default parameters.
+         */
+        public void initializeDefaultConfigurationParameters(IgniteConfiguration cfg) throws IgniteCheckedException {
+            // Set Ignite home.
+            String ggHome = cfg.getIgniteHome();
+
+            if (ggHome == null)
+                ggHome = U.getIgniteHome();
+            else
+                // If user provided IGNITE_HOME - set it as a system property.
+                U.setIgniteHome(ggHome);
+
+            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
+
+            // Check Ignite home folder (after log is available).
+            if (ggHome != null) {
+                File ggHomeFile = new File(ggHome);
+
+                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
+                    throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
+            }
+
+            cfg.setIgniteHome(ggHome);
+
+            // Local host.
+            String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
+
+            cfg.setLocalHost(F.isEmpty(locHost) ? cfg.getLocalHost() : locHost);
+
+            // Override daemon flag if it was set on the factory.
+            if (daemon)
+                cfg.setDaemon(true);
+
+            Marshaller marsh = cfg.getMarshaller();
+
+            if (marsh == null) {
+                if (!U.isHotSpot()) {
+                    U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " +
+                            "(only Java HotSpot VMs are supported). Switching to standard JDK marshalling - " +
+                            "object serialization performance will be significantly slower.",
+                        "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
+
+                    marsh = new JdkMarshaller();
+                }
+                else if (!OptimizedMarshaller.available()) {
+                    U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " +
+                            "(only recent 1.6 and 1.7 versions HotSpot VMs are supported). " +
+                            "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release. " +
+                            "Switching to standard JDK marshalling - " +
+                            "object serialization performance will be significantly slower.",
+                        "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
+
+                    marsh = new JdkMarshaller();
+                }
+                else
+                    marsh = new OptimizedMarshaller();
+            }
+            else if (marsh instanceof OptimizedMarshaller && !U.isHotSpot()) {
+                U.warn(log, "Using GridOptimizedMarshaller on untested JVM (only Java HotSpot VMs were tested) - " +
+                        "object serialization behavior could yield unexpected results.",
+                    "Using GridOptimizedMarshaller on untested JVM.");
+            }
+
+            // Check for deployment mode override.
+            String depModeName = IgniteSystemProperties.getString(IGNITE_DEP_MODE_OVERRIDE);
+
+            if (!F.isEmpty(depModeName)) {
+                if (!F.isEmpty(cfg.getCacheConfiguration())) {
+                    U.quietAndInfo(log, "Skipping deployment mode override for caches (custom closure " +
+                        "execution may not work for console Visor)");
+                }
+                else {
+                    try {
+                        DeploymentMode depMode = DeploymentMode.valueOf(depModeName);
+
+                        if (cfg.getDeploymentMode() != depMode)
+                            cfg.setDeploymentMode(depMode);
+                    }
+                    catch (IllegalArgumentException e) {
+                        throw new IgniteCheckedException("Failed to override deployment mode using system property " +
+                            "(are there any misspellings?)" +
+                            "[name=" + IGNITE_DEP_MODE_OVERRIDE + ", value=" + depModeName + ']', e);
+                    }
+                }
+            }
+
+            cfg.setMarshaller(marsh);
+
+            cfg.setConnectorConfiguration(cfg.getConnectorConfiguration() != null ?
+                new ConnectorConfiguration(cfg.getConnectorConfiguration()) : null);
+
+            IgfsConfiguration[] igfsCfgs = cfg.getIgfsConfiguration();
+
+            if (igfsCfgs != null) {
+                IgfsConfiguration[] clone = igfsCfgs.clone();
+
+                for (int i = 0; i < igfsCfgs.length; i++)
+                    clone[i] = new IgfsConfiguration(igfsCfgs[i]);
+
+                cfg.setIgfsConfiguration(clone);
+            }
+
+            if (cfg.getMBeanServer() == null)
+                cfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
+
+            if (cfg.getNodeId() == null)
+               cfg.setNodeId(UUID.randomUUID());
+
+            if (cfg.getPeerClassLoadingLocalClassPathExclude() == null)
+                cfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);
+
+            StreamerConfiguration[] streamerCfgs = cfg.getStreamerConfiguration();
+
+            if (streamerCfgs != null) {
+                StreamerConfiguration[] clone = streamerCfgs.clone();
+
+                for (int i = 0; i < streamerCfgs.length; i++)
+                    clone[i] = new StreamerConfiguration(streamerCfgs[i]);
+
+                cfg.setStreamerConfiguration(clone);
+            }
+
+            cfg.setTransactionConfiguration(cfg.getTransactionConfiguration() != null ?
+                new TransactionConfiguration(cfg.getTransactionConfiguration()) : null);
+
+            if (cfg.getUserAttributes() == null) {
+                Map<String, ?> emptyAttr = Collections.emptyMap();
+                cfg.setUserAttributes(emptyAttr);
+            }
+
+            initializeDefaultCacheConfiguration(cfg);
+
+            initializeDefaultSpi(cfg);
+        }
+
+        /**
+         * Initialize default cache configuration.
+         *
+         * @param cfg Ignite configuration.
+         */
+        public void initializeDefaultCacheConfiguration(IgniteConfiguration cfg) throws IgniteCheckedException {
+            CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();
+
+            final boolean hasHadoop = IgniteComponentType.HADOOP.inClassPath();
+
+            final boolean hasAtomics = cfg.getAtomicConfiguration() != null;
+
+            final boolean clientDisco = cfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi;
+
+            CacheConfiguration[] copies;
+
+            if (cacheCfgs != null && cacheCfgs.length > 0) {
+                if (!U.discoOrdered(cfg.getDiscoverySpi()) && !U.relaxDiscoveryOrdered())
+                    throw new IgniteCheckedException("Discovery SPI implementation does not support node ordering and " +
+                        "cannot be used with cache (use SPI with @GridDiscoverySpiOrderSupport annotation, " +
+                        "like GridTcpDiscoverySpi)");
+
+                for (CacheConfiguration ccfg : cacheCfgs) {
+                    if (CU.isHadoopSystemCache(ccfg.getName()))
+                        throw new IgniteCheckedException("Cache name cannot be \"" + CU.SYS_CACHE_HADOOP_MR +
+                            "\" because it is reserved for internal purposes.");
+
+                    if (CU.isAtomicsCache(ccfg.getName()))
+                        throw new IgniteCheckedException("Cache name cannot be \"" + CU.ATOMICS_CACHE_NAME +
+                            "\" because it is reserved for internal purposes.");
+
+                    if (CU.isUtilityCache(ccfg.getName()))
+                        throw new IgniteCheckedException("Cache name cannot start with \"" + CU.UTILITY_CACHE_NAME +
+                            "\" because this prefix is reserved for internal purposes.");
+                }
+
+                int addCacheCnt = 1; // Always add utility cache.
+
+                if (hasHadoop)
+                    addCacheCnt++;
+
+                if (hasAtomics)
+                    addCacheCnt++;
+
+                copies = new CacheConfiguration[cacheCfgs.length + addCacheCnt];
+
+                int cloneIdx = 1;
+
+                if (hasHadoop)
+                    copies[cloneIdx++] = CU.hadoopSystemCache();
+
+                if (hasAtomics)
+                    copies[cloneIdx++] = atomicsSystemCache(cfg.getAtomicConfiguration(), clientDisco);
+
+                for (CacheConfiguration ccfg : cacheCfgs)
+                    copies[cloneIdx++] = new CacheConfiguration(ccfg);
+            }
+            else {
+                int cacheCnt = 1; // Always add utility cache.
+
+                if (hasHadoop)
+                    cacheCnt++;
+
+                if (hasAtomics)
+                    cacheCnt++;
+
+                copies = new CacheConfiguration[cacheCnt];
+
+                int cacheIdx = 1;
+
+                if (hasHadoop)
+                    copies[cacheIdx++] = CU.hadoopSystemCache();
+
+                if (hasAtomics)
+                    copies[cacheIdx] = atomicsSystemCache(cfg.getAtomicConfiguration(), clientDisco);
+            }
+
+            // Always add utility cache.
+            copies[0] = utilitySystemCache(clientDisco);
+
+            cfg.setCacheConfiguration(copies);
+        }
+
+        /**
+         * Initialize default values for spi.
+         *
+         * @param cfg Ignite configuration.
+         */
+        private void initializeDefaultSpi(IgniteConfiguration cfg) {
+            if (cfg.getDiscoverySpi() == null)
+                cfg.setDiscoverySpi(new TcpDiscoverySpi());
+
+            if (cfg.getDiscoverySpi() instanceof TcpDiscoverySpi) {
+                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)cfg.getDiscoverySpi();
+
+                if (tcpDisco.getIpFinder() == null)
+                    tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
+            }
+
+            if (cfg.getCommunicationSpi() == null)
+                cfg.setCommunicationSpi(new TcpCommunicationSpi());
+
+            if (cfg.getDeploymentSpi() == null)
+                cfg.setDeploymentSpi(new LocalDeploymentSpi());
+
+            if (cfg.getEventStorageSpi() == null)
+                cfg.setEventStorageSpi(new MemoryEventStorageSpi());
+
+            if (cfg.getCheckpointSpi() == null)
+                cfg.setCheckpointSpi(new CheckpointSpi[] {new NoopCheckpointSpi()});
+
+            if (cfg.getCollisionSpi() == null)
+                cfg.setCollisionSpi(new NoopCollisionSpi());
+
+            if (cfg.getFailoverSpi() == null)
+                cfg.setFailoverSpi(new FailoverSpi[] {new AlwaysFailoverSpi()});
+
+            if (cfg.getLoadBalancingSpi() == null)
+                cfg.setLoadBalancingSpi(new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()});
+
+            if (cfg.getIndexingSpi() == null)
+                cfg.setIndexingSpi(new NoopIndexingSpi());
+
+            if (cfg.getSwapSpaceSpi() == null) {
+                boolean needSwap = false;
+
+                if (cfg.getCacheConfiguration() != null) {
+                    for (CacheConfiguration c : cfg.getCacheConfiguration()) {
+                        if (c.isSwapEnabled()) {
+                            needSwap = true;
+
+                            break;
+                        }
+                    }
+                }
+
+                cfg.setSwapSpaceSpi(needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi());
+            }
+        }
+
+        /**
          * @param cfgLog Configured logger.
          * @param nodeId Local node ID.
          * @return Initialized logger.


[40/50] incubator-ignite git commit: ignite-342 review

Posted by ak...@apache.org.
ignite-342 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/8baca046
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8baca046
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8baca046

Branch: refs/heads/ignite-368
Commit: 8baca046e02e703b5ce5c0a2f1a34ba279392a3e
Parents: 11efb91
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Mar 2 17:16:26 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Mar 2 17:16:26 2015 +0300

----------------------------------------------------------------------
 .../affinity/GridAffinityAssignmentCache.java   |  13 +-
 .../processors/cache/GridCacheContext.java      |  19 ++
 .../processors/cache/GridCacheProcessor.java    |  15 ++
 ...acheAbstractUsersAffinityMapperSelfTest.java | 207 +++++++++++++++++++
 ...dCacheAtomicUsersAffinityMapperSelfTest.java |  45 ++++
 ...heReplicatedUsersAffinityMapperSelfTest.java |  45 ++++
 .../GridCacheTxUsersAffinityMapperSelfTest.java |  45 ++++
 7 files changed, 388 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 9c12a17..69795b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -305,7 +305,18 @@ public class GridAffinityAssignmentCache {
             }
         }
 
-        return aff.partition(affMapper.affinityKey(key));
+        return aff.partition(affinityKey(key));
+    }
+
+    /**
+     * If Key is {@link GridCacheInternal GridCacheInternal} entry when won't passed into user's mapper and
+     * will use {@link GridCacheDefaultAffinityKeyMapper default}.
+     *
+     * @param key Key.
+     * @return Affinity key.
+     */
+    private Object affinityKey(Object key) {
+        return (key instanceof GridCacheInternal ? ctx.defaultAffMapper() : affMapper).affinityKey(key);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 3ec013c..44f8e69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -164,6 +165,9 @@ public class GridCacheContext<K, V> implements Externalizable {
     /** Cached local rich node. */
     private ClusterNode locNode;
 
+    /** Default cache affinity mapper. */
+    private CacheAffinityKeyMapper affMapper;
+
     /**
      * Thread local projection. If it's set it means that method call was initiated
      * by child projection of initial cache.
@@ -1016,6 +1020,20 @@ public class GridCacheContext<K, V> implements Externalizable {
     }
 
     /**
+     * @return Default affinity key mapper.
+     */
+    public CacheAffinityKeyMapper defaultAffMapper() {
+        return affMapper;
+    }
+
+    /**
+     * Sets default affinity key mapper.
+     */
+    public void defaultAffMapper(CacheAffinityKeyMapper dfltAffMapper) {
+        this.affMapper = dfltAffMapper;
+    }
+
+    /**
      * @param p Single predicate.
      * @return Array containing single predicate.
      */
@@ -1770,6 +1788,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         evictMgr = null;
         qryMgr = null;
         dataStructuresMgr = null;
+        affMapper = null;
 
         mgrs.clear();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/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 e99c706..f74f969 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
@@ -618,6 +618,17 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             U.startLifecycleAware(lifecycleAwares(cfg, jta.tmLookup(), cfgStore));
 
+            // Init default key mapper.
+            CacheAffinityKeyMapper dfltAffMapper;
+
+            if (cfg.getAffinityMapper().getClass().equals(GridCacheDefaultAffinityKeyMapper.class))
+                dfltAffMapper = cfg.getAffinityMapper();
+            else {
+                dfltAffMapper = new GridCacheDefaultAffinityKeyMapper();
+
+                prepare(cfg, dfltAffMapper, false);
+            }
+
             cfgs[i] = cfg; // Replace original configuration value.
 
             GridCacheAffinityManager affMgr = new GridCacheAffinityManager();
@@ -655,6 +666,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 drMgr,
                 jta);
 
+            cacheCtx.defaultAffMapper(dfltAffMapper);
+
             GridCacheAdapter cache = null;
 
             switch (cfg.getCacheMode()) {
@@ -793,6 +806,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     drMgr,
                     jta);
 
+                cacheCtx.defaultAffMapper(dfltAffMapper);
+
                 GridDhtCacheAdapter dht = null;
 
                 switch (cfg.getAtomicityMode()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
new file mode 100644
index 0000000..71f28ce
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractUsersAffinityMapperSelfTest.java
@@ -0,0 +1,207 @@
+/*
+ * 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.cache.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.lang.*;
+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 java.io.*;
+
+/**
+ * Test affinity mapper.
+ */
+public abstract class GridCacheAbstractUsersAffinityMapperSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final int KEY_CNT = 1000;
+
+    /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    public static final CacheAffinityKeyMapper AFFINITY_MAPPER = new UsersAffinityKeyMapper();
+
+    /** */
+    public GridCacheAbstractUsersAffinityMapperSelfTest() {
+        super(false /* doesn't start grid */);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration cacheCfg = new CacheConfiguration();
+
+        cacheCfg.setName(null);
+        cacheCfg.setCacheMode(getCacheMode());
+        cacheCfg.setAtomicityMode(getAtomicMode());
+        cacheCfg.setDistributionMode(getDistributionMode());
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setPreloadMode(CachePreloadMode.SYNC);
+        cacheCfg.setAffinityMapper(AFFINITY_MAPPER);
+
+        cfg.setCacheConfiguration(cacheCfg);
+
+        TcpDiscoverySpi spi = new TcpDiscoverySpi();
+
+        spi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(spi);
+
+        return cfg;
+    }
+
+    /**
+     * @return Distribution mode.
+     */
+    protected abstract CacheDistributionMode getDistributionMode();
+
+    /**
+     * @return Cache atomicity mode.
+     */
+    protected abstract CacheAtomicityMode getAtomicMode();
+
+    /**
+     * @return Cache mode.
+     */
+    protected abstract CacheMode getCacheMode();
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityMapper() throws Exception {
+        IgniteCache<Object, Object> cache = startGrid(0).jcache(null);
+
+        for (int i = 0; i < KEY_CNT; i++) {
+            cache.put(String.valueOf(i), String.valueOf(i));
+
+            cache.put(new TestAffinityKey(i, String.valueOf(i)), i);
+        }
+
+        assertEquals(1, cache.get(new TestAffinityKey(1, "1")));
+
+        startGrid(1);
+
+        for (int i = 0; i < KEY_CNT; i++)
+            grid(i % 2).compute().affinityRun(null, new TestAffinityKey(1, "1"), new NoopClosure());
+    }
+
+    /**
+     * Test key for field annotation.
+     */
+    private static class TestAffinityKey implements Externalizable {
+        /** Key. */
+        private int key;
+
+        /** Affinity key. */
+        @CacheAffinityKeyMapped
+        private String affKey;
+
+        /**
+         * Constructor.
+         */
+        public TestAffinityKey() {
+        }
+
+        /**
+         * Constructor.
+         *
+         * @param key Key.
+         * @param affKey Affinity key.
+         */
+        TestAffinityKey(int key, String affKey) {
+            this.key = key;
+            this.affKey = affKey;
+        }
+
+        /**
+         * @return Key.
+         */
+        public int key() {
+            return key;
+        }
+
+        /**
+         * @return Affinity key.
+         */
+        public String affinityKey() {
+            return affKey;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            return o instanceof TestAffinityKey && key == ((TestAffinityKey)o).key();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int hashCode() {
+            return key + affKey.hashCode();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeExternal(ObjectOutput out) throws IOException {
+            out.writeInt(key);
+            out.writeUTF(affKey);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+            key = in.readInt();
+            affKey = in.readUTF();
+        }
+    }
+
+    /**
+     * Users affinity mapper.
+     */
+    private static class UsersAffinityKeyMapper extends GridCacheDefaultAffinityKeyMapper{
+        /** {@inheritDoc} */
+        @Override public Object affinityKey(Object key) {
+            GridArgumentCheck.notNull(key, "key");
+
+            assertFalse("GridCacheInternal entry mustn't be passed in user's key mapper.",
+                key instanceof GridCacheInternal);
+
+            return super.affinityKey(key);
+        }
+    }
+
+    /**
+     * Noop closure.
+     */
+    private static class NoopClosure implements IgniteRunnable {
+        /** {@inheritDoc} */
+        @Override public void run() {
+            // No-op.
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicUsersAffinityMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicUsersAffinityMapperSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicUsersAffinityMapperSelfTest.java
new file mode 100644
index 0000000..8a80e35
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicUsersAffinityMapperSelfTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.*;
+
+/**
+ * Test affinity mapper.
+ */
+public class GridCacheAtomicUsersAffinityMapperSelfTest extends GridCacheAbstractUsersAffinityMapperSelfTest {
+    /** */
+    public GridCacheAtomicUsersAffinityMapperSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDistributionMode() {
+        return CacheDistributionMode.PARTITIONED_ONLY;
+    };
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedUsersAffinityMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedUsersAffinityMapperSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedUsersAffinityMapperSelfTest.java
new file mode 100644
index 0000000..47e5dc7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedUsersAffinityMapperSelfTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.*;
+
+/**
+ * Test affinity mapper.
+ */
+public class GridCacheReplicatedUsersAffinityMapperSelfTest extends GridCacheAbstractUsersAffinityMapperSelfTest {
+    /** */
+    public GridCacheReplicatedUsersAffinityMapperSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDistributionMode() {
+        return CacheDistributionMode.PARTITIONED_ONLY;
+    };
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return CacheMode.REPLICATED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8baca046/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxUsersAffinityMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxUsersAffinityMapperSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxUsersAffinityMapperSelfTest.java
new file mode 100644
index 0000000..61af04e
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxUsersAffinityMapperSelfTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.*;
+
+/**
+ * Test affinity mapper.
+ */
+public class GridCacheTxUsersAffinityMapperSelfTest extends GridCacheAbstractUsersAffinityMapperSelfTest {
+    /** */
+    public GridCacheTxUsersAffinityMapperSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDistributionMode() {
+        return CacheDistributionMode.PARTITIONED_ONLY;
+    };
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return CacheAtomicityMode.TRANSACTIONAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+}


[33/50] incubator-ignite git commit: #ignite-239: small refactoring.

Posted by ak...@apache.org.
#ignite-239: small refactoring.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/55669d46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/55669d46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/55669d46

Branch: refs/heads/ignite-368
Commit: 55669d46b838a1312e1067c8608243b89462fc54
Parents: ba010da
Author: ivasilinets <va...@gmail.com>
Authored: Sun Mar 1 15:39:37 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Sun Mar 1 15:39:37 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 172 +++++++++----------
 1 file changed, 86 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55669d46/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index c7e7cb6..9770205 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1295,29 +1295,14 @@ public class IgnitionEx {
         private void start0(GridStartContext startCtx) throws IgniteCheckedException {
             assert grid == null : "Grid is already started: " + name;
 
-            // Set configuration URL, if any, into system property.
-            if (startCtx.configUrl() != null)
-                System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
-
             IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new IgniteConfiguration();
 
-            // Ensure invariant.
-            // It's a bit dirty - but this is a result of late refactoring
-            // and I don't want to reshuffle a lot of code.
-            assert F.eq(name, cfg.getGridName());
-
-            // Validate segmentation configuration.
-            GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
-
-            // 1. Warn on potential configuration problem: grid is not configured to wait
-            // for correct segment after segmentation happens.
-            if (!F.isEmpty(cfg.getSegmentationResolvers()) && segPlc == RESTART_JVM && !cfg.isWaitForSegmentOnStart()) {
-                U.warn(log, "Found potential configuration problem (forgot to enable waiting for segment" +
-                    "on start?) [segPlc=" + segPlc + ", wait=false]");
-            }
-
             IgniteConfiguration myCfg = initializeConfiguration(cfg);
 
+            // Set configuration URL, if any, into system property.
+            if (startCtx.configUrl() != null)
+                System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
+
             // Ensure that SPIs support multiple grid instances, if required.
             if (!startCtx.single()) {
                 ensureMultiInstanceSupport(myCfg.getDeploymentSpi());
@@ -1331,17 +1316,6 @@ public class IgnitionEx {
                 ensureMultiInstanceSupport(myCfg.getSwapSpaceSpi());
             }
 
-            try {
-                // Use reflection to avoid loading undesired classes.
-                Class helperCls = Class.forName("org.apache.ignite.util.GridConfigurationHelper");
-
-                helperCls.getMethod("overrideConfiguration", IgniteConfiguration.class, Properties.class,
-                    String.class, IgniteLogger.class).invoke(helperCls, myCfg, System.getProperties(), name, log);
-            }
-            catch (Exception ignored) {
-                // No-op.
-            }
-
             execSvc = new IgniteThreadPoolExecutor(
                 "pub-" + cfg.getGridName(),
                 cfg.getPublicThreadPoolSize(),
@@ -1414,6 +1388,17 @@ public class IgnitionEx {
             // Register Ignite MBean for current grid instance.
             registerFactoryMbean(myCfg.getMBeanServer());
 
+            try {
+                // Use reflection to avoid loading undesired classes.
+                Class helperCls = Class.forName("org.apache.ignite.util.GridConfigurationHelper");
+
+                helperCls.getMethod("overrideConfiguration", IgniteConfiguration.class, Properties.class,
+                        String.class, IgniteLogger.class).invoke(helperCls, myCfg, System.getProperties(), name, log);
+            }
+            catch (Exception ignored) {
+                // No-op.
+            }
+
             boolean started = false;
 
             try {
@@ -1489,16 +1474,7 @@ public class IgnitionEx {
          */
         private IgniteConfiguration initializeConfiguration(IgniteConfiguration cfg)
             throws IgniteCheckedException {
-            // Initialize factory's log.
-            UUID nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
-
-            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
-
-            assert cfgLog != null;
-
-            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(nodeId));
-
-            log = cfgLog.getLogger(G.class);
+            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
 
             String ggHome = cfg.getIgniteHome();
 
@@ -1511,6 +1487,24 @@ public class IgnitionEx {
 
             U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
 
+            // Ensure invariant.
+            // It's a bit dirty - but this is a result of late refactoring
+            // and I don't want to reshuffle a lot of code.
+            assert F.eq(name, cfg.getGridName());
+
+            UUID nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
+
+            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
+
+            assert cfgLog != null;
+
+            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(nodeId));
+
+            // Initialize factory's log.
+            log = cfgLog.getLogger(G.class);
+
+            myCfg.setGridLogger(cfgLog);
+
             // Check Ignite home folder (after log is available).
             if (ggHome != null) {
                 File ggHomeFile = new File(ggHome);
@@ -1519,11 +1513,23 @@ public class IgnitionEx {
                     throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
             }
 
-            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
-
             myCfg.setIgniteHome(ggHome);
 
-            myCfg.setGridLogger(cfgLog);
+            // Validate segmentation configuration.
+            GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
+
+            // 1. Warn on potential configuration problem: grid is not configured to wait
+            // for correct segment after segmentation happens.
+            if (!F.isEmpty(cfg.getSegmentationResolvers()) && segPlc == RESTART_JVM && !cfg.isWaitForSegmentOnStart()) {
+                U.warn(log, "Found potential configuration problem (forgot to enable waiting for segment" +
+                        "on start?) [segPlc=" + segPlc + ", wait=false]");
+            }
+
+            myCfg.setTransactionConfiguration(myCfg.getTransactionConfiguration() != null ?
+                    new TransactionConfiguration(myCfg.getTransactionConfiguration()) : null);
+
+            myCfg.setConnectorConfiguration(myCfg.getConnectorConfiguration() != null ?
+                    new ConnectorConfiguration(myCfg.getConnectorConfiguration()) : null);
 
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
@@ -1534,6 +1540,37 @@ public class IgnitionEx {
             if (daemon)
                 myCfg.setDaemon(true);
 
+            // Check for deployment mode override.
+            String depModeName = IgniteSystemProperties.getString(IGNITE_DEP_MODE_OVERRIDE);
+
+            if (!F.isEmpty(depModeName)) {
+                if (!F.isEmpty(myCfg.getCacheConfiguration())) {
+                    U.quietAndInfo(log, "Skipping deployment mode override for caches (custom closure " +
+                            "execution may not work for console Visor)");
+                }
+                else {
+                    try {
+                        DeploymentMode depMode = DeploymentMode.valueOf(depModeName);
+
+                        if (myCfg.getDeploymentMode() != depMode)
+                            myCfg.setDeploymentMode(depMode);
+                    }
+                    catch (IllegalArgumentException e) {
+                        throw new IgniteCheckedException("Failed to override deployment mode using system property " +
+                                "(are there any misspellings?)" +
+                                "[name=" + IGNITE_DEP_MODE_OVERRIDE + ", value=" + depModeName + ']', e);
+                    }
+                }
+            }
+
+            if (myCfg.getUserAttributes() == null) {
+                Map<String, ?> emptyAttr = Collections.emptyMap();
+                myCfg.setUserAttributes(emptyAttr);
+            }
+
+            if (myCfg.getMBeanServer() == null)
+                myCfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
+
             Marshaller marsh = myCfg.getMarshaller();
 
             if (marsh == null) {
@@ -1564,33 +1601,12 @@ public class IgnitionEx {
                     "Using GridOptimizedMarshaller on untested JVM.");
             }
 
-            // Check for deployment mode override.
-            String depModeName = IgniteSystemProperties.getString(IGNITE_DEP_MODE_OVERRIDE);
-
-            if (!F.isEmpty(depModeName)) {
-                if (!F.isEmpty(myCfg.getCacheConfiguration())) {
-                    U.quietAndInfo(log, "Skipping deployment mode override for caches (custom closure " +
-                        "execution may not work for console Visor)");
-                }
-                else {
-                    try {
-                        DeploymentMode depMode = DeploymentMode.valueOf(depModeName);
-
-                        if (myCfg.getDeploymentMode() != depMode)
-                            myCfg.setDeploymentMode(depMode);
-                    }
-                    catch (IllegalArgumentException e) {
-                        throw new IgniteCheckedException("Failed to override deployment mode using system property " +
-                            "(are there any misspellings?)" +
-                            "[name=" + IGNITE_DEP_MODE_OVERRIDE + ", value=" + depModeName + ']', e);
-                    }
-                }
-            }
-
             myCfg.setMarshaller(marsh);
 
-            myCfg.setConnectorConfiguration(myCfg.getConnectorConfiguration() != null ?
-                new ConnectorConfiguration(myCfg.getConnectorConfiguration()) : null);
+            if (myCfg.getPeerClassLoadingLocalClassPathExclude() == null)
+                myCfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);
+
+            myCfg.setNodeId(nodeId);
 
             IgfsConfiguration[] igfsCfgs = myCfg.getIgfsConfiguration();
 
@@ -1603,14 +1619,6 @@ public class IgnitionEx {
                 myCfg.setIgfsConfiguration(clone);
             }
 
-            if (myCfg.getMBeanServer() == null)
-                myCfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
-
-            myCfg.setNodeId(nodeId);
-
-            if (myCfg.getPeerClassLoadingLocalClassPathExclude() == null)
-                myCfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);
-
             StreamerConfiguration[] streamerCfgs = myCfg.getStreamerConfiguration();
 
             if (streamerCfgs != null) {
@@ -1622,18 +1630,10 @@ public class IgnitionEx {
                 myCfg.setStreamerConfiguration(clone);
             }
 
-            myCfg.setTransactionConfiguration(myCfg.getTransactionConfiguration() != null ?
-                new TransactionConfiguration(myCfg.getTransactionConfiguration()) : null);
-
-            if (myCfg.getUserAttributes() == null) {
-                Map<String, ?> emptyAttr = Collections.emptyMap();
-                myCfg.setUserAttributes(emptyAttr);
-            }
+            initializeDefaultSpi(myCfg);
 
             initializeDefaultCacheConfiguration(myCfg);
 
-            initializeDefaultSpi(myCfg);
-
             return myCfg;
         }
 
@@ -1722,7 +1722,7 @@ public class IgnitionEx {
         }
 
         /**
-         * Initialize default values for spi.
+         * Initialize default SPI implementations.
          *
          * @param cfg Ignite configuration.
          */


[29/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d1b9436a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d1b9436a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d1b9436a

Branch: refs/heads/ignite-368
Commit: d1b9436a467148539d69a6dc70a084dd37ffa58f
Parents: 4f7dbf7 e1c0945
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 17:59:43 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 17:59:43 2015 +0300

----------------------------------------------------------------------
 config/ignite-log4j.xml                         |    2 +-
 .../datagrid/CacheContinuousQueryExample.java   |    2 +-
 ipc/shmem/Makefile.am                           |   15 +
 ipc/shmem/igniteshmem/Makefile.am               |   15 +
 ipc/shmem/include/Makefile.am                   |   15 +
 modules/clients/src/test/keystore/generate.sh   |   15 +-
 .../ignite/cache/query/ContinuousQuery.java     |   18 +-
 .../apache/ignite/cluster/ClusterMetrics.java   |    2 +-
 .../internal/events/DiscoveryCustomEvent.java   |    3 +
 .../processors/cache/IgniteCacheProxy.java      |    6 +-
 .../optimized-classnames.previous.properties    |   15 +
 .../optimized/optimized-classnames.properties   | 1565 +-----------------
 .../TcpDiscoveryCustomEventMessage.java         |    3 +
 ...ridCacheContinuousQueryAbstractSelfTest.java |    8 +-
 modules/extdata/p2p/pom.xml                     |    6 -
 modules/hibernate/pom.xml                       |    6 -
 modules/indexing/pom.xml                        |    6 -
 modules/jta/pom.xml                             |    6 -
 modules/scalar/pom.xml                          |    6 -
 modules/spring/pom.xml                          |    6 -
 modules/visor-console/pom.xml                   |    7 -
 modules/web/pom.xml                             |    6 -
 modules/winservice/IgniteService.sln            |    2 +-
 .../IgniteService/IgniteService.csproj          |    2 +-
 .../config/benchmark-atomic-win.properties      |   15 +
 .../config/benchmark-atomic.properties          |   15 +
 .../config/benchmark-compute-win.properties     |   15 +
 .../config/benchmark-compute.properties         |   15 +
 .../config/benchmark-multicast.properties       |   15 +
 .../config/benchmark-query-win.properties       |   15 +
 .../yardstick/config/benchmark-query.properties |   15 +
 .../config/benchmark-tx-win.properties          |   15 +
 .../yardstick/config/benchmark-tx.properties    |   15 +
 .../yardstick/config/benchmark-win.properties   |   15 +
 modules/yardstick/config/benchmark.properties   |   15 +
 pom.xml                                         |  150 +-
 36 files changed, 358 insertions(+), 1694 deletions(-)
----------------------------------------------------------------------



[17/50] incubator-ignite git commit: #ignite-239: move setGridName to copy constructor.

Posted by ak...@apache.org.
#ignite-239: move setGridName to copy constructor.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/631a953f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/631a953f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/631a953f

Branch: refs/heads/ignite-368
Commit: 631a953f6b4f6863a76e2a4f1edd5ce656e51972
Parents: 6fa46c3
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 11:26:30 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 11:26:30 2015 +0300

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/ignite/internal/IgnitionEx.java  | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/631a953f/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 8e1e110..7249e4e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1326,8 +1326,6 @@ public class IgnitionEx {
 
             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
 
-            myCfg.setGridName(cfg.getGridName());
-
             UUID nodeId = cfg.getNodeId();
 
             if (nodeId == null)


[02/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bfb09c49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bfb09c49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bfb09c49

Branch: refs/heads/ignite-368
Commit: bfb09c49cef0b6853fb1ce8294339adbc67593d3
Parents: 706f605 f1ec719
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 20 15:37:05 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 20 15:37:05 2015 +0300

----------------------------------------------------------------------
 README.md                                       | 181 +++-
 bin/include/target-classpath.bat                |   4 +-
 bin/include/target-classpath.sh                 |  10 +-
 docs/ignite_readme.md                           |  12 +-
 docs/ignite_readme.pdf                          | Bin 76810 -> 77136 bytes
 docs/release_notes.md                           |  16 +
 docs/release_notes.pdf                          | Bin 59911 -> 33174 bytes
 examples/config/example-cache.xml               |  10 +
 examples/pom-standalone.xml                     |   2 +-
 .../IgniteAtomicSequenceExample.java            |  35 +-
 .../datastructures/IgniteQueueExample.java      |   2 +-
 .../ClientAbstractMultiNodeSelfTest.java        |   6 +-
 .../rest/AbstractRestProcessorSelfTest.java     |   2 +-
 .../CommunicationMessageCodeGenerator.java      | 788 ----------------
 .../ignite/codegen/MessageCodeGenerator.java    | 799 +++++++++++++++++
 .../java/org/apache/ignite/cache/GridCache.java |  48 -
 .../ignite/internal/ClusterGroupAdapter.java    | 889 -------------------
 .../apache/ignite/internal/ClusterGroupEx.java  |  44 -
 .../internal/ClusterNodeLocalMapImpl.java       | 103 ---
 .../apache/ignite/internal/GridComponent.java   |   4 +-
 .../apache/ignite/internal/GridKillTask.java    | 103 ---
 .../ignite/internal/GridPluginComponent.java    |   2 +-
 .../ignite/internal/IgniteClusterAsyncImpl.java | 261 ------
 .../ignite/internal/IgniteComputeImpl.java      |   1 +
 .../ignite/internal/IgniteEventsImpl.java       |   1 +
 .../org/apache/ignite/internal/IgniteEx.java    |  14 +-
 .../apache/ignite/internal/IgniteKernal.java    | 631 +++----------
 .../ignite/internal/IgniteMessagingImpl.java    |   1 +
 .../ignite/internal/IgniteServicesImpl.java     |   1 +
 .../org/apache/ignite/internal/IgnitionEx.java  |   4 +-
 .../internal/client/impl/GridClientImpl.java    |   2 +-
 .../internal/cluster/ClusterGroupAdapter.java   | 866 ++++++++++++++++++
 .../ignite/internal/cluster/ClusterGroupEx.java |  44 +
 .../cluster/ClusterNodeLocalMapImpl.java        | 104 +++
 .../cluster/IgniteClusterAsyncImpl.java         | 292 ++++++
 .../internal/cluster/IgniteClusterEx.java       |  27 +
 .../internal/cluster/IgniteClusterImpl.java     | 527 +++++++++++
 .../ignite/internal/cluster/IgniteKillTask.java | 103 +++
 .../internal/executor/GridExecutorService.java  |   1 +
 .../internal/managers/GridManagerAdapter.java   |   2 +-
 .../discovery/GridDiscoveryManager.java         |   4 +-
 .../processors/GridProcessorAdapter.java        |   2 +-
 .../processors/cache/CacheProjection.java       |  24 +-
 .../processors/cache/GridCacheAdapter.java      | 231 +++--
 .../processors/cache/GridCacheContext.java      |  19 +-
 .../processors/cache/GridCacheEntryEx.java      |  16 +-
 .../cache/GridCacheEvictionManager.java         |  21 +-
 .../processors/cache/GridCacheMapEntry.java     | 124 ++-
 .../processors/cache/GridCacheProcessor.java    |   4 +
 .../processors/cache/GridCacheProjectionEx.java |  55 +-
 .../cache/GridCacheProjectionImpl.java          |  45 +-
 .../processors/cache/GridCacheProxyImpl.java    |  28 +-
 .../processors/cache/GridCacheSwapManager.java  |  84 +-
 .../cache/GridCacheUpdateAtomicResult.java      |  29 +-
 .../processors/cache/GridCacheUtils.java        |  58 +-
 .../processors/cache/IgniteCacheProxy.java      |  18 +-
 .../GridDistributedCacheAdapter.java            |   4 +-
 .../GridDistributedTxRemoteAdapter.java         |  30 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |  25 +-
 .../distributed/dht/GridDhtCacheEntry.java      | 112 ++-
 .../cache/distributed/dht/GridDhtGetFuture.java |   1 -
 .../distributed/dht/GridDhtTxLocalAdapter.java  |   5 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |  13 +-
 .../dht/GridPartitionedGetFuture.java           |   8 +-
 .../dht/atomic/GridDhtAtomicCache.java          | 154 ++--
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |  12 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  | 100 +--
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  48 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java | 128 ++-
 .../distributed/near/GridNearAtomicCache.java   |  31 +-
 .../distributed/near/GridNearCacheAdapter.java  |   8 +-
 .../distributed/near/GridNearGetFuture.java     |  15 +-
 .../near/GridNearTxPrepareFuture.java           |   5 +-
 .../processors/cache/dr/GridCacheDrInfo.java    |   5 +-
 .../local/atomic/GridLocalAtomicCache.java      |  83 +-
 .../cache/query/GridCacheQueryManager.java      |   2 +-
 .../continuous/CacheContinuousQueryManager.java |  20 +-
 .../cache/transactions/IgniteTxAdapter.java     |  16 +-
 .../cache/transactions/IgniteTxEntry.java       |  66 +-
 .../transactions/IgniteTxLocalAdapter.java      |  67 +-
 .../cache/version/GridCacheVersion.java         |   4 +-
 .../cache/version/GridCacheVersionEx.java       |   2 +-
 .../continuous/GridContinuousProcessor.java     |   2 +-
 .../dataload/IgniteDataLoaderImpl.java          |  19 +-
 .../datastructures/DataStructuresProcessor.java |  15 +-
 .../datastructures/GridCacheSetImpl.java        |   4 +-
 .../dr/GridDrDataLoadCacheUpdater.java          |   4 +-
 .../plugin/IgnitePluginProcessor.java           |  28 +-
 .../processors/query/GridQueryProcessor.java    |   4 +-
 .../handlers/cache/GridCacheCommandHandler.java |   4 +-
 .../cache/GridCacheQueryCommandHandler.java     |   4 +-
 .../handlers/task/GridTaskCommandHandler.java   |   4 +-
 .../top/GridTopologyCommandHandler.java         |   2 +-
 .../security/GridSecurityContext.java           |   9 +-
 .../streamer/GridStreamerContextImpl.java       |   2 +-
 .../ignite/internal/util/IgniteUtils.java       |   2 +-
 .../internal/util/future/GridFutureAdapter.java |   8 +-
 .../util/future/GridFutureAdapterEx.java        |   3 +-
 .../ignite/internal/visor/cache/VisorCache.java |   2 +-
 .../visor/cache/VisorCacheClearTask.java        |   3 +-
 .../visor/cache/VisorCacheCompactTask.java      |   2 +-
 .../visor/cache/VisorCacheConfiguration.java    |  40 +-
 .../cache/VisorCacheDefaultConfiguration.java   |  57 --
 .../visor/cache/VisorCacheLoadTask.java         |  43 +-
 .../visor/cache/VisorCacheMetadataTask.java     |   2 +-
 .../internal/visor/cache/VisorCacheMetrics.java |   3 +-
 .../visor/cache/VisorCachePreloadTask.java      |   4 +-
 .../visor/cache/VisorCacheSwapBackupsTask.java  |   2 +-
 .../cache/VisorCacheTypeFieldMetadata.java      |   1 -
 .../visor/cache/VisorCacheTypeMetadata.java     |  12 +-
 .../compute/VisorComputeCancelSessionsTask.java |   2 +-
 .../compute/VisorComputeMonitoringHolder.java   |   6 +-
 .../compute/VisorComputeResetMetricsTask.java   |   2 +-
 .../VisorComputeToggleMonitoringTask.java       |   4 +-
 .../internal/visor/debug/VisorThreadInfo.java   |  14 +-
 .../event/VisorGridAuthenticationEvent.java     | 106 ---
 .../event/VisorGridAuthorizationEvent.java      |  89 --
 .../visor/event/VisorGridEventsLost.java        |   2 +-
 .../event/VisorGridSecuritySessionEvent.java    |   2 +-
 .../internal/visor/igfs/VisorIgfsEndpoint.java  |   5 +-
 .../visor/igfs/VisorIgfsProfilerEntry.java      |   6 +-
 .../visor/igfs/VisorIgfsProfilerTask.java       |  34 +-
 .../VisorIgfsProfilerUniformityCounters.java    |  15 +-
 .../visor/igfs/VisorIgfsResetMetricsTask.java   |   2 +-
 .../visor/igfs/VisorIgfsSamplingStateTask.java  |   2 +-
 .../internal/visor/log/VisorLogSearchTask.java  |  18 +-
 .../visor/misc/VisorResolveHostNameTask.java    |   6 +-
 .../node/VisorCacheQueryConfiguration.java      | 141 +++
 .../node/VisorExecutorServiceConfiguration.java |   2 +-
 .../visor/node/VisorGridConfiguration.java      |  18 +
 .../visor/node/VisorNodeDataCollectorJob.java   |  54 +-
 .../node/VisorNodeEventsCollectorTask.java      |   6 +-
 .../internal/visor/node/VisorNodeGcTask.java    |   2 +-
 .../internal/visor/node/VisorNodePingTask.java  |   2 +-
 .../visor/node/VisorQueryConfiguration.java     | 183 ++++
 .../visor/node/VisorSpisConfiguration.java      |  36 +-
 .../visor/query/VisorQueryCleanupTask.java      |   3 +-
 .../visor/query/VisorQueryNextPageTask.java     |   8 +-
 .../visor/query/VisorQueryResultEx.java         |   2 +-
 .../internal/visor/query/VisorQueryTask.java    |  10 +-
 .../internal/visor/query/VisorQueryUtils.java   |  18 +-
 .../internal/visor/util/VisorEventMapper.java   |  76 ++
 .../internal/visor/util/VisorTaskUtils.java     |  81 +-
 .../optimized/optimized-classnames.properties   |  70 +-
 .../apache/ignite/plugin/ExtensionRegistry.java |   2 +-
 .../apache/ignite/plugin/PluginProvider.java    |   3 +-
 .../spi/discovery/DiscoverySpiDataExchange.java |   3 +-
 .../discovery/tcp/TcpClientDiscoverySpi.java    |   4 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   4 +-
 .../discovery/tcp/TcpDiscoverySpiAdapter.java   |   2 +-
 .../core/src/main/resources/ignite.properties   |   3 +-
 .../ignite/IgniteCacheAffinitySelfTest.java     |   8 +-
 .../IgniteCacheExpiryStoreLoadSelfTest.java     | 239 +++++
 .../ignite/internal/ClusterMetricsSelfTest.java |   2 +-
 .../GridJobMasterLeaveAwareSelfTest.java        |   8 +-
 .../internal/GridMultipleJobsSelfTest.java      |   2 +-
 .../internal/GridProjectionAbstractTest.java    |   2 +-
 .../ignite/internal/GridProjectionSelfTest.java |   2 +-
 .../apache/ignite/internal/GridSelfTest.java    |  15 +-
 .../GridAffinityProcessorAbstractSelfTest.java  |   7 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |  28 +-
 .../cache/GridCacheAffinityApiSelfTest.java     |  18 +-
 .../cache/GridCacheEntryMemorySizeSelfTest.java |   4 +-
 ...GridCacheMixedPartitionExchangeSelfTest.java |   2 +-
 .../cache/GridCacheQueryIndexSelfTest.java      |   4 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   8 +-
 .../cache/GridCacheVersionMultinodeTest.java    |  65 +-
 .../IgniteCacheEntryListenerAbstractTest.java   | 106 +++
 ...ridCacheQueueJoinedNodeSelfAbstractTest.java |   4 +-
 ...GridCacheQueueMultiNodeAbstractSelfTest.java |   4 +-
 ...dCacheSequenceMultiNodeAbstractSelfTest.java |   4 +-
 .../IgniteDataStructureUniqueNameTest.java      |  41 +
 ...dCachePartitionedQueueEntryMoveSelfTest.java |   2 +-
 .../GridCacheAbstractJobExecutionTest.java      |   8 +-
 .../dht/GridCacheDhtEntrySelfTest.java          |   2 +-
 ...GridCacheDhtEvictionNearReadersSelfTest.java |   4 +-
 .../dht/GridCacheDhtEvictionSelfTest.java       |   2 +-
 .../dht/GridCacheDhtInternalEntrySelfTest.java  |   2 +-
 .../near/GridCacheNearMultiNodeSelfTest.java    |   4 +-
 .../near/GridCacheNearReadersSelfTest.java      |  18 +-
 ...ePartitionedBasicStoreMultiNodeSelfTest.java |  12 +-
 ...titionedExplicitLockNodeFailureSelfTest.java |   4 +-
 ...achePartitionedMultiNodeFullApiSelfTest.java |   2 +-
 ...hePartitionedQueryMultiThreadedSelfTest.java |   2 +-
 .../near/IgniteCacheNearReadCommittedTest.java  |  68 ++
 ...CacheReplicatedPreloadLifecycleSelfTest.java |   2 +-
 .../IgniteCacheExpiryPolicyTestSuite.java       |   3 +
 ...ridCacheContinuousQueryAbstractSelfTest.java |  14 +-
 .../closure/GridClosureProcessorRemoteTest.java |   2 +-
 .../closure/GridClosureProcessorSelfTest.java   |  14 +-
 .../continuous/GridEventConsumeSelfTest.java    |  18 +-
 .../continuous/GridMessageListenSelfTest.java   |  14 +-
 .../processors/igfs/IgfsSizeSelfTest.java       |   7 +-
 .../processors/igfs/IgfsStreamsSelfTest.java    |   2 +-
 .../GridServiceReassignmentSelfTest.java        |   2 +-
 .../marshaller/GridMarshallerAbstractTest.java  |  14 +-
 .../ignite/messaging/GridMessagingSelfTest.java |   3 +-
 .../spi/GridTcpSpiForwardingSelfTest.java       |   4 +-
 .../discovery/AbstractDiscoverySelfTest.java    |   4 +-
 .../tcp/TcpDiscoverySpiStartStopSelfTest.java   |   2 +-
 .../tcp/TcpDiscoverySpiWildcardSelfTest.java    |   2 +-
 .../inmemory/GridTestSwapSpaceSpi.java          |   2 +-
 .../testframework/junits/GridAbstractTest.java  |  10 +-
 .../junits/common/GridCommonAbstractTest.java   |  11 +-
 .../junits/spi/GridSpiAbstractTest.java         |   2 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   3 +
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +-
 .../IgfsHadoop20FileSystemAbstractSelfTest.java |   2 +-
 ...idHadoopDefaultMapReducePlannerSelfTest.java | 227 +----
 .../GridCacheAbstractFieldsQuerySelfTest.java   |   7 +-
 .../cache/GridCacheQueryLoadSelfTest.java       |  30 +-
 .../cache/GridCacheQueryMetricsSelfTest.java    |   4 +-
 .../near/GridCachePartitionedQuerySelfTest.java |   4 +-
 .../GridCacheReplicatedFieldsQuerySelfTest.java |   2 +-
 .../tcp/GridOrderedMessageCancelSelfTest.java   |   4 +-
 .../apache/ignite/cache/spring/SpringCache.java |   2 +-
 .../resource/GridServiceInjectionSelfTest.java  |   4 +-
 .../visor/commands/ack/VisorAckCommand.scala    |   4 +-
 .../commands/alert/VisorAlertCommand.scala      |  11 +-
 .../commands/cache/VisorCacheClearCommand.scala |   4 +-
 .../commands/cache/VisorCacheCommand.scala      |   9 +-
 .../cache/VisorCacheCompactCommand.scala        |   4 +-
 .../commands/cache/VisorCacheScanCommand.scala  |   4 +-
 .../commands/cache/VisorCacheSwapCommand.scala  |   4 +-
 .../config/VisorConfigurationCommand.scala      |   6 +-
 .../commands/disco/VisorDiscoveryCommand.scala  |   6 +-
 .../commands/events/VisorEventsCommand.scala    |  18 +-
 .../visor/commands/gc/VisorGcCommand.scala      |   4 +-
 .../visor/commands/kill/VisorKillCommand.scala  |  12 +-
 .../visor/commands/node/VisorNodeCommand.scala  |   2 +-
 .../visor/commands/ping/VisorPingCommand.scala  |   4 +-
 .../commands/start/VisorStartCommand.scala      |   4 +-
 .../commands/tasks/VisorTasksCommand.scala      |  12 +-
 .../commands/top/VisorTopologyCommand.scala     |   4 +-
 .../visor/commands/vvm/VisorVvmCommand.scala    |   6 +-
 .../scala/org/apache/ignite/visor/visor.scala   |  32 +-
 pom.xml                                         |  18 +-
 readme.md                                       |   2 -
 238 files changed, 5731 insertions(+), 4566 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bfb09c49/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------


[39/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-239' into sprint-2

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-239' into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/96714719
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96714719
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96714719

Branch: refs/heads/ignite-368
Commit: 96714719d98de537accd7c7c571cfdbbabfa948d
Parents: 11efb91 08df446
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 17:05:34 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 17:05:34 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      |   5 +-
 .../org/apache/ignite/internal/IgnitionEx.java  | 592 +++++++++----------
 .../GridCacheQueueCleanupSelfTest.java          |   1 -
 3 files changed, 267 insertions(+), 331 deletions(-)
----------------------------------------------------------------------



[18/50] incubator-ignite git commit: Merge branch 'sprint-2' into ignite-136

Posted by ak...@apache.org.
Merge branch 'sprint-2' into ignite-136


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/75ba3e44
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/75ba3e44
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/75ba3e44

Branch: refs/heads/ignite-368
Commit: 75ba3e44cd8cb4268a26203f39736ae1db420ae5
Parents: 96e449a 4e57996
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Feb 26 12:14:13 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Feb 26 12:14:13 2015 +0300

----------------------------------------------------------------------
 .../hibernate/example-hibernate-L2-cache.xml    |    2 +-
 .../ComputeFibonacciContinuationExample.java    |   17 +-
 .../IgniteCountDownLatchExample.java            |    3 +-
 .../MessagingPingPongListenActorExample.java    |    3 +-
 .../examples/ScalarContinuationExample.scala    |   20 +-
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |   10 +-
 .../internal/client/ClientStartNodeTask.java    |    5 +-
 .../processors/rest/RestProcessorTest.java      |    8 +-
 .../processors/rest/TestBinaryClient.java       |    1 -
 .../processors/rest/TestMemcacheClient.java     |   13 +-
 .../protocols/tcp/TcpRestParserSelfTest.java    |    2 +-
 .../java/org/apache/ignite/IgniteCache.java     |   69 +
 .../java/org/apache/ignite/IgniteCluster.java   |    3 +-
 .../apache/ignite/IgniteSystemProperties.java   |    5 +
 .../ignite/cache/IgniteEntryProcessor.java      |   28 +
 .../CacheRendezvousAffinityFunction.java        |    1 +
 .../ignite/cluster/ClusterNodeLocalMap.java     |   60 -
 .../ignite/events/DiscoveryCustomEvent.java     |   56 +
 .../org/apache/ignite/events/EventType.java     |   12 +
 .../IgfsByteDelimiterRecordResolver.java        |    1 +
 .../ignite/internal/ClusterMetricsSnapshot.java |    9 +-
 .../internal/GridEventConsumeHandler.java       |    1 +
 .../ignite/internal/GridKernalContext.java      |    8 +
 .../ignite/internal/GridKernalContextImpl.java  |   11 +
 .../internal/GridMessageListenHandler.java      |    1 +
 .../apache/ignite/internal/IgniteKernal.java    |    6 +
 .../cluster/ClusterNodeLocalMapImpl.java        |   27 +-
 .../cluster/IgniteClusterAsyncImpl.java         |    3 +-
 .../internal/cluster/IgniteClusterImpl.java     |    4 +-
 .../igfs/common/IgfsControlResponse.java        |    1 +
 .../internal/igfs/common/IgfsMarshaller.java    |    1 +
 .../internal/managers/GridManagerAdapter.java   |    5 +
 .../discovery/GridDiscoveryManager.java         |   78 +-
 .../affinity/GridAffinityMessage.java           |    1 +
 .../processors/cache/GridCacheEntryInfo.java    |    5 +-
 .../processors/cache/GridCacheSwapManager.java  |    4 +-
 .../processors/cache/GridCacheUtils.java        |    4 +
 .../processors/cache/IgniteCacheProxy.java      |   63 +
 .../query/GridCacheDistributedQueryManager.java |    4 +-
 .../cache/query/GridCacheQueryManager.java      |    2 +-
 .../continuous/CacheContinuousQueryEntry.java   |    1 +
 .../continuous/CacheContinuousQueryHandler.java |    1 +
 .../cache/transactions/IgniteTxEntry.java       |    5 +-
 .../version/GridCacheRawVersionedEntry.java     |    1 +
 .../processors/clock/GridClockMessage.java      |    1 +
 .../dataload/GridDataLoaderProcessor.java       |    2 +-
 .../datastructures/DataStructuresProcessor.java |    2 +-
 .../processors/igfs/IgfsDataManager.java        |    4 +-
 .../internal/processors/igfs/IgfsImpl.java      |    6 +-
 .../processors/igfs/IgfsOutputStreamImpl.java   |    4 +-
 .../internal/processors/igfs/IgfsServer.java    |    1 +
 .../internal/processors/job/GridJobWorker.java  |    2 +-
 .../processors/rest/GridRestResponse.java       |    1 +
 .../message/GridClientAbstractMessage.java      |    1 +
 .../message/GridClientHandshakeRequest.java     |    1 +
 .../cache/GridCacheQueryCommandHandler.java     |    7 +-
 .../protocols/tcp/GridMemcachedMessage.java     |    3 +-
 .../rest/protocols/tcp/GridTcpRestParser.java   |   10 +-
 .../processors/task/GridTaskWorker.java         |    4 +-
 .../internal/util/IgniteExceptionRegistry.java  |  259 ++
 .../ignite/internal/util/IgniteUtils.java       | 2569 ++++++++----------
 .../nio/GridConnectionBytesVerifyFilter.java    |    1 +
 .../util/nio/GridTcpCommunicationClient.java    |    1 +
 .../apache/ignite/internal/util/typedef/X.java  |    3 +-
 .../VisorComputeToggleMonitoringTask.java       |    4 +-
 .../visor/node/VisorNodeDataCollectorJob.java   |    4 +-
 .../node/VisorNodeEventsCollectorTask.java      |    3 +-
 .../visor/query/VisorQueryCleanupTask.java      |    4 +-
 .../visor/query/VisorQueryNextPageTask.java     |    6 +-
 .../internal/visor/query/VisorQueryTask.java    |    4 +-
 .../internal/visor/util/VisorTaskUtils.java     |   45 +-
 .../ignite/lang/IgniteProductVersion.java       |    1 +
 .../optimized/optimized-classnames.properties   |    2 +-
 .../org/apache/ignite/mxbean/IgniteMXBean.java  |    6 +
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   15 +
 .../org/apache/ignite/spi/IgniteSpiContext.java |    8 +
 .../ignite/spi/IgniteSpiThreadFactory.java      |    2 +-
 .../communication/tcp/TcpCommunicationSpi.java  |   54 +-
 .../ignite/spi/discovery/DiscoverySpi.java      |    7 +
 .../spi/discovery/DiscoverySpiListener.java     |   11 +-
 .../discovery/tcp/TcpClientDiscoverySpi.java    |    7 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  136 +-
 .../discovery/tcp/TcpDiscoverySpiAdapter.java   |    3 +
 .../tcp/internal/TcpDiscoveryNode.java          |    1 +
 .../TcpDiscoveryMulticastIpFinder.java          |    1 +
 .../messages/TcpDiscoveryAuthFailedMessage.java |    1 +
 .../TcpDiscoveryCustomEventMessage.java         |   66 +
 .../messages/TcpDiscoveryHeartbeatMessage.java  |    1 +
 .../spi/swapspace/file/FileSwapSpaceSpi.java    |    2 +-
 .../internal/GridDiscoveryEventSelfTest.java    |   43 +
 .../internal/GridEventStorageSelfTest.java      |    3 +-
 .../GridJobMasterLeaveAwareSelfTest.java        |   24 +-
 .../internal/GridMultipleJobsSelfTest.java      |    2 +-
 .../ignite/internal/GridNodeLocalSelfTest.java  |    4 +-
 .../GridTaskContinuousMapperSelfTest.java       |    3 +-
 .../GridTaskExecutionContextSelfTest.java       |    2 +-
 .../GridCheckpointManagerAbstractSelfTest.java  |   20 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |  101 +-
 .../GridCacheConcurrentTxMultiNodeTest.java     |   13 +-
 .../cache/GridCachePutAllFailoverSelfTest.java  |    5 +-
 .../cache/IgniteTxMultiNodeAbstractTest.java    |   33 +-
 ...cheAtomicReferenceMultiNodeAbstractTest.java |   12 +-
 .../GridCacheMultiNodeDataStructureTest.java    |    3 +-
 ...dCacheSequenceMultiNodeAbstractSelfTest.java |    2 +-
 ...titionedAtomicSequenceMultiThreadedTest.java |   16 +-
 ...dCachePartitionedQueueEntryMoveSelfTest.java |    2 +-
 .../GridCacheAbstractJobExecutionTest.java      |    2 +-
 .../distributed/GridCacheEventAbstractTest.java |    4 +-
 .../dht/GridCacheDhtInternalEntrySelfTest.java  |    6 +-
 .../dht/GridCacheDhtMultiBackupTest.java        |    2 +-
 ...idCachePartitionedHitsAndMissesSelfTest.java |    3 +-
 ...ePartitionedMultiThreadedPutGetSelfTest.java |    2 +-
 .../GridCacheRandomEvictionPolicySelfTest.java  |    2 +-
 .../IgniteCacheLoaderWriterAbstractTest.java    |   47 +
 .../closure/GridClosureProcessorSelfTest.java   |   14 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |    5 +-
 .../igfs/IgfsDataManagerSelfTest.java           |    1 +
 .../processors/igfs/IgfsProcessorSelfTest.java  |    3 +-
 .../streamer/GridStreamerEvictionSelfTest.java  |    2 +-
 .../streamer/GridStreamerSelfTest.java          |    2 +-
 .../util/IgniteExceptionRegistrySelfTest.java   |   89 +
 .../internal/util/IgniteUtilsSelfTest.java      |    6 +-
 .../internal/util/nio/GridRoundTripTest.java    |    1 +
 .../offheap/GridOffHeapMapAbstractSelfTest.java |    1 +
 .../cache/GridCacheDataStructuresLoadTest.java  |   36 +-
 .../loadtests/cache/GridCacheLoadTest.java      |    6 +-
 .../loadtests/cache/GridCacheSwapLoadTest.java  |    5 +-
 .../loadtests/colocation/GridTestMain.java      |    3 +-
 .../communication/GridIoManagerBenchmark.java   |    3 +-
 .../GridMultiSplitsRedeployLoadTest.java        |    5 +-
 .../loadtests/discovery/GridGcTimeoutTest.java  |    3 +-
 .../ignite/loadtests/dsi/GridDsiPerfJob.java    |   16 +-
 .../job/GridJobExecutionSingleNodeLoadTest.java |    2 +-
 .../mapper/GridContinuousMapperLoadTest1.java   |    3 +-
 .../loadtests/mapper/GridNodeStartup.java       |    3 +-
 .../mergesort/GridMergeSortLoadTest.java        |    3 +-
 .../streamer/GridStreamerIndexLoadTest.java     |    4 +-
 .../swap/GridSwapEvictAllBenchmark.java         |    3 +-
 .../marshaller/GridMarshallerAbstractTest.java  |    6 +-
 ...idSessionFutureWaitJobAttributeSelfTest.java |    3 +-
 .../GridSessionSetTaskAttributeSelfTest.java    |    3 +-
 ...GridSessionTaskWaitJobAttributeSelfTest.java |    3 +-
 .../discovery/AbstractDiscoverySelfTest.java    |    7 +-
 .../roundrobin/GridRoundRobinTestUtils.java     |    6 +-
 .../file/GridFileSwapSpaceSpiSelfTest.java      |    1 +
 .../index/GridStreamerIndexSelfTest.java        |   17 +-
 .../window/GridStreamerWindowSelfTest.java      |    3 +-
 .../testframework/GridSpiTestContext.java       |    6 +
 .../junits/GridTestKernalContext.java           |    2 +
 .../cache/GridAbstractCacheStoreSelfTest.java   |    3 +-
 .../testsuites/IgniteUtilSelfTestSuite.java     |    1 +
 .../tests/p2p/GridP2PAwareTestUserResource.java |    5 +-
 .../tests/p2p/GridTestMessageListener.java      |    4 +-
 modules/hadoop/pom.xml                          |   10 -
 .../internal/igfs/hadoop/IgfsHadoopWrapper.java |    2 +-
 .../processors/hadoop/GridHadoopSetup.java      |    3 +-
 .../GridHadoopDefaultMapReducePlanner.java      |    3 +-
 .../shuffle/GridHadoopShuffleMessage.java       |    1 +
 .../taskexecutor/GridHadoopExecutorService.java |    2 +-
 .../hadoop/v2/GridHadoopSplitWrapper.java       |    3 +-
 .../hadoop/GridHadoopGroupingTest.java          |   10 +-
 .../hadoop/GridHadoopJobTrackerSelfTest.java    |    2 +-
 .../hadoop/GridHadoopSortingTest.java           |    9 +-
 .../processors/hadoop/GridHadoopStartup.java    |    2 +-
 .../ignite/loadtests/igfs/IgfsNodeStartup.java  |    3 +-
 ...idHibernateAbstractRegionAccessStrategy.java |   97 -
 .../GridHibernateAccessStrategyAdapter.java     |  369 ---
 .../GridHibernateCollectionRegion.java          |   99 -
 .../hibernate/GridHibernateEntityRegion.java    |  110 -
 .../GridHibernateGeneralDataRegion.java         |   69 -
 .../hibernate/GridHibernateNaturalIdRegion.java |   98 -
 .../GridHibernateNonStrictAccessStrategy.java   |  220 --
 .../GridHibernateQueryResultsRegion.java        |   71 -
 .../GridHibernateReadOnlyAccessStrategy.java    |  106 -
 .../GridHibernateReadWriteAccessStrategy.java   |  282 --
 .../cache/hibernate/GridHibernateRegion.java    |  101 -
 .../hibernate/GridHibernateRegionFactory.java   |  231 --
 .../GridHibernateTimestampsRegion.java          |   40 -
 ...ridHibernateTransactionalAccessStrategy.java |  139 -
 .../GridHibernateTransactionalDataRegion.java   |   96 -
 .../HibernateAbstractRegionAccessStrategy.java  |   97 +
 .../HibernateAccessStrategyAdapter.java         |  369 +++
 .../hibernate/HibernateCollectionRegion.java    |   99 +
 .../cache/hibernate/HibernateEntityRegion.java  |  110 +
 .../hibernate/HibernateGeneralDataRegion.java   |   69 +
 .../hibernate/HibernateNaturalIdRegion.java     |   98 +
 .../HibernateNonStrictAccessStrategy.java       |  220 ++
 .../hibernate/HibernateQueryResultsRegion.java  |   71 +
 .../HibernateReadOnlyAccessStrategy.java        |  106 +
 .../HibernateReadWriteAccessStrategy.java       |  282 ++
 .../ignite/cache/hibernate/HibernateRegion.java |  101 +
 .../cache/hibernate/HibernateRegionFactory.java |  231 ++
 .../hibernate/HibernateTimestampsRegion.java    |   40 +
 .../HibernateTransactionalAccessStrategy.java   |  139 +
 .../HibernateTransactionalDataRegion.java       |   96 +
 .../apache/ignite/cache/hibernate/package.html  |    2 +-
 ...idHibernateL2CacheConfigurationSelfTest.java |  393 ---
 .../hibernate/GridHibernateL2CacheSelfTest.java | 1923 -------------
 ...idHibernateL2CacheTransactionalSelfTest.java |  135 -
 .../HibernateL2CacheConfigurationSelfTest.java  |  393 +++
 .../hibernate/HibernateL2CacheSelfTest.java     | 1925 +++++++++++++
 .../HibernateL2CacheTransactionalSelfTest.java  |  135 +
 .../testsuites/IgniteHibernateTestSuite.java    |    6 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |    2 +-
 .../GridCacheCrossCacheQuerySelfTestNewApi.java |    2 +-
 .../http/jetty/GridJettyRestHandler.java        |    1 +
 .../p2p/GridP2PUserVersionChangeSelfTest.java   |    4 +-
 ...gniteProjectionStartStopRestartSelfTest.java |    3 +-
 208 files changed, 7199 insertions(+), 6517 deletions(-)
----------------------------------------------------------------------



[16/50] incubator-ignite git commit: # ignite-270 Fixed scaladoc link.

Posted by ak...@apache.org.
# ignite-270 Fixed scaladoc link.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/18548b25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/18548b25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/18548b25

Branch: refs/heads/ignite-368
Commit: 18548b256510938e597a6ecd69be3f0d01a6bb6e
Parents: 12ee896
Author: anovikov <an...@gridgain.com>
Authored: Wed Feb 25 22:18:30 2015 +0700
Committer: anovikov <an...@gridgain.com>
Committed: Wed Feb 25 22:18:30 2015 +0700

----------------------------------------------------------------------
 modules/scalar/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/18548b25/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index c38085c..ff98212 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -166,6 +166,12 @@
                                     <include name="**/index.js"/>
                                 </replace>
 
+                                <replace dir="target/site/scaladocs">
+                                    <replacetoken>docs.scala-lang.org/overviews/scaladoc/usage.html#members</replacetoken>
+                                    <replacevalue>docs.scala-lang.org/overviews/scaladoc/interface.html</replacevalue>
+                                    <fileset dir="target/site/scaladocs"/>
+                                </replace>
+
                                 <replaceregexp byline="true" flags="im" encoding="UTF-8">
                                     <regexp pattern='(&lt;dt&gt;Attributes&lt;/dt&gt;&lt;dd&gt;protected\[)&lt;a.+&gt;(.+)&lt;/a&gt;(\]\s+&lt;/dd&gt;)'/>
                                     <substitution expression="\1\2\3"/>


[36/50] incubator-ignite git commit: #ignite-239: review.

Posted by ak...@apache.org.
#ignite-239: 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/08df446b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/08df446b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/08df446b

Branch: refs/heads/ignite-368
Commit: 08df446b39f28b7a4b670650f0e39797c0cfa5c5
Parents: 0b1eccf
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 12:15:13 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 12:15:13 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/internal/IgnitionEx.java  | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/08df446b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index c2c23f7..cb2efbf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1494,6 +1494,8 @@ public class IgnitionEx {
 
             UUID nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
 
+            myCfg.setNodeId(nodeId);
+
             IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
 
             assert cfgLog != null;
@@ -1563,10 +1565,8 @@ public class IgnitionEx {
                 }
             }
 
-            if (myCfg.getUserAttributes() == null) {
-                Map<String, ?> emptyAttr = Collections.emptyMap();
-                myCfg.setUserAttributes(emptyAttr);
-            }
+            if (myCfg.getUserAttributes() == null)
+                myCfg.setUserAttributes(Collections.<String, Object>emptyMap());
 
             if (myCfg.getMBeanServer() == null)
                 myCfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
@@ -1606,8 +1606,6 @@ public class IgnitionEx {
             if (myCfg.getPeerClassLoadingLocalClassPathExclude() == null)
                 myCfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);
 
-            myCfg.setNodeId(nodeId);
-
             IgfsConfiguration[] igfsCfgs = myCfg.getIgfsConfiguration();
 
             if (igfsCfgs != null) {


[45/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/sprint-2' into sprint-2

Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/sprint-2' into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/028e4463
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/028e4463
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/028e4463

Branch: refs/heads/ignite-368
Commit: 028e44637fe9ff3fe3347d685f7d52422ff1cb0d
Parents: 2511ebe 235758c
Author: anovikov <an...@gridgain.com>
Authored: Mon Mar 2 21:44:49 2015 +0700
Committer: anovikov <an...@gridgain.com>
Committed: Mon Mar 2 21:44:49 2015 +0700

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/ignite/IgniteCluster.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[21/50] incubator-ignite git commit: #ignite-239: remove some IgniteConfiguration set methods from IgnitionEx.start().

Posted by ak...@apache.org.
#ignite-239: remove some IgniteConfiguration set methods from IgnitionEx.start().


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7aec19e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7aec19e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7aec19e5

Branch: refs/heads/ignite-368
Commit: 7aec19e583690bc14e5c9235b54ed0d7ca6959f0
Parents: e13b3b1
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 14:47:11 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 14:47:11 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      | 160 ++++++++++++++--
 .../org/apache/ignite/internal/IgnitionEx.java  | 192 ++-----------------
 2 files changed, 160 insertions(+), 192 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7aec19e5/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index d44b057..037b7c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -26,7 +26,19 @@ import org.apache.ignite.lang.*;
 import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.marshaller.*;
 import org.apache.ignite.plugin.*;
+import org.apache.ignite.spi.checkpoint.noop.*;
+import org.apache.ignite.spi.collision.noop.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.deployment.local.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*;
+import org.apache.ignite.spi.eventstorage.memory.*;
+import org.apache.ignite.spi.failover.always.*;
 import org.apache.ignite.spi.indexing.*;
+import org.apache.ignite.spi.indexing.noop.*;
+import org.apache.ignite.spi.loadbalancing.roundrobin.*;
+import org.apache.ignite.spi.swapspace.file.*;
+import org.apache.ignite.spi.swapspace.noop.*;
 import org.apache.ignite.streamer.*;
 import org.apache.ignite.plugin.segmentation.*;
 import org.apache.ignite.services.*;
@@ -371,6 +383,9 @@ public class IgniteConfiguration {
     /** User's class loader. */
     private ClassLoader classLdr;
 
+    /** */
+    private static final String[] EMPTY_STR_ARR = new String[0];
+
     /**
      * Creates valid grid configuration with all default values.
      */
@@ -388,76 +403,189 @@ public class IgniteConfiguration {
         assert cfg != null;
 
         // SPIs.
-        discoSpi = cfg.getDiscoverySpi();
-        commSpi = cfg.getCommunicationSpi();
-        deploySpi = cfg.getDeploymentSpi();
-        evtSpi = cfg.getEventStorageSpi();
-        cpSpi = cfg.getCheckpointSpi();
-        colSpi = cfg.getCollisionSpi();
-        failSpi = cfg.getFailoverSpi();
-        loadBalancingSpi = cfg.getLoadBalancingSpi();
+        discoSpi = cfg.getDiscoverySpi() != null ? cfg.getDiscoverySpi() : new TcpDiscoverySpi();
+
+        if (discoSpi instanceof TcpDiscoverySpi) {
+            TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
+
+            if (tcpDisco.getIpFinder() == null)
+                tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
+        }
+
+        commSpi = cfg.getCommunicationSpi() != null ? cfg.getCommunicationSpi() : new TcpCommunicationSpi();
+
+        deploySpi = cfg.getDeploymentSpi() != null ? cfg.getDeploymentSpi() : new LocalDeploymentSpi();
+
+        evtSpi = cfg.getEventStorageSpi() != null ? cfg.getEventStorageSpi() : new MemoryEventStorageSpi();
+
+        cpSpi = cfg.getCheckpointSpi() != null ? cfg.getCheckpointSpi() : new CheckpointSpi[] {new NoopCheckpointSpi()};
+
+        colSpi = cfg.getCollisionSpi() != null ? cfg.getCollisionSpi() : new NoopCollisionSpi();
+
+        failSpi = cfg.getFailoverSpi() != null ? cfg.getFailoverSpi() : new FailoverSpi[] {new AlwaysFailoverSpi()};
+
+        loadBalancingSpi = cfg.getLoadBalancingSpi() != null ? cfg.getLoadBalancingSpi() :
+            new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
+
+        indexingSpi = cfg.getIndexingSpi() != null ? cfg.getIndexingSpi() :  new NoopIndexingSpi();
+
         swapSpaceSpi = cfg.getSwapSpaceSpi();
-        indexingSpi = cfg.getIndexingSpi();
+
+        if (swapSpaceSpi == null) {
+            boolean needSwap = false;
+
+            CacheConfiguration[] caches = cfg.getCacheConfiguration();
+
+            if (caches != null) {
+                for (CacheConfiguration c : caches) {
+                    if (c.isSwapEnabled()) {
+                        needSwap = true;
+
+                        break;
+                    }
+                }
+            }
+
+            swapSpaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
+        }
 
         /*
          * Order alphabetically for maintenance purposes.
          */
         addrRslvr = cfg.getAddressResolver();
+
         allResolversPassReq = cfg.isAllSegmentationResolversPassRequired();
+
         atomicCfg = cfg.getAtomicConfiguration();
+
         daemon = cfg.isDaemon();
+
         cacheCfg = cfg.getCacheConfiguration();
+
         cacheSanityCheckEnabled = cfg.isCacheSanityCheckEnabled();
-        connectorCfg = cfg.getConnectorConfiguration();
+
+        connectorCfg = cfg.getConnectorConfiguration() != null ?
+            new ConnectorConfiguration(cfg.getConnectorConfiguration()) : null;
+
         classLdr = cfg.getClassLoader();
+
         clockSyncFreq = cfg.getClockSyncFrequency();
+
         clockSyncSamples = cfg.getClockSyncSamples();
+
         deployMode = cfg.getDeploymentMode();
+
         discoStartupDelay = cfg.getDiscoveryStartupDelay();
+
         pubPoolSize = cfg.getPublicThreadPoolSize();
+
         ggHome = cfg.getIgniteHome();
+
         ggWork = cfg.getWorkDirectory();
+
         gridName = cfg.getGridName();
-        igfsCfg = cfg.getIgfsConfiguration();
+
+        IgfsConfiguration[] igfsCfgs = cfg.getIgfsConfiguration();
+
+        if (igfsCfgs != null) {
+            IgfsConfiguration[] clone = igfsCfgs.clone();
+
+            for (int i = 0; i < igfsCfgs.length; i++)
+                clone[i] = new IgfsConfiguration(igfsCfgs[i]);
+
+            igfsCfg = clone;
+        }
+
         igfsPoolSize = cfg.getIgfsThreadPoolSize();
+
         hadoopCfg = cfg.getHadoopConfiguration();
+
         inclEvtTypes = cfg.getIncludeEventTypes();
+
         includeProps = cfg.getIncludeProperties();
+
         lifecycleBeans = cfg.getLifecycleBeans();
+
         locHost = cfg.getLocalHost();
+
         log = cfg.getGridLogger();
+
         lsnrs = cfg.getLocalEventListeners();
+
         marsh = cfg.getMarshaller();
+
         marshLocJobs = cfg.isMarshalLocalJobs();
-        mbeanSrv = cfg.getMBeanServer();
+
+        mbeanSrv = cfg.getMBeanServer() != null ? cfg.getMBeanServer() : ManagementFactory.getPlatformMBeanServer();
+
         metricsHistSize = cfg.getMetricsHistorySize();
+
         metricsExpTime = cfg.getMetricsExpireTime();
+
         metricsLogFreq = cfg.getMetricsLogFrequency();
+
         metricsUpdateFreq = cfg.getMetricsUpdateFrequency();
+
         mgmtPoolSize = cfg.getManagementThreadPoolSize();
+
         netTimeout = cfg.getNetworkTimeout();
-        nodeId = cfg.getNodeId();
+
+        nodeId = cfg.getNodeId() != null ? cfg.getNodeId() : UUID.randomUUID();
+
         p2pEnabled = cfg.isPeerClassLoadingEnabled();
-        p2pLocClsPathExcl = cfg.getPeerClassLoadingLocalClassPathExclude();
+
+        p2pLocClsPathExcl = cfg.getPeerClassLoadingLocalClassPathExclude() != null ?
+            cfg.getPeerClassLoadingLocalClassPathExclude() : EMPTY_STR_ARR;
+
         p2pMissedCacheSize = cfg.getPeerClassLoadingMissedResourcesCacheSize();
+
         p2pPoolSize = cfg.getPeerClassLoadingThreadPoolSize();
+
         pluginCfgs = cfg.getPluginConfigurations();
+
         qryCfg = cfg.getQueryConfiguration();
+
         segChkFreq = cfg.getSegmentCheckFrequency();
+
         segPlc = cfg.getSegmentationPolicy();
+
         segResolveAttempts = cfg.getSegmentationResolveAttempts();
+
         segResolvers = cfg.getSegmentationResolvers();
+
         sndRetryCnt = cfg.getNetworkSendRetryCount();
+
         sndRetryDelay = cfg.getNetworkSendRetryDelay();
-        streamerCfg = cfg.getStreamerConfiguration();
+
+        StreamerConfiguration[] streamerCfgs = cfg.getStreamerConfiguration();
+
+        if (streamerCfgs != null) {
+            StreamerConfiguration[] clone = streamerCfgs.clone();
+
+            for (int i = 0; i < streamerCfgs.length; i++)
+                clone[i] = new StreamerConfiguration(streamerCfgs[i]);
+
+            streamerCfg = clone;
+        }
+
         svcCfgs = cfg.getServiceConfiguration();
+
         sysPoolSize = cfg.getSystemThreadPoolSize();
+
         timeSrvPortBase = cfg.getTimeServerPortBase();
+
         timeSrvPortRange = cfg.getTimeServerPortRange();
+
         txCfg = cfg.getTransactionConfiguration() != null ?
             new TransactionConfiguration(cfg.getTransactionConfiguration()) : null;
-        userAttrs = cfg.getUserAttributes();
+
+        if (cfg.getUserAttributes() == null)
+            userAttrs = Collections.emptyMap();
+        else
+            userAttrs = cfg.getUserAttributes();
+
         waitForSegOnStart = cfg.isWaitForSegmentOnStart();
+
         warmupClos = cfg.getWarmupClosure();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7aec19e5/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 7249e4e..01c0cec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -34,36 +34,13 @@ import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.mxbean.*;
 import org.apache.ignite.plugin.segmentation.*;
 import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.checkpoint.*;
-import org.apache.ignite.spi.checkpoint.noop.*;
-import org.apache.ignite.spi.collision.*;
-import org.apache.ignite.spi.collision.noop.*;
-import org.apache.ignite.spi.communication.*;
-import org.apache.ignite.spi.communication.tcp.*;
-import org.apache.ignite.spi.deployment.*;
-import org.apache.ignite.spi.deployment.local.*;
-import org.apache.ignite.spi.discovery.*;
 import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*;
-import org.apache.ignite.spi.eventstorage.*;
-import org.apache.ignite.spi.eventstorage.memory.*;
-import org.apache.ignite.spi.failover.*;
-import org.apache.ignite.spi.failover.always.*;
-import org.apache.ignite.spi.indexing.*;
-import org.apache.ignite.spi.indexing.noop.*;
-import org.apache.ignite.spi.loadbalancing.*;
-import org.apache.ignite.spi.loadbalancing.roundrobin.*;
-import org.apache.ignite.spi.swapspace.*;
-import org.apache.ignite.spi.swapspace.file.*;
-import org.apache.ignite.spi.swapspace.noop.*;
-import org.apache.ignite.streamer.*;
 import org.apache.ignite.thread.*;
 import org.jdk8.backport.*;
 import org.jetbrains.annotations.*;
 
 import javax.management.*;
 import java.io.*;
-import java.lang.management.*;
 import java.lang.reflect.*;
 import java.net.*;
 import java.util.*;
@@ -1142,9 +1119,6 @@ public class IgnitionEx {
         private static final Map<MBeanServer, GridMBeanServerData> mbeans =
             new HashMap<>();
 
-        /** */
-        private static final String[] EMPTY_STR_ARR = new String[0];
-
         /** Grid name. */
         private final String name;
 
@@ -1326,18 +1300,11 @@ public class IgnitionEx {
 
             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
 
-            UUID nodeId = cfg.getNodeId();
-
-            if (nodeId == null)
-                nodeId = UUID.randomUUID();
-
-            myCfg.setNodeId(nodeId);
-
-            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
+            IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), myCfg.getNodeId());
 
             assert cfgLog != null;
 
-            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(nodeId));
+            cfgLog = new GridLoggerProxy(cfgLog, null, name, U.id8(myCfg.getNodeId()));
 
             // Initialize factory's log.
             log = cfgLog.getLogger(G.class);
@@ -1386,24 +1353,16 @@ public class IgnitionEx {
                 }
             }
 
-            ConnectorConfiguration clientCfg = cfg.getConnectorConfiguration();
-
-            if (clientCfg != null)
-                clientCfg = new ConnectorConfiguration(clientCfg);
-
-            if (clientCfg != null) {
+            if (myCfg.getConnectorConfiguration() != null) {
                 restExecSvc = new IgniteThreadPoolExecutor(
                     "rest-" + cfg.getGridName(),
-                    clientCfg.getThreadPoolSize(),
-                    clientCfg.getThreadPoolSize(),
+                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
+                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
                     ConnectorConfiguration.DFLT_KEEP_ALIVE_TIME,
                     new LinkedBlockingQueue<Runnable>(ConnectorConfiguration.DFLT_THREADPOOL_QUEUE_CAP)
                 );
             }
 
-            // REST configuration.
-            myCfg.setConnectorConfiguration(clientCfg);
-
             Marshaller marsh = cfg.getMarshaller();
 
             if (marsh == null) {
@@ -1436,46 +1395,6 @@ public class IgnitionEx {
 
             myCfg.setMarshaller(marsh);
 
-            Map<String, ?> attrs = cfg.getUserAttributes();
-
-            if (attrs == null)
-                attrs = Collections.emptyMap();
-
-            myCfg.setUserAttributes(attrs);
-
-            MBeanServer mbSrv = cfg.getMBeanServer();
-
-            myCfg.setMBeanServer(mbSrv == null ? ManagementFactory.getPlatformMBeanServer() : mbSrv);
-
-            IgfsConfiguration[] igfsCfgs = cfg.getIgfsConfiguration();
-
-            if (igfsCfgs != null) {
-                IgfsConfiguration[] clone = igfsCfgs.clone();
-
-                for (int i = 0; i < igfsCfgs.length; i++)
-                    clone[i] = new IgfsConfiguration(igfsCfgs[i]);
-
-                myCfg.setIgfsConfiguration(clone);
-            }
-
-            StreamerConfiguration[] streamerCfgs = cfg.getStreamerConfiguration();
-
-            if (streamerCfgs != null) {
-                StreamerConfiguration[] clone = streamerCfgs.clone();
-
-                for (int i = 0; i < streamerCfgs.length; i++)
-                    clone[i] = new StreamerConfiguration(streamerCfgs[i]);
-
-                myCfg.setStreamerConfiguration(clone);
-            }
-
-            String[] p2pExclude = cfg.getPeerClassLoadingLocalClassPathExclude();
-
-            if (p2pExclude == null)
-                p2pExclude = EMPTY_STR_ARR;
-
-            myCfg.setPeerClassLoadingLocalClassPathExclude(p2pExclude);
-
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1486,94 +1405,17 @@ public class IgnitionEx {
                     "on start?) [segPlc=" + segPlc + ", wait=false]");
             }
 
-            /*
-             * Initialize default SPI implementations.
-             */
-            CommunicationSpi commSpi = cfg.getCommunicationSpi();
-            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
-            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
-            CollisionSpi colSpi = cfg.getCollisionSpi();
-            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
-            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
-            FailoverSpi[] failSpi = cfg.getFailoverSpi();
-            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
-            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
-            IndexingSpi indexingSpi = cfg.getIndexingSpi();
-
-            if (commSpi == null)
-                commSpi = new TcpCommunicationSpi();
-
-            if (discoSpi == null)
-                discoSpi = new TcpDiscoverySpi();
-
-            if (discoSpi instanceof TcpDiscoverySpi) {
-                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
-
-                if (tcpDisco.getIpFinder() == null)
-                    tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
-            }
-
-            if (evtSpi == null)
-                evtSpi = new MemoryEventStorageSpi();
-
-            if (colSpi == null)
-                colSpi = new NoopCollisionSpi();
-
-            if (deploySpi == null)
-                deploySpi = new LocalDeploymentSpi();
-
-            if (cpSpi == null)
-                cpSpi = new CheckpointSpi[] {new NoopCheckpointSpi()};
-
-            if (failSpi == null)
-                failSpi = new FailoverSpi[] {new AlwaysFailoverSpi()};
-
-            if (loadBalancingSpi == null)
-                loadBalancingSpi = new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
-
-            if (swapspaceSpi == null) {
-                boolean needSwap = false;
-
-                CacheConfiguration[] caches = cfg.getCacheConfiguration();
-
-                if (caches != null) {
-                    for (CacheConfiguration c : caches) {
-                        if (c.isSwapEnabled()) {
-                            needSwap = true;
-
-                            break;
-                        }
-                    }
-                }
-
-                swapspaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
-            }
-
-            if (indexingSpi == null)
-                indexingSpi = new NoopIndexingSpi();
-
-            myCfg.setCommunicationSpi(commSpi);
-            myCfg.setDiscoverySpi(discoSpi);
-            myCfg.setCheckpointSpi(cpSpi);
-            myCfg.setEventStorageSpi(evtSpi);
-            myCfg.setDeploymentSpi(deploySpi);
-            myCfg.setFailoverSpi(failSpi);
-            myCfg.setCollisionSpi(colSpi);
-            myCfg.setLoadBalancingSpi(loadBalancingSpi);
-            myCfg.setSwapSpaceSpi(swapspaceSpi);
-            myCfg.setIndexingSpi(indexingSpi);
-
             // Ensure that SPIs support multiple grid instances, if required.
             if (!startCtx.single()) {
-                ensureMultiInstanceSupport(deploySpi);
-                ensureMultiInstanceSupport(commSpi);
-                ensureMultiInstanceSupport(discoSpi);
-                ensureMultiInstanceSupport(cpSpi);
-                ensureMultiInstanceSupport(evtSpi);
-                ensureMultiInstanceSupport(colSpi);
-                ensureMultiInstanceSupport(failSpi);
-                ensureMultiInstanceSupport(loadBalancingSpi);
-                ensureMultiInstanceSupport(swapspaceSpi);
+                ensureMultiInstanceSupport(myCfg.getDeploymentSpi());
+                ensureMultiInstanceSupport(myCfg.getCommunicationSpi());
+                ensureMultiInstanceSupport(myCfg.getDiscoverySpi());
+                ensureMultiInstanceSupport(myCfg.getCheckpointSpi());
+                ensureMultiInstanceSupport(myCfg.getEventStorageSpi());
+                ensureMultiInstanceSupport(myCfg.getCollisionSpi());
+                ensureMultiInstanceSupport(myCfg.getFailoverSpi());
+                ensureMultiInstanceSupport(myCfg.getLoadBalancingSpi());
+                ensureMultiInstanceSupport(myCfg.getSwapSpaceSpi());
             }
 
             CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();
@@ -1582,12 +1424,12 @@ public class IgnitionEx {
 
             final boolean hasAtomics = cfg.getAtomicConfiguration() != null;
 
-            final boolean clientDisco = discoSpi instanceof TcpClientDiscoverySpi;
+            final boolean clientDisco = myCfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi;
 
             CacheConfiguration[] copies;
 
             if (cacheCfgs != null && cacheCfgs.length > 0) {
-                if (!U.discoOrdered(discoSpi) && !U.relaxDiscoveryOrdered())
+                if (!U.discoOrdered(myCfg.getDiscoverySpi()) && !U.relaxDiscoveryOrdered())
                     throw new IgniteCheckedException("Discovery SPI implementation does not support node ordering and " +
                         "cannot be used with cache (use SPI with @GridDiscoverySpiOrderSupport annotation, " +
                         "like GridTcpDiscoverySpi)");
@@ -1652,8 +1494,6 @@ public class IgnitionEx {
 
             myCfg.setCacheConfiguration(copies);
 
-            myCfg.setCacheSanityCheckEnabled(cfg.isCacheSanityCheckEnabled());
-
             try {
                 // Use reflection to avoid loading undesired classes.
                 Class helperCls = Class.forName("org.apache.ignite.util.GridConfigurationHelper");


[19/50] incubator-ignite git commit: IGNITE-136 Fixed review notes.

Posted by ak...@apache.org.
IGNITE-136 Fixed review notes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3a466e8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3a466e8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3a466e8c

Branch: refs/heads/ignite-368
Commit: 3a466e8cbdbde90bbc4debb5f9b998621e2804e7
Parents: 75ba3e4
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Feb 26 13:03:07 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Feb 26 13:03:07 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/distributed/dht/GridDhtCacheEntry.java     | 3 +++
 .../processors/cache/distributed/dht/GridDhtLocalPartition.java | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a466e8c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index cf4f5df..c331b99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -563,6 +563,9 @@ public class GridDhtCacheEntry<K, V> extends GridDistributedCacheEntry<K, V> {
                         log.debug("Entry has been cleared from swap storage: " + this);
                 }
 
+                if (cctx.store().isLocalStore())
+                    cctx.store().removeFromStore(null, key());
+
                 rmv = true;
 
                 return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a466e8c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index e3efade..29f7363 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -536,8 +536,6 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
 
         boolean rec = cctx.events().isRecordable(EVT_CACHE_PRELOAD_OBJECT_UNLOADED);
 
-        boolean isLocStore = cctx.store().isLocalStore();
-
         for (Iterator<GridDhtCacheEntry<K, V>> it = map.values().iterator(); it.hasNext();) {
             GridDhtCacheEntry<K, V> cached = it.next();
 
@@ -545,9 +543,6 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
                 if (cached.clearInternal(clearVer, swap)) {
                     it.remove();
 
-                    if (isLocStore)
-                        cctx.store().removeFromStore(null, cached.key());
-
                     if (!cached.isInternal()) {
                         mapPubSize.decrement();
 


[42/50] incubator-ignite git commit: ignite-352 review

Posted by ak...@apache.org.
ignite-352 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/b0e6ab17
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b0e6ab17
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b0e6ab17

Branch: refs/heads/ignite-368
Commit: b0e6ab17c284850190012e7c120a95c34316b982
Parents: 403d60f
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Mar 2 17:28:39 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Mar 2 17:28:39 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheMetricsImpl.java      |  4 ++
 .../dht/atomic/GridDhtAtomicCache.java          |  2 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  2 +-
 .../cache/transactions/IgniteTxManager.java     |  7 +++-
 .../cache/GridCacheAbstractMetricsSelfTest.java | 42 ++++++++++++++++++++
 5 files changed, 53 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0e6ab17/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
index 0de039b..446070e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
@@ -460,6 +460,8 @@ public class CacheMetricsImpl implements CacheMetrics {
 
     /**
      * Transaction commit callback.
+     *
+     * @param duration the time taken in nanoseconds.
      */
     public void onTxCommit(long duration) {
         txCommits.incrementAndGet();
@@ -472,6 +474,8 @@ public class CacheMetricsImpl implements CacheMetrics {
 
     /**
      * Transaction rollback callback.
+     *
+     * @param duration the time taken in nanoseconds.
      */
     public void onTxRollback(long duration) {
         txRollbacks.incrementAndGet();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0e6ab17/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 9f9af31..add51bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -990,7 +990,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
 
                 if (!success)
                     break;
-                else if (!skipVals)
+                else if (!skipVals && ctx.config().isStatisticsEnabled())
                     metrics0().onRead(true);
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0e6ab17/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index a59b6aa..cdb1759 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -318,7 +318,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
 
                 if (!success)
                     break;
-                else if (!skipVals)
+                else if (!skipVals && ctx.config().isStatisticsEnabled())
                     ctx.cache().metrics0().onRead(true);
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0e6ab17/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 cf32dcc..af57ce4 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
@@ -1243,7 +1243,8 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V> {
                     GridCacheContext<K, V> cacheCtx = cctx.cacheContext(cacheId);
 
                     if (cacheCtx.cache().configuration().isStatisticsEnabled())
-                        cacheCtx.cache().metrics0().onTxCommit(System.nanoTime() - tx.startTime());
+                        // Convert start time from ms to ns.
+                        cacheCtx.cache().metrics0().onTxCommit((U.currentTimeMillis() - tx.startTime()) * 1000);
                 }
             }
 
@@ -1316,7 +1317,9 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V> {
                 for (int cacheId : tx.activeCacheIds()) {
                     GridCacheContext<K, V> cacheCtx = cctx.cacheContext(cacheId);
 
-                    cacheCtx.cache().metrics0().onTxRollback(System.nanoTime() - tx.startTime());
+                    if (cacheCtx.cache().configuration().isStatisticsEnabled())
+                        // Convert start time from ms to ns.
+                        cacheCtx.cache().metrics0().onTxRollback((U.currentTimeMillis() - tx.startTime()) * 1000);
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b0e6ab17/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index d1c5e12..a7fb34a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -103,6 +103,48 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     /**
      * @throws Exception If failed.
      */
+    public void testGetMetricsDisable() throws Exception {
+        // Disable statistics.
+        for (int i = 0; i < gridCount(); i++) {
+            Ignite g = grid(i);
+
+            g.jcache(null).getConfiguration(CacheConfiguration.class).setStatisticsEnabled(false);
+        }
+
+        IgniteCache<Object, Object> jcache = grid(0).jcache(null);
+
+        // Write to cache.
+        for (int i = 0; i < KEY_CNT; i++)
+            jcache.put(i, i);
+
+        // Get from cache.
+        for (int i = 0; i < KEY_CNT; i++)
+            jcache.get(i);
+
+        // Remove from cache.
+        for (int i = 0; i < KEY_CNT; i++)
+            jcache.remove(i);
+
+        // Assert that statistics is clear.
+        for (int i = 0; i < gridCount(); i++) {
+            CacheMetrics m = grid(i).jcache(null).metrics();
+
+            assertEquals(m.getCacheGets(), 0);
+            assertEquals(m.getCachePuts(), 0);
+            assertEquals(m.getCacheRemovals(), 0);
+            assertEquals(m.getCacheHits(), 0);
+            assertEquals(m.getCacheMisses(), 0);
+            assertEquals(m.getAverageGetTime(), 0f);
+            assertEquals(m.getAverageRemoveTime(), 0f);
+            assertEquals(m.getAveragePutTime(), 0f);
+            assertEquals(m.getAverageTxCommitTime(), 0f);
+            assertEquals(m.getAverageTxRollbackTime(), 0f);
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testGetMetricsSnapshot() throws Exception {
         IgniteCache<Object, Object> cache = grid(0).jcache(null);
 


[04/50] incubator-ignite git commit: #ignite-239: remove comments.

Posted by ak...@apache.org.
#ignite-239: remove comments.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5dd1e80c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5dd1e80c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5dd1e80c

Branch: refs/heads/ignite-368
Commit: 5dd1e80c660f3fd586d78d29012a139e46e4b647
Parents: 890d6c6
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 20 16:07:55 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 20 16:07:55 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/internal/IgnitionEx.java     | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5dd1e80c/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 9395e5c..501ff90 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1320,10 +1320,6 @@ public class IgnitionEx {
 
             U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
 
-            /*
-             * Set up all defaults and perform all checks.
-             */
-
             // Ensure invariant.
             // It's a bit dirty - but this is a result of late refactoring
             // and I don't want to reshuffle a lot of code.


[12/50] incubator-ignite git commit: Merge branch 'sprint-2' into ignite-136

Posted by ak...@apache.org.
Merge branch 'sprint-2' into ignite-136


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6ba60903
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6ba60903
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6ba60903

Branch: refs/heads/ignite-368
Commit: 6ba60903d2dc1f76a15dec8d3f88910292f4a433
Parents: c982177 98f177f
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Feb 25 11:01:04 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Feb 25 11:01:04 2015 +0300

----------------------------------------------------------------------
 .../datagrid/CacheContinuousQueryExample.java   |  6 ++---
 .../cache/store/jdbc/CacheJdbcPojoStore.java    | 28 +++++++++++++++-----
 2 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------



[37/50] incubator-ignite git commit: # ignite-382 Changed version.

Posted by ak...@apache.org.
# ignite-382 Changed version.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f252ee41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f252ee41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f252ee41

Branch: refs/heads/ignite-368
Commit: f252ee4177c3f1cf4b8eb47014e930da696600c2
Parents: 13e2d1f
Author: anovikov <an...@gridgain.com>
Authored: Mon Mar 2 16:36:11 2015 +0700
Committer: anovikov <an...@gridgain.com>
Committed: Mon Mar 2 16:36:11 2015 +0700

----------------------------------------------------------------------
 examples/pom-standalone.xml                       | 2 +-
 modules/core/src/main/resources/ignite.properties | 2 +-
 pom.xml                                           | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f252ee41/examples/pom-standalone.xml
----------------------------------------------------------------------
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index 47df6bd..5de7433 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -28,7 +28,7 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <ignite.version>1.0.1-RC1-SNAPSHOT</ignite.version>
+        <ignite.version>1.0.0-RC2-SNAPSHOT</ignite.version>
     </properties>
 
     <groupId>org.apache.ignite</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f252ee41/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 caa7553..4295dce 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.1-rc1
+ignite.version=1.0.0-rc2
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f252ee41/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 98f649d..b0ebc44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     </parent>
 
     <properties>
-        <ignite.version>1.0.1-RC1-SNAPSHOT</ignite.version>
+        <ignite.version>1.0.0-RC2-SNAPSHOT</ignite.version>
         <ignite.edition>fabric</ignite.edition>
         <hadoop.version>2.4.1</hadoop.version>
         <spring.version>4.1.0.RELEASE</spring.version>
@@ -574,7 +574,7 @@
                 </plugins>
             </build>
         </profile>
-        
+
         <profile>
             <id>test</id>
             <build>


[46/50] incubator-ignite git commit: Merge branch 'ignite-136' into sprint-2

Posted by ak...@apache.org.
Merge branch 'ignite-136' into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9a931983
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9a931983
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9a931983

Branch: refs/heads/ignite-368
Commit: 9a931983f51f96ad9b96551aee654874e746aa94
Parents: 028e446 2e115bf
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Mar 2 17:47:24 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Mar 2 17:47:24 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   9 +
 .../distributed/dht/GridDhtCacheEntry.java      |   3 +
 .../distributed/dht/GridDhtLocalPartition.java  |   5 +
 .../GridCacheAbstractLocalStoreSelfTest.java    | 440 +++++++++++++++++++
 .../GridCachePartitionedLocalStoreSelfTest.java |  51 +++
 ...chePartitionedOffHeapLocalStoreSelfTest.java |  56 +++
 .../GridCacheReplicatedLocalStoreSelfTest.java  |  51 +++
 ...ridCacheTxPartitionedLocalStoreSelfTest.java |  51 +++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   4 +
 9 files changed, 670 insertions(+)
----------------------------------------------------------------------



[11/50] incubator-ignite git commit: # ignite-136 minor

Posted by ak...@apache.org.
# ignite-136 minor


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c9821777
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c9821777
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c9821777

Branch: refs/heads/ignite-368
Commit: c982177761dfb3fed83c304a0c6f1b8056f69a91
Parents: 8d0f1b8
Author: sboikov <sb...@gridgain.com>
Authored: Wed Feb 25 09:24:44 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Feb 25 09:24:44 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtLocalPartition.java           | 4 +++-
 .../processors/cache/GridCacheAbstractLocalStoreSelfTest.java  | 6 ++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9821777/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index f8af7dc..93a6012 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -531,6 +531,8 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
 
         boolean rec = cctx.events().isRecordable(EVT_CACHE_PRELOAD_OBJECT_UNLOADED);
 
+        boolean locStore = cctx.store().isLocalStore();
+
         for (Iterator<GridDhtCacheEntry<K, V>> it = map.values().iterator(); it.hasNext();) {
             GridDhtCacheEntry<K, V> cached = it.next();
 
@@ -538,7 +540,7 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
                 if (cached.clearInternal(clearVer, swap)) {
                     it.remove();
 
-                    if (cctx.store().isLocalStore())
+                    if (locStore)
                         cctx.store().removeFromStore(null, cached.key());
 
                     if (!cached.isInternal()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9821777/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index 4b647a1..ed1b889 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -47,7 +47,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
 public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbstractTest {
     /** */
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-    
+
     /** */
     public static final TestLocalStore<Integer, Integer> LOCAL_STORE_1 = new TestLocalStore<>();
 
@@ -119,10 +119,8 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         cacheCfg.setWriteThrough(true);
         cacheCfg.setReadThrough(true);
-        cacheCfg.setWriteBehindBatchSize(1);
-        cacheCfg.setWriteBehindFlushFrequency(1);
-        cacheCfg.setWriteBehindFlushSize(1);
         cacheCfg.setBackups(backups);
+
         return cacheCfg;
     }
 


[07/50] incubator-ignite git commit: #ignite-239: small refactoring.

Posted by ak...@apache.org.
#ignite-239: small refactoring.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6fa46c37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6fa46c37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6fa46c37

Branch: refs/heads/ignite-368
Commit: 6fa46c37b4b691ba90232dbf823593ebdd89da9f
Parents: c1b4ad7
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 20 18:33:44 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 20 18:33:44 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 187 +++++++++----------
 1 file changed, 91 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6fa46c37/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 9c196f4..8e1e110 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1488,7 +1488,95 @@ public class IgnitionEx {
                     "on start?) [segPlc=" + segPlc + ", wait=false]");
             }
 
-            copySpis(cfg, myCfg, startCtx.single());
+            /*
+             * Initialize default SPI implementations.
+             */
+            CommunicationSpi commSpi = cfg.getCommunicationSpi();
+            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
+            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
+            CollisionSpi colSpi = cfg.getCollisionSpi();
+            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
+            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
+            FailoverSpi[] failSpi = cfg.getFailoverSpi();
+            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
+            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
+            IndexingSpi indexingSpi = cfg.getIndexingSpi();
+
+            if (commSpi == null)
+                commSpi = new TcpCommunicationSpi();
+
+            if (discoSpi == null)
+                discoSpi = new TcpDiscoverySpi();
+
+            if (discoSpi instanceof TcpDiscoverySpi) {
+                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
+
+                if (tcpDisco.getIpFinder() == null)
+                    tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
+            }
+
+            if (evtSpi == null)
+                evtSpi = new MemoryEventStorageSpi();
+
+            if (colSpi == null)
+                colSpi = new NoopCollisionSpi();
+
+            if (deploySpi == null)
+                deploySpi = new LocalDeploymentSpi();
+
+            if (cpSpi == null)
+                cpSpi = new CheckpointSpi[] {new NoopCheckpointSpi()};
+
+            if (failSpi == null)
+                failSpi = new FailoverSpi[] {new AlwaysFailoverSpi()};
+
+            if (loadBalancingSpi == null)
+                loadBalancingSpi = new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
+
+            if (swapspaceSpi == null) {
+                boolean needSwap = false;
+
+                CacheConfiguration[] caches = cfg.getCacheConfiguration();
+
+                if (caches != null) {
+                    for (CacheConfiguration c : caches) {
+                        if (c.isSwapEnabled()) {
+                            needSwap = true;
+
+                            break;
+                        }
+                    }
+                }
+
+                swapspaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
+            }
+
+            if (indexingSpi == null)
+                indexingSpi = new NoopIndexingSpi();
+
+            myCfg.setCommunicationSpi(commSpi);
+            myCfg.setDiscoverySpi(discoSpi);
+            myCfg.setCheckpointSpi(cpSpi);
+            myCfg.setEventStorageSpi(evtSpi);
+            myCfg.setDeploymentSpi(deploySpi);
+            myCfg.setFailoverSpi(failSpi);
+            myCfg.setCollisionSpi(colSpi);
+            myCfg.setLoadBalancingSpi(loadBalancingSpi);
+            myCfg.setSwapSpaceSpi(swapspaceSpi);
+            myCfg.setIndexingSpi(indexingSpi);
+
+            // Ensure that SPIs support multiple grid instances, if required.
+            if (!startCtx.single()) {
+                ensureMultiInstanceSupport(deploySpi);
+                ensureMultiInstanceSupport(commSpi);
+                ensureMultiInstanceSupport(discoSpi);
+                ensureMultiInstanceSupport(cpSpi);
+                ensureMultiInstanceSupport(evtSpi);
+                ensureMultiInstanceSupport(colSpi);
+                ensureMultiInstanceSupport(failSpi);
+                ensureMultiInstanceSupport(loadBalancingSpi);
+                ensureMultiInstanceSupport(swapspaceSpi);
+            }
 
             CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();
 
@@ -1496,12 +1584,12 @@ public class IgnitionEx {
 
             final boolean hasAtomics = cfg.getAtomicConfiguration() != null;
 
-            final boolean clientDisco = myCfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi;
+            final boolean clientDisco = discoSpi instanceof TcpClientDiscoverySpi;
 
             CacheConfiguration[] copies;
 
             if (cacheCfgs != null && cacheCfgs.length > 0) {
-                if (!U.discoOrdered(myCfg.getDiscoverySpi()) && !U.relaxDiscoveryOrdered())
+                if (!U.discoOrdered(discoSpi) && !U.relaxDiscoveryOrdered())
                     throw new IgniteCheckedException("Discovery SPI implementation does not support node ordering and " +
                         "cannot be used with cache (use SPI with @GridDiscoverySpiOrderSupport annotation, " +
                         "like GridTcpDiscoverySpi)");
@@ -1709,99 +1797,6 @@ public class IgnitionEx {
             }
         }
 
-        private void copySpis(IgniteConfiguration cfg, IgniteConfiguration myCfg, boolean singleGrid)
-            throws IgniteCheckedException {
-            /*
-             * Initialize default SPI implementations.
-             */
-            CommunicationSpi commSpi = cfg.getCommunicationSpi();
-            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
-            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
-            CollisionSpi colSpi = cfg.getCollisionSpi();
-            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
-            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
-            FailoverSpi[] failSpi = cfg.getFailoverSpi();
-            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
-            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
-            IndexingSpi indexingSpi = cfg.getIndexingSpi();
-
-            if (commSpi == null)
-                commSpi = new TcpCommunicationSpi();
-
-            if (discoSpi == null)
-                discoSpi = new TcpDiscoverySpi();
-
-            if (discoSpi instanceof TcpDiscoverySpi) {
-                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
-
-                if (tcpDisco.getIpFinder() == null)
-                    tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
-            }
-
-            if (evtSpi == null)
-                evtSpi = new MemoryEventStorageSpi();
-
-            if (colSpi == null)
-                colSpi = new NoopCollisionSpi();
-
-            if (deploySpi == null)
-                deploySpi = new LocalDeploymentSpi();
-
-            if (cpSpi == null)
-                cpSpi = new CheckpointSpi[] {new NoopCheckpointSpi()};
-
-            if (failSpi == null)
-                failSpi = new FailoverSpi[] {new AlwaysFailoverSpi()};
-
-            if (loadBalancingSpi == null)
-                loadBalancingSpi = new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
-
-            if (swapspaceSpi == null) {
-                boolean needSwap = false;
-
-                CacheConfiguration[] caches = cfg.getCacheConfiguration();
-
-                if (caches != null) {
-                    for (CacheConfiguration c : caches) {
-                        if (c.isSwapEnabled()) {
-                            needSwap = true;
-
-                            break;
-                        }
-                    }
-                }
-
-                swapspaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
-            }
-
-            if (indexingSpi == null)
-                indexingSpi = new NoopIndexingSpi();
-
-            myCfg.setCommunicationSpi(commSpi);
-            myCfg.setDiscoverySpi(discoSpi);
-            myCfg.setCheckpointSpi(cpSpi);
-            myCfg.setEventStorageSpi(evtSpi);
-            myCfg.setDeploymentSpi(deploySpi);
-            myCfg.setFailoverSpi(failSpi);
-            myCfg.setCollisionSpi(colSpi);
-            myCfg.setLoadBalancingSpi(loadBalancingSpi);
-            myCfg.setSwapSpaceSpi(swapspaceSpi);
-            myCfg.setIndexingSpi(indexingSpi);
-
-            // Ensure that SPIs support multiple grid instances, if required.
-            if (!singleGrid) {
-                ensureMultiInstanceSupport(deploySpi);
-                ensureMultiInstanceSupport(commSpi);
-                ensureMultiInstanceSupport(discoSpi);
-                ensureMultiInstanceSupport(cpSpi);
-                ensureMultiInstanceSupport(evtSpi);
-                ensureMultiInstanceSupport(colSpi);
-                ensureMultiInstanceSupport(failSpi);
-                ensureMultiInstanceSupport(loadBalancingSpi);
-                ensureMultiInstanceSupport(swapspaceSpi);
-            }
-        }
-
         /**
          * @param cfgLog Configured logger.
          * @param nodeId Local node ID.


[28/50] incubator-ignite git commit: IGNITE-136 Added test eviction for local store.

Posted by ak...@apache.org.
IGNITE-136 Added test eviction for local store.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2e115bf6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2e115bf6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2e115bf6

Branch: refs/heads/ignite-368
Commit: 2e115bf663aef70f6141119adcbd11e2c7bbbaaa
Parents: 3a466e8
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Feb 27 17:57:04 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Feb 27 17:57:04 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractLocalStoreSelfTest.java    | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e115bf6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index 781c6a6..c43b8f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.processors.cache.store.*;
 import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -35,6 +36,7 @@ import org.jetbrains.annotations.*;
 
 import javax.cache.*;
 import javax.cache.configuration.*;
+import javax.cache.expiry.*;
 import javax.cache.integration.*;
 import java.util.*;
 import java.util.concurrent.*;
@@ -170,6 +172,34 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     /**
      * @throws Exception If failed.
      */
+    public void testEvict() throws Exception {
+        Ignite ignite1 = startGrid(1);
+
+        IgniteCache<Object, Object> cache = ignite1.jcache(null).withExpiryPolicy(new CreatedExpiryPolicy(
+            new Duration(TimeUnit.MILLISECONDS, 100L)));
+
+        // Putting entry.
+        for (int i = 0; i < KEYS; i++)
+            cache.put(i, i);
+
+        // Wait when entry 
+        U.sleep(200);
+
+        // Check that entry is evicted from cache, but local store does contain it.
+        for (int i = 0; i < KEYS; i++) {
+            cache.localEvict(Arrays.asList(i));
+
+            assertNull(cache.localPeek(i));
+
+            assertEquals(i, (int)LOCAL_STORE_1.load(i).get1());
+
+            assertEquals(i, cache.get(i));
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testPrimaryNode() throws Exception {
         Ignite ignite1 = startGrid(1);
 


[13/50] incubator-ignite git commit: IGNITE-136 Clear local store for entry from swap.

Posted by ak...@apache.org.
IGNITE-136 Clear local store for entry from swap.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f33c0748
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f33c0748
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f33c0748

Branch: refs/heads/ignite-368
Commit: f33c07486ff932672b838604af3acb67397f34fc
Parents: 6ba6090
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Feb 25 13:37:33 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Feb 25 13:44:46 2015 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLocalPartition.java  |   9 +-
 .../GridCacheAbstractLocalStoreSelfTest.java    | 118 ++++++++++++++-----
 .../GridCachePartitionedLocalStoreSelfTest.java |   2 +-
 ...chePartitionedOffHeapLocalStoreSelfTest.java |  56 +++++++++
 .../GridCacheReplicatedLocalStoreSelfTest.java  |   2 +-
 ...ridCacheTxPartitionedLocalStoreSelfTest.java |   2 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   3 +-
 7 files changed, 157 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 93a6012..e3efade 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -488,6 +488,8 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
         try {
             GridCloseableIterator<Map.Entry<byte[], GridCacheSwapEntry<V>>> it = cctx.swap().iterator(id, false);
 
+            boolean isLocStore = cctx.store().isLocalStore();
+
             if (it != null) {
                 // We can safely remove these values because no entries will be created for evicted partition.
                 while (it.hasNext()) {
@@ -498,6 +500,9 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
                     K key = cctx.marshaller().unmarshal(keyBytes, cctx.deploy().globalLoader());
 
                     cctx.swap().remove(key, keyBytes);
+
+                    if (isLocStore)
+                        cctx.store().removeFromStore(null, key);
                 }
             }
         }
@@ -531,7 +536,7 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
 
         boolean rec = cctx.events().isRecordable(EVT_CACHE_PRELOAD_OBJECT_UNLOADED);
 
-        boolean locStore = cctx.store().isLocalStore();
+        boolean isLocStore = cctx.store().isLocalStore();
 
         for (Iterator<GridDhtCacheEntry<K, V>> it = map.values().iterator(); it.hasNext();) {
             GridDhtCacheEntry<K, V> cached = it.next();
@@ -540,7 +545,7 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
                 if (cached.clearInternal(clearVer, swap)) {
                     it.remove();
 
-                    if (locStore)
+                    if (isLocStore)
                         cctx.store().removeFromStore(null, cached.key());
 
                     if (!cached.isInternal()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index ed1b889..9bf9bc4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import com.google.common.collect.*;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
@@ -37,6 +38,7 @@ import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
+import static org.apache.ignite.cache.CacheMemoryMode.*;
 import static org.apache.ignite.cache.CacheMode.*;
 import static org.apache.ignite.cache.CachePreloadMode.*;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
@@ -100,13 +102,16 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
         LOCAL_STORE_3.clear();
     }
 
+    /**
+     * 
+     */
     private CacheConfiguration cache(String gridName, String cacheName, int backups) {
         CacheConfiguration cacheCfg = new CacheConfiguration();
 
         cacheCfg.setName(cacheName);
         cacheCfg.setCacheMode(getCacheMode());
         cacheCfg.setAtomicityMode(getAtomicMode());
-        cacheCfg.setDistributionMode(getDisrtMode());
+        cacheCfg.setDistributionMode(getDistributionMode());
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         cacheCfg.setPreloadMode(SYNC);
 
@@ -120,6 +125,11 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
         cacheCfg.setWriteThrough(true);
         cacheCfg.setReadThrough(true);
         cacheCfg.setBackups(backups);
+        cacheCfg.setOffHeapMaxMemory(0);
+        cacheCfg.setSwapEnabled(true);
+
+        if (isOffHeapTiredMode())
+            cacheCfg.setMemoryMode(OFFHEAP_TIERED);
 
         return cacheCfg;
     }
@@ -127,7 +137,7 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     /**
      * @return Distribution mode.
      */
-    protected abstract CacheDistributionMode getDisrtMode();
+    protected abstract CacheDistributionMode getDistributionMode();
 
     /**
      * @return Cache atomicity mode.
@@ -139,6 +149,13 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
      */
     protected abstract CacheMode getCacheMode();
 
+    /**
+     * @return Cache memory mode.
+     */
+    protected boolean isOffHeapTiredMode() {
+        return false;
+    }
+
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         stopAllGrids();
@@ -152,57 +169,47 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         IgniteCache<Object, Object> cache = ignite1.jcache(null);
 
+        // Populate cache and check that local store has all value.
         for (int i = 0; i < KEYS; i++)
             cache.put(i, i);
 
-        for (int i = 0; i < KEYS; i++)
-            assertEquals(LOCAL_STORE_1.load(i).get1().intValue(), i);
+        checkLocalStore(ignite1, LOCAL_STORE_1);
 
-        final CountDownLatch startPartExchange = new CountDownLatch(1);
-        final AtomicBoolean eventOcr = new AtomicBoolean(true);
+        final CountDownLatch partExchanged = new CountDownLatch(1);
+
+        final int[] leftPartition = new int[1];
 
         if (getCacheMode() != REPLICATED) {
             ignite1.events().localListen(new IgnitePredicate<Event>() {
+                private AtomicInteger eventCnt = new AtomicInteger(0);
+                
                 @Override public boolean apply(Event event) {
-                    startPartExchange.countDown();
-
-                    eventOcr.set(true);
-
+                    if (leftPartition[0] - eventCnt.incrementAndGet() == 0)
+                        partExchanged.countDown();
+                                            
                     return true;
                 }
-            }, EventType.EVT_CACHE_PRELOAD_OBJECT_UNLOADED);
+            }, EventType.EVT_CACHE_PRELOAD_PART_UNLOADED);
         }
 
         Ignite ignite2 = startGrid(2);
 
+        // Partition count which must be transferred to 2'nd node.
+        leftPartition[0] = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+
         assertEquals(Ignition.allGrids().size(), 2);
 
         // Wait when partition unloaded.
-        waitExpirePartition(startPartExchange, eventOcr);
+        if (getCacheMode() != REPLICATED)
+            assert partExchanged.await(2, TimeUnit.SECONDS);
 
         checkLocalStore(ignite1, LOCAL_STORE_1);
         checkLocalStore(ignite2, LOCAL_STORE_2);
     }
 
     /**
-     * Wait when partition unloaded.
+     * @throws Exception If failed.
      */
-    private void waitExpirePartition(CountDownLatch startPartExchange, AtomicBoolean eventOcr) throws Exception {
-        if (getCacheMode() != REPLICATED) {
-            assert startPartExchange.await(2, TimeUnit.SECONDS);
-
-            while (true) {
-                if (eventOcr.get()) {
-                    eventOcr.set(false);
-
-                    TimeUnit.MILLISECONDS.sleep(100);
-                }
-                else
-                    break;
-            }
-        }
-    }
-
     public void testBackupNode() throws Exception {
         Ignite ignite1 = startGrid(1);
 
@@ -241,6 +248,59 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testSwap() throws Exception {
+        Ignite ignite1 = startGrid(1);
+
+        IgniteCache<Object, Object> cache = ignite1.jcache(null);
+
+        // Populate cache and check that local store has all value.
+        for (int i = 0; i < KEYS; i++)
+            cache.put(i, i);
+
+        checkLocalStore(ignite1, LOCAL_STORE_1);
+
+        // Push entry to swap.
+        for (int i = 0; i < KEYS; i++)
+            cache.localEvict(Lists.newArrayList(i));
+
+        for (int i = 0; i < KEYS; i++)
+            assertNull(cache.localPeek(i, CachePeekMode.ONHEAP));
+
+        final CountDownLatch partExchanged = new CountDownLatch(1);
+
+        final int[] leftPartition = new int[1];
+
+        if (getCacheMode() != REPLICATED) {
+            ignite1.events().localListen(new IgnitePredicate<Event>() {
+                private AtomicInteger eventCnt = new AtomicInteger(0);
+
+                @Override public boolean apply(Event event) {
+                    if (leftPartition[0] - eventCnt.incrementAndGet() == 0)
+                        partExchanged.countDown();
+
+                    return true;
+                }
+            }, EventType.EVT_CACHE_PRELOAD_PART_UNLOADED);
+        }
+
+        Ignite ignite2 = startGrid(2);
+
+        // Partition count which must be transferred to 2'nd node.
+        leftPartition[0] = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+
+        assertEquals(Ignition.allGrids().size(), 2);
+
+        // Wait when partition unloaded.
+        if (getCacheMode() != REPLICATED)
+            assert partExchanged.await(2, TimeUnit.SECONDS);
+
+        checkLocalStore(ignite1, LOCAL_STORE_1);
+        checkLocalStore(ignite2, LOCAL_STORE_2);
+    }
+
+    /**
      * Check that local stores contains only primary entry.
      */
     private void checkLocalStore(Ignite ignite, CacheStore<Integer, IgniteBiTuple<Integer, ?>> store) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
index d2dfcf0..4217531 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
@@ -35,7 +35,7 @@ public class GridCachePartitionedLocalStoreSelfTest extends GridCacheAbstractLoc
     }
 
     /** {@inheritDoc} */
-    @Override protected CacheDistributionMode getDisrtMode() {
+    @Override protected CacheDistributionMode getDistributionMode() {
         return PARTITIONED_ONLY;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java
new file mode 100644
index 0000000..6dfc977
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.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;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class GridCachePartitionedOffHeapLocalStoreSelfTest extends GridCacheAbstractLocalStoreSelfTest {
+    /**
+     *
+     */
+    public GridCachePartitionedOffHeapLocalStoreSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDistributionMode() {
+        return PARTITIONED_ONLY;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean isOffHeapTiredMode() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
index 2d43d13..56f3f1a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
@@ -35,7 +35,7 @@ public class GridCacheReplicatedLocalStoreSelfTest extends GridCacheAbstractLoca
     }
 
     /** {@inheritDoc} */
-    @Override protected CacheDistributionMode getDisrtMode() {
+    @Override protected CacheDistributionMode getDistributionMode() {
         return PARTITIONED_ONLY;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
index e031102..113bac3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
@@ -35,7 +35,7 @@ public class GridCacheTxPartitionedLocalStoreSelfTest extends GridCacheAbstractL
     }
 
     /** {@inheritDoc} */
-    @Override protected CacheDistributionMode getDisrtMode() {
+    @Override protected CacheDistributionMode getDistributionMode() {
         return PARTITIONED_ONLY;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f33c0748/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 28c9b57..6b3eb4a 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -140,7 +140,8 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTestSuite(GridCacheGlobalLoadTest.class);
         suite.addTestSuite(GridCachePartitionedLocalStoreSelfTest.class);
         suite.addTestSuite(GridCacheReplicatedLocalStoreSelfTest.class);
-        //suite.addTestSuite(GridCacheTxPartitionedLocalStoreSelfTest.class); TODO GG-9762
+        suite.addTestSuite(GridCachePartitionedOffHeapLocalStoreSelfTest.class);
+        suite.addTestSuite(GridCacheTxPartitionedLocalStoreSelfTest.class);
 
         // Heuristic exception handling. TODO IGNITE-257
 //        suite.addTestSuite(GridCacheColocatedTxExceptionSelfTest.class);


[06/50] incubator-ignite git commit: #ignite-239: small refactoring.

Posted by ak...@apache.org.
#ignite-239: small refactoring.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c1b4ad70
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c1b4ad70
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c1b4ad70

Branch: refs/heads/ignite-368
Commit: c1b4ad70cf1d1d954981c1056e4e66b021c465c7
Parents: 7e2b2e2
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 20 18:29:11 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 20 18:29:11 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      |   4 +-
 .../org/apache/ignite/internal/IgnitionEx.java  | 352 ++++++++++---------
 2 files changed, 179 insertions(+), 177 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b4ad70/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index e554aea..d44b057 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -384,7 +384,6 @@ public class IgniteConfiguration {
      *
      * @param cfg Grid configuration to copy from.
      */
-    @SuppressWarnings("deprecation")
     public IgniteConfiguration(IgniteConfiguration cfg) {
         assert cfg != null;
 
@@ -455,7 +454,8 @@ public class IgniteConfiguration {
         sysPoolSize = cfg.getSystemThreadPoolSize();
         timeSrvPortBase = cfg.getTimeServerPortBase();
         timeSrvPortRange = cfg.getTimeServerPortRange();
-        txCfg = cfg.getTransactionConfiguration();
+        txCfg = cfg.getTransactionConfiguration() != null ?
+            new TransactionConfiguration(cfg.getTransactionConfiguration()) : null;
         userAttrs = cfg.getUserAttributes();
         waitForSegOnStart = cfg.isWaitForSegmentOnStart();
         warmupClos = cfg.getWarmupClosure();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b4ad70/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 34f29a7..9c196f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1333,6 +1333,8 @@ public class IgnitionEx {
             if (nodeId == null)
                 nodeId = UUID.randomUUID();
 
+            myCfg.setNodeId(nodeId);
+
             IgniteLogger cfgLog = initLogger(cfg.getGridLogger(), nodeId);
 
             assert cfgLog != null;
@@ -1342,6 +1344,8 @@ public class IgnitionEx {
             // Initialize factory's log.
             log = cfgLog.getLogger(G.class);
 
+            myCfg.setGridLogger(cfgLog);
+
             // Check Ignite home folder (after log is available).
             if (ggHome != null) {
                 File ggHomeFile = new File(ggHome);
@@ -1352,13 +1356,6 @@ public class IgnitionEx {
 
             myCfg.setIgniteHome(ggHome);
 
-            myCfg.setTransactionConfiguration(new TransactionConfiguration(cfg.getTransactionConfiguration()));
-
-            ConnectorConfiguration clientCfg = cfg.getConnectorConfiguration();
-
-            if (clientCfg != null)
-                clientCfg = new ConnectorConfiguration(clientCfg);
-
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
 
@@ -1391,69 +1388,10 @@ public class IgnitionEx {
                 }
             }
 
-            Map<String, ?> attrs = cfg.getUserAttributes();
-
-            if (attrs == null)
-                attrs = Collections.emptyMap();
-
-            MBeanServer mbSrv = cfg.getMBeanServer();
-
-            Marshaller marsh = cfg.getMarshaller();
-
-            String[] p2pExclude = cfg.getPeerClassLoadingLocalClassPathExclude();
-
-
-            execSvc = new IgniteThreadPoolExecutor(
-                "pub-" + cfg.getGridName(),
-                cfg.getPublicThreadPoolSize(),
-                cfg.getPublicThreadPoolSize(),
-                DFLT_PUBLIC_KEEP_ALIVE_TIME,
-                new LinkedBlockingQueue<Runnable>(DFLT_PUBLIC_THREADPOOL_QUEUE_CAP));
-
-            // Pre-start all threads as they are guaranteed to be needed.
-            ((ThreadPoolExecutor) execSvc).prestartAllCoreThreads();
-
-            // Note that since we use 'LinkedBlockingQueue', number of
-            // maximum threads has no effect.
-            sysExecSvc = new IgniteThreadPoolExecutor(
-                "sys-" + cfg.getGridName(),
-                cfg.getSystemThreadPoolSize(),
-                cfg.getSystemThreadPoolSize(),
-                DFLT_SYSTEM_KEEP_ALIVE_TIME,
-                new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP));
-
-            // Pre-start all threads as they are guaranteed to be needed.
-            ((ThreadPoolExecutor) sysExecSvc).prestartAllCoreThreads();
-
-            // Note that since we use 'LinkedBlockingQueue', number of
-            // maximum threads has no effect.
-            // Note, that we do not pre-start threads here as management pool may
-            // not be needed.
-            mgmtExecSvc = new IgniteThreadPoolExecutor(
-                "mgmt-" + cfg.getGridName(),
-                cfg.getManagementThreadPoolSize(),
-                cfg.getManagementThreadPoolSize(),
-                0,
-                new LinkedBlockingQueue<Runnable>());
-
-            // Note that since we use 'LinkedBlockingQueue', number of
-            // maximum threads has no effect.
-            // Note, that we do not pre-start threads here as class loading pool may
-            // not be needed.
-            p2pExecSvc = new IgniteThreadPoolExecutor(
-                "p2p-" + cfg.getGridName(),
-                cfg.getPeerClassLoadingThreadPoolSize(),
-                cfg.getPeerClassLoadingThreadPoolSize(),
-                0,
-                new LinkedBlockingQueue<Runnable>());
+            ConnectorConfiguration clientCfg = cfg.getConnectorConfiguration();
 
-            // Note that we do not pre-start threads here as igfs pool may not be needed.
-            igfsExecSvc = new IgniteThreadPoolExecutor(
-                "igfs-" + cfg.getGridName(),
-                cfg.getIgfsThreadPoolSize(),
-                cfg.getIgfsThreadPoolSize(),
-                0,
-                new LinkedBlockingQueue<Runnable>());
+            if (clientCfg != null)
+                clientCfg = new ConnectorConfiguration(clientCfg);
 
             if (clientCfg != null) {
                 restExecSvc = new IgniteThreadPoolExecutor(
@@ -1465,12 +1403,10 @@ public class IgnitionEx {
                 );
             }
 
-            utilityCacheExecSvc = new IgniteThreadPoolExecutor(
-                "utility-" + cfg.getGridName(),
-                DFLT_SYSTEM_CORE_THREAD_CNT,
-                DFLT_SYSTEM_MAX_THREAD_CNT,
-                DFLT_SYSTEM_KEEP_ALIVE_TIME,
-                new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP));
+            // REST configuration.
+            myCfg.setConnectorConfiguration(clientCfg);
+
+            Marshaller marsh = cfg.getMarshaller();
 
             if (marsh == null) {
                 if (!U.isHotSpot()) {
@@ -1500,12 +1436,18 @@ public class IgnitionEx {
                     "Using GridOptimizedMarshaller on untested JVM.");
             }
 
+            myCfg.setMarshaller(marsh);
+
+            Map<String, ?> attrs = cfg.getUserAttributes();
+
+            if (attrs == null)
+                attrs = Collections.emptyMap();
+
             myCfg.setUserAttributes(attrs);
+
+            MBeanServer mbSrv = cfg.getMBeanServer();
+
             myCfg.setMBeanServer(mbSrv == null ? ManagementFactory.getPlatformMBeanServer() : mbSrv);
-            myCfg.setGridLogger(cfgLog);
-            myCfg.setMarshaller(marsh);
-            myCfg.setMarshalLocalJobs(cfg.isMarshalLocalJobs());
-            myCfg.setNodeId(nodeId);
 
             IgfsConfiguration[] igfsCfgs = cfg.getIgfsConfiguration();
 
@@ -1529,14 +1471,13 @@ public class IgnitionEx {
                 myCfg.setStreamerConfiguration(clone);
             }
 
+            String[] p2pExclude = cfg.getPeerClassLoadingLocalClassPathExclude();
+
             if (p2pExclude == null)
                 p2pExclude = EMPTY_STR_ARR;
 
             myCfg.setPeerClassLoadingLocalClassPathExclude(p2pExclude);
 
-            // REST configuration.
-            myCfg.setConnectorConfiguration(clientCfg);
-
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1547,85 +1488,7 @@ public class IgnitionEx {
                     "on start?) [segPlc=" + segPlc + ", wait=false]");
             }
 
-
-
-            /*
-             * Initialize default SPI implementations.
-             */
-            CommunicationSpi commSpi = cfg.getCommunicationSpi();
-            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
-            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
-            CollisionSpi colSpi = cfg.getCollisionSpi();
-            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
-            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
-            FailoverSpi[] failSpi = cfg.getFailoverSpi();
-            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
-            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
-            IndexingSpi indexingSpi = cfg.getIndexingSpi();
-
-
-            if (commSpi == null)
-                commSpi = new TcpCommunicationSpi();
-
-            if (discoSpi == null)
-                discoSpi = new TcpDiscoverySpi();
-
-            if (discoSpi instanceof TcpDiscoverySpi) {
-                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
-
-                if (tcpDisco.getIpFinder() == null)
-                    tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
-            }
-
-            if (evtSpi == null)
-                evtSpi = new MemoryEventStorageSpi();
-
-            if (colSpi == null)
-                colSpi = new NoopCollisionSpi();
-
-            if (deploySpi == null)
-                deploySpi = new LocalDeploymentSpi();
-
-            if (cpSpi == null)
-                cpSpi = new CheckpointSpi[] {new NoopCheckpointSpi()};
-
-            if (failSpi == null)
-                failSpi = new FailoverSpi[] {new AlwaysFailoverSpi()};
-
-            if (loadBalancingSpi == null)
-                loadBalancingSpi = new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
-
-            if (swapspaceSpi == null) {
-                boolean needSwap = false;
-
-                CacheConfiguration[] caches = cfg.getCacheConfiguration();
-
-                if (caches != null) {
-                    for (CacheConfiguration c : caches) {
-                        if (c.isSwapEnabled()) {
-                            needSwap = true;
-
-                            break;
-                        }
-                    }
-                }
-
-                swapspaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
-            }
-
-            if (indexingSpi == null)
-                indexingSpi = new NoopIndexingSpi();
-
-            myCfg.setCommunicationSpi(commSpi);
-            myCfg.setDiscoverySpi(discoSpi);
-            myCfg.setCheckpointSpi(cpSpi);
-            myCfg.setEventStorageSpi(evtSpi);
-            myCfg.setDeploymentSpi(deploySpi);
-            myCfg.setFailoverSpi(failSpi);
-            myCfg.setCollisionSpi(colSpi);
-            myCfg.setLoadBalancingSpi(loadBalancingSpi);
-            myCfg.setSwapSpaceSpi(swapspaceSpi);
-            myCfg.setIndexingSpi(indexingSpi);
+            copySpis(cfg, myCfg, startCtx.single());
 
             CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();
 
@@ -1633,12 +1496,12 @@ public class IgnitionEx {
 
             final boolean hasAtomics = cfg.getAtomicConfiguration() != null;
 
-            final boolean clientDisco = discoSpi instanceof TcpClientDiscoverySpi;
+            final boolean clientDisco = myCfg.getDiscoverySpi() instanceof TcpClientDiscoverySpi;
 
             CacheConfiguration[] copies;
 
             if (cacheCfgs != null && cacheCfgs.length > 0) {
-                if (!U.discoOrdered(discoSpi) && !U.relaxDiscoveryOrdered())
+                if (!U.discoOrdered(myCfg.getDiscoverySpi()) && !U.relaxDiscoveryOrdered())
                     throw new IgniteCheckedException("Discovery SPI implementation does not support node ordering and " +
                         "cannot be used with cache (use SPI with @GridDiscoverySpiOrderSupport annotation, " +
                         "like GridTcpDiscoverySpi)");
@@ -1716,18 +1579,64 @@ public class IgnitionEx {
                 // No-op.
             }
 
-            // Ensure that SPIs support multiple grid instances, if required.
-            if (!startCtx.single()) {
-                ensureMultiInstanceSupport(deploySpi);
-                ensureMultiInstanceSupport(commSpi);
-                ensureMultiInstanceSupport(discoSpi);
-                ensureMultiInstanceSupport(cpSpi);
-                ensureMultiInstanceSupport(evtSpi);
-                ensureMultiInstanceSupport(colSpi);
-                ensureMultiInstanceSupport(failSpi);
-                ensureMultiInstanceSupport(loadBalancingSpi);
-                ensureMultiInstanceSupport(swapspaceSpi);
-            }
+            execSvc = new IgniteThreadPoolExecutor(
+                "pub-" + cfg.getGridName(),
+                cfg.getPublicThreadPoolSize(),
+                cfg.getPublicThreadPoolSize(),
+                DFLT_PUBLIC_KEEP_ALIVE_TIME,
+                new LinkedBlockingQueue<Runnable>(DFLT_PUBLIC_THREADPOOL_QUEUE_CAP));
+
+            // Pre-start all threads as they are guaranteed to be needed.
+            ((ThreadPoolExecutor) execSvc).prestartAllCoreThreads();
+
+            // Note that since we use 'LinkedBlockingQueue', number of
+            // maximum threads has no effect.
+            sysExecSvc = new IgniteThreadPoolExecutor(
+                "sys-" + cfg.getGridName(),
+                cfg.getSystemThreadPoolSize(),
+                cfg.getSystemThreadPoolSize(),
+                DFLT_SYSTEM_KEEP_ALIVE_TIME,
+                new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP));
+
+            // Pre-start all threads as they are guaranteed to be needed.
+            ((ThreadPoolExecutor) sysExecSvc).prestartAllCoreThreads();
+
+            // Note that since we use 'LinkedBlockingQueue', number of
+            // maximum threads has no effect.
+            // Note, that we do not pre-start threads here as management pool may
+            // not be needed.
+            mgmtExecSvc = new IgniteThreadPoolExecutor(
+                "mgmt-" + cfg.getGridName(),
+                cfg.getManagementThreadPoolSize(),
+                cfg.getManagementThreadPoolSize(),
+                0,
+                new LinkedBlockingQueue<Runnable>());
+
+            // Note that since we use 'LinkedBlockingQueue', number of
+            // maximum threads has no effect.
+            // Note, that we do not pre-start threads here as class loading pool may
+            // not be needed.
+            p2pExecSvc = new IgniteThreadPoolExecutor(
+                "p2p-" + cfg.getGridName(),
+                cfg.getPeerClassLoadingThreadPoolSize(),
+                cfg.getPeerClassLoadingThreadPoolSize(),
+                0,
+                new LinkedBlockingQueue<Runnable>());
+
+            // Note that we do not pre-start threads here as igfs pool may not be needed.
+            igfsExecSvc = new IgniteThreadPoolExecutor(
+                "igfs-" + cfg.getGridName(),
+                cfg.getIgfsThreadPoolSize(),
+                cfg.getIgfsThreadPoolSize(),
+                0,
+                new LinkedBlockingQueue<Runnable>());
+
+            utilityCacheExecSvc = new IgniteThreadPoolExecutor(
+                "utility-" + cfg.getGridName(),
+                DFLT_SYSTEM_CORE_THREAD_CNT,
+                DFLT_SYSTEM_MAX_THREAD_CNT,
+                DFLT_SYSTEM_KEEP_ALIVE_TIME,
+                new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP));
 
             // Register Ignite MBean for current grid instance.
             registerFactoryMbean(myCfg.getMBeanServer());
@@ -1800,6 +1709,99 @@ public class IgnitionEx {
             }
         }
 
+        private void copySpis(IgniteConfiguration cfg, IgniteConfiguration myCfg, boolean singleGrid)
+            throws IgniteCheckedException {
+            /*
+             * Initialize default SPI implementations.
+             */
+            CommunicationSpi commSpi = cfg.getCommunicationSpi();
+            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
+            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
+            CollisionSpi colSpi = cfg.getCollisionSpi();
+            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
+            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
+            FailoverSpi[] failSpi = cfg.getFailoverSpi();
+            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
+            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
+            IndexingSpi indexingSpi = cfg.getIndexingSpi();
+
+            if (commSpi == null)
+                commSpi = new TcpCommunicationSpi();
+
+            if (discoSpi == null)
+                discoSpi = new TcpDiscoverySpi();
+
+            if (discoSpi instanceof TcpDiscoverySpi) {
+                TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)discoSpi;
+
+                if (tcpDisco.getIpFinder() == null)
+                    tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
+            }
+
+            if (evtSpi == null)
+                evtSpi = new MemoryEventStorageSpi();
+
+            if (colSpi == null)
+                colSpi = new NoopCollisionSpi();
+
+            if (deploySpi == null)
+                deploySpi = new LocalDeploymentSpi();
+
+            if (cpSpi == null)
+                cpSpi = new CheckpointSpi[] {new NoopCheckpointSpi()};
+
+            if (failSpi == null)
+                failSpi = new FailoverSpi[] {new AlwaysFailoverSpi()};
+
+            if (loadBalancingSpi == null)
+                loadBalancingSpi = new LoadBalancingSpi[] {new RoundRobinLoadBalancingSpi()};
+
+            if (swapspaceSpi == null) {
+                boolean needSwap = false;
+
+                CacheConfiguration[] caches = cfg.getCacheConfiguration();
+
+                if (caches != null) {
+                    for (CacheConfiguration c : caches) {
+                        if (c.isSwapEnabled()) {
+                            needSwap = true;
+
+                            break;
+                        }
+                    }
+                }
+
+                swapspaceSpi = needSwap ? new FileSwapSpaceSpi() : new NoopSwapSpaceSpi();
+            }
+
+            if (indexingSpi == null)
+                indexingSpi = new NoopIndexingSpi();
+
+            myCfg.setCommunicationSpi(commSpi);
+            myCfg.setDiscoverySpi(discoSpi);
+            myCfg.setCheckpointSpi(cpSpi);
+            myCfg.setEventStorageSpi(evtSpi);
+            myCfg.setDeploymentSpi(deploySpi);
+            myCfg.setFailoverSpi(failSpi);
+            myCfg.setCollisionSpi(colSpi);
+            myCfg.setLoadBalancingSpi(loadBalancingSpi);
+            myCfg.setSwapSpaceSpi(swapspaceSpi);
+            myCfg.setIndexingSpi(indexingSpi);
+
+            // Ensure that SPIs support multiple grid instances, if required.
+            if (!singleGrid) {
+                ensureMultiInstanceSupport(deploySpi);
+                ensureMultiInstanceSupport(commSpi);
+                ensureMultiInstanceSupport(discoSpi);
+                ensureMultiInstanceSupport(cpSpi);
+                ensureMultiInstanceSupport(evtSpi);
+                ensureMultiInstanceSupport(colSpi);
+                ensureMultiInstanceSupport(failSpi);
+                ensureMultiInstanceSupport(loadBalancingSpi);
+                ensureMultiInstanceSupport(swapspaceSpi);
+            }
+        }
+
         /**
          * @param cfgLog Configured logger.
          * @param nodeId Local node ID.


[32/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ba010da4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ba010da4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ba010da4

Branch: refs/heads/ignite-368
Commit: ba010da403a0425f6d0ccfe006e41e1997bbbf9f
Parents: 8476463 036bd71
Author: ivasilinets <va...@gmail.com>
Authored: Sun Mar 1 15:26:27 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Sun Mar 1 15:26:27 2015 +0300

----------------------------------------------------------------------
 .../store/CacheNodeWithStoreStartup.java        |   6 +-
 .../store/jdbc/CacheJdbcPersonStore.java        | 115 +++++++------------
 .../apache/ignite/cache/store/CacheStore.java   |   4 +-
 .../ignite/cache/store/CacheStoreAdapter.java   |   2 +-
 .../ignite/cache/store/CacheStoreSession.java   |  17 ++-
 .../apache/ignite/internal/GridProperties.java  |  78 -------------
 .../ignite/internal/GridUpdateNotifier.java     |   2 +-
 .../apache/ignite/internal/IgniteKernal.java    |  18 +--
 .../ignite/internal/IgniteProperties.java       |  79 +++++++++++++
 .../ignite/internal/IgniteVersionUtils.java     |   8 +-
 .../processors/cache/GridCacheStoreManager.java |   6 +-
 .../plugin/IgnitePluginProcessor.java           |  24 ++++
 .../apache/ignite/plugin/PluginProvider.java    |   5 +
 .../internal/GridUpdateNotifierSelfTest.java    |   2 +-
 .../junits/cache/TestCacheSession.java          |   5 +
 .../cache/TestThreadLocalCacheSession.java      |   5 +
 .../HibernateReadWriteAccessStrategy.java       |  81 ++++++++++---
 17 files changed, 264 insertions(+), 193 deletions(-)
----------------------------------------------------------------------



[44/50] incubator-ignite git commit: # MInor JavADoc change.

Posted by ak...@apache.org.
# MInor JavADoc change.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/235758cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/235758cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/235758cd

Branch: refs/heads/ignite-368
Commit: 235758cd98f4aca320a6f9c07c5d90ddb956d796
Parents: b0e6ab1
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Mar 2 17:44:16 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Mar 2 17:44:16 2015 +0300

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/ignite/IgniteCluster.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/235758cd/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
index 8669559..c24ba5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
@@ -28,10 +28,10 @@ import java.util.*;
 import java.util.concurrent.*;
 
 /**
- * {@code GridCluster} also provides a handle on {@link #nodeLocalMap()} which provides map-like functionality
- * linked to current grid node. Node-local map is useful for saving shared state between job executions
- * on the grid. Additionally you can also ping, start, and restart remote nodes, map keys to caching nodes,
- * and get other useful information about topology.
+ * Represents whole cluster (all available nodes) and also provides a handle on {@link #nodeLocalMap()} which
+ * provides map-like functionality linked to current grid node. Node-local map is useful for saving shared state
+ * between job executions on the grid. Additionally you can also ping, start, and restart remote nodes, map keys to
+ * caching nodes, and get other useful information about topology.
  */
 public interface IgniteCluster extends ClusterGroup, IgniteAsyncSupport {
     /**


[10/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-136

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-136


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8d0f1b8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8d0f1b8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8d0f1b8b

Branch: refs/heads/ignite-368
Commit: 8d0f1b8b388044374882cbf2baba2bbcd6854bc2
Parents: 23338a4 dd51ef5
Author: sboikov <sb...@gridgain.com>
Authored: Wed Feb 25 09:15:19 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Feb 25 09:15:19 2015 +0300

----------------------------------------------------------------------
 .../ignite/codegen/MessageCodeGenerator.java    |  28 +-
 .../processors/cache/GridCacheMapEntry.java     | 562 +++++++++++--------
 .../GridDistributedTxRemoteAdapter.java         |  66 +--
 .../dht/atomic/GridDhtAtomicCache.java          |  44 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  84 +--
 .../distributed/near/GridNearAtomicCache.java   |   3 -
 .../cache/transactions/IgniteTxAdapter.java     |  58 +-
 .../cache/transactions/IgniteTxEntry.java       |  12 +-
 .../transactions/IgniteTxLocalAdapter.java      |  48 +-
 .../cache/version/GridCacheVersion.java         |   3 +-
 .../GridCacheVersionConflictContext.java        |  35 +-
 .../cache/version/GridCacheVersionEx.java       |   2 +-
 .../dr/GridDrDataLoadCacheUpdater.java          |   6 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../near/IgniteCacheNearReadCommittedTest.java  |   3 +
 .../ignite/testsuites/IgniteCacheTestSuite.java |   3 +-
 .../client/hadoop/GridHadoopClientProtocol.java |   3 +-
 .../hadoop/GridHadoopDefaultJobInfo.java        |   5 +-
 18 files changed, 535 insertions(+), 432 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d0f1b8b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d0f1b8b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------


[26/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1689a203
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1689a203
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1689a203

Branch: refs/heads/ignite-368
Commit: 1689a203b0dca44b2435e676d5c2c9c9c3fda095
Parents: 4f0feee dd66167
Author: sboikov <sb...@gridgain.com>
Authored: Fri Feb 27 17:16:36 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Feb 27 17:16:36 2015 +0300

----------------------------------------------------------------------
 config/hadoop/default-config.xml                |  12 +
 .../src/main/java/org/apache/ignite/Ignite.java |   4 +-
 .../configuration/QueryConfiguration.java       |  37 +-
 .../java/org/apache/ignite/igfs/IgfsMode.java   |   6 +-
 .../config/GridTestProperties.java              |  10 +-
 .../client/hadoop/GridHadoopClientProtocol.java |   6 +-
 .../hadoop/IgfsHadoopFileSystemWrapper.java     | 412 ++++++++++++++++++
 .../igfs/hadoop/v1/IgfsHadoopFileSystem.java    |   3 +-
 .../igfs/hadoop/v2/IgfsHadoopFileSystem.java    |   3 +-
 .../igfs/hadoop/IgfsHadoopFSProperties.java     |  10 +-
 .../hadoop/IgfsHadoopFileSystemWrapper.java     | 413 -------------------
 .../internal/igfs/hadoop/IgfsHadoopReader.java  |   2 +-
 .../internal/igfs/hadoop/IgfsHadoopUtils.java   |   4 +-
 .../hadoop/GridHadoopClassLoader.java           |  12 +-
 .../processors/hadoop/GridHadoopSetup.java      |   8 +-
 .../processors/hadoop/GridHadoopUtils.java      |   4 +-
 .../collections/GridHadoopHashMultimapBase.java |   2 +-
 .../GridHadoopExternalCommunication.java        |  14 +-
 .../hadoop/v1/GridHadoopV1MapTask.java          |   6 +-
 .../v2/GridHadoopV2JobResourceManager.java      |   2 +-
 .../GridHadoopClientProtocolSelfTest.java       |   6 +-
 .../apache/ignite/igfs/IgfsEventsTestSuite.java |   2 +-
 .../IgfsHadoop20FileSystemAbstractSelfTest.java |   2 +-
 .../igfs/IgfsHadoopDualAbstractSelfTest.java    |   2 +-
 .../IgfsHadoopFileSystemAbstractSelfTest.java   |   1 +
 ...fsHadoopFileSystemSecondaryModeSelfTest.java |   2 +-
 .../hadoop/GridHadoopGroupingTest.java          |   4 +-
 .../igfs/IgfsPerformanceBenchmark.java          |   9 +-
 28 files changed, 530 insertions(+), 468 deletions(-)
----------------------------------------------------------------------



[08/50] incubator-ignite git commit: IGNITE-136 Entry remove from local store when partitioned evicted and entries putted to local when partitioned exchange occurred.

Posted by ak...@apache.org.
IGNITE-136 Entry remove from local store when partitioned evicted and entries putted  to local when partitioned exchange occurred.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c3b7db8e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c3b7db8e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c3b7db8e

Branch: refs/heads/ignite-368
Commit: c3b7db8eacb778d6ab303265941f59cf5094115a
Parents: e86c69e
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Feb 20 13:05:16 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Feb 24 10:31:35 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   9 +
 .../distributed/dht/GridDhtLocalPartition.java  |   3 +
 .../GridCacheAbstractLocalStoreSelfTest.java    | 314 +++++++++++++++++++
 .../GridCachePartitionedLocalStoreSelfTest.java |  51 +++
 .../GridCacheReplicatedLocalStoreSelfTest.java  |  51 +++
 ...ridCacheTxPartitionedLocalStoreSelfTest.java |  51 +++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   3 +
 7 files changed, 482 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/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 18fce53..c9e95d8 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
@@ -3130,6 +3130,15 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
                     cctx.dataStructures().onEntryUpdated(key, false);
                 }
 
+                if (cctx.store().isLocalStore()) {
+                    if (val != null || valBytes != null) {
+                        if (val == null)
+                            val = cctx.marshaller().<V>unmarshal(valBytes, cctx.deploy().globalLoader());
+
+                        cctx.store().putToStore(null, key, val, ver);
+                    }
+                }
+
                 return true;
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index af63307..f8af7dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -538,6 +538,9 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
                 if (cached.clearInternal(clearVer, swap)) {
                     it.remove();
 
+                    if (cctx.store().isLocalStore())
+                        cctx.store().removeFromStore(null, cached.key());
+
                     if (!cached.isInternal()) {
                         mapPubSize.decrement();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
new file mode 100644
index 0000000..ef33797
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -0,0 +1,314 @@
+/*
+ * 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.cache.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.processors.cache.store.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import javax.cache.configuration.*;
+import javax.cache.integration.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CachePreloadMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
+/**
+ *
+ */
+public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbstractTest {
+    /** */
+    public static final TestLocalStore<Integer, Integer> LOCAL_STORE_1 = new TestLocalStore<>();
+
+    /** */
+    public static final TestLocalStore<Integer, Integer> LOCAL_STORE_2 = new TestLocalStore<>();
+
+    /** */
+    public static final TestLocalStore<Integer, Integer> LOCAL_STORE_3 = new TestLocalStore<>();
+
+    /** */
+    public static final int KEYS = 1000;
+
+    /** */
+    public static final String BACKUP_CACHE = "backup";
+
+    /**
+     *
+     */
+    public GridCacheAbstractLocalStoreSelfTest() {
+        super(false /* doesn't start grid */);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration cacheCfg = cache(gridName, null, 0);
+
+        CacheConfiguration cacheBackupCfg = cache(gridName, BACKUP_CACHE, 2);
+
+        cfg.setCacheConfiguration(cacheCfg, cacheBackupCfg);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    private CacheConfiguration cache(String gridName, String cacheName, int backups) {
+        CacheConfiguration cacheCfg = new CacheConfiguration();
+
+        cacheCfg.setName(cacheName);
+        cacheCfg.setCacheMode(getCacheMode());
+        cacheCfg.setAtomicityMode(getAtomicMode());
+        cacheCfg.setDistributionMode(getDisrtMode());
+        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        cacheCfg.setPreloadMode(SYNC);
+
+        if (gridName.endsWith("1"))
+            cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory<CacheStore>(LOCAL_STORE_1));
+        else if (gridName.endsWith("2"))
+            cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory<CacheStore>(LOCAL_STORE_2));
+        else
+            cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory<CacheStore>(LOCAL_STORE_3));
+
+        cacheCfg.setWriteThrough(true);
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteBehindBatchSize(1);
+        cacheCfg.setWriteBehindFlushFrequency(1);
+        cacheCfg.setWriteBehindFlushSize(1);
+        cacheCfg.setBackups(backups);
+        return cacheCfg;
+    }
+
+    /**
+     * @return Distribution mode.
+     */
+    protected abstract CacheDistributionMode getDisrtMode();
+
+    /**
+     * @return Cache atomicity mode.
+     */
+    protected abstract CacheAtomicityMode getAtomicMode();
+
+    /**
+     * @return Cache mode.
+     */
+    protected abstract CacheMode getCacheMode();
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPrimaryNode() throws Exception {
+        Ignite ignite1 = startGrid(1);
+
+        IgniteCache<Object, Object> cache = ignite1.jcache(null);
+
+        for (int i = 0; i < KEYS; i++)
+            cache.put(i, i);
+
+        for (int i = 0; i < KEYS; i++)
+            assertEquals(LOCAL_STORE_1.load(i).get1().intValue(), i);
+
+        final CountDownLatch startPartExchange = new CountDownLatch(1);
+        final AtomicBoolean eventOcr = new AtomicBoolean(true);
+
+        if (getCacheMode() != REPLICATED) {
+            ignite1.events().localListen(new IgnitePredicate<Event>() {
+                @Override public boolean apply(Event event) {
+                    startPartExchange.countDown();
+                    eventOcr.set(true);
+
+                    return true;
+                }
+            }, EventType.EVT_CACHE_PRELOAD_OBJECT_UNLOADED);
+        }
+
+        Ignite ignite2 = startGrid(2);
+
+        assertEquals(Ignition.allGrids().size(), 2);
+
+        // Wait when partition unloaded.
+        waitExpirePartition(startPartExchange, eventOcr);
+
+        checkLocalStore(ignite1, LOCAL_STORE_1);
+        checkLocalStore(ignite2, LOCAL_STORE_2);
+    }
+
+    /**
+     * Wait when partition unloaded.
+     */
+    private void waitExpirePartition(CountDownLatch startPartExchange, AtomicBoolean eventOcr) throws Exception {
+        if (getCacheMode() != REPLICATED) {
+            assert startPartExchange.await(1, TimeUnit.SECONDS);
+
+            while (true) {
+                if (eventOcr.get()) {
+                    eventOcr.set(false);
+
+                    TimeUnit.MILLISECONDS.sleep(100);
+                }
+                else
+                    break;
+            }
+        }
+    }
+
+    public void testBackupNode() throws Exception {
+        Ignite ignite1 = startGrid(1);
+
+        IgniteCache<Object, Object> cache = ignite1.jcache(BACKUP_CACHE);
+
+        for (int i = 0; i < KEYS; i++)
+            cache.put(i, i);
+
+        for (int i = 0; i < KEYS; i++)
+            assertEquals(LOCAL_STORE_1.load(i).get1().intValue(), i);
+
+        // Start 2'nd node.
+        Ignite ignite2 = startGrid(2);
+
+        assertEquals(2, Ignition.allGrids().size());
+
+        checkLocalStoreForBackup(ignite2, LOCAL_STORE_2);
+
+        // Start 3'nd node.
+        Ignite ignite3 = startGrid(3);
+
+        assertEquals(Ignition.allGrids().size(), 3);
+
+        for (int i = 0; i < KEYS; i++)
+            cache.put(i, i * 3);
+
+        checkLocalStoreForBackup(ignite2, LOCAL_STORE_2);
+        checkLocalStoreForBackup(ignite3, LOCAL_STORE_3);
+
+        // Stop 3'nd node.
+        stopGrid(3, true);
+
+        assertEquals(Ignition.allGrids().size(), 2);
+
+        checkLocalStoreForBackup(ignite2, LOCAL_STORE_2);
+    }
+
+    /**
+     * Check that local stores contains only primary entry.
+     */
+    private void checkLocalStore(Ignite ignite, CacheStore<Integer, IgniteBiTuple<Integer, ?>> store) {
+        for (int i = 0; i < KEYS; i++) {
+            if (ignite.affinity(null).isPrimary(ignite.cluster().localNode(), i))
+                assertEquals(store.load(i).get1().intValue(), i);
+            else if (!ignite.affinity(null).isPrimaryOrBackup(ignite.cluster().localNode(), i))
+                assertNull(store.load(i));
+        }
+    }
+
+    /**
+     * Check that local stores contains only primary entry.
+     */
+    private void checkLocalStoreForBackup(Ignite ignite, CacheStore<Integer, IgniteBiTuple<Integer, ?>> store) {
+        for (int i = 0; i < KEYS; i++) {
+            if (ignite.affinity(BACKUP_CACHE).isBackup(ignite.cluster().localNode(), i))
+                assertEquals(store.load(i).get1().intValue(), i);
+            else if (!ignite.affinity(BACKUP_CACHE).isPrimaryOrBackup(ignite.cluster().localNode(), i))
+                assertNull(store.load(i).get1());
+        }
+    }
+
+    /**
+     *
+     */
+    @CacheLocalStore
+    public static class TestLocalStore<K, V> implements CacheStore<K, IgniteBiTuple<V, ?>> {
+        /** */
+        private Map<K, IgniteBiTuple<V, ?>> map = new ConcurrentHashMap<>();
+
+        /** {@inheritDoc} */
+        @Override public void loadCache(IgniteBiInClosure<K, IgniteBiTuple<V, ?>> clo, @Nullable Object... args)
+            throws CacheLoaderException {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void txEnd(boolean commit) throws CacheWriterException {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public IgniteBiTuple<V, ?> load(K key) throws CacheLoaderException {
+            return map.get(key);
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<K, IgniteBiTuple<V, ?>> loadAll(Iterable<? extends K> keys) throws CacheLoaderException {
+            Map<K, IgniteBiTuple<V, ?>> res = new HashMap<>();
+
+            for (K key : keys) {
+                IgniteBiTuple<V, ?> val = map.get(key);
+
+                if (val != null)
+                    res.put(key, val);
+            }
+
+            return res;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void write(Cache.Entry<? extends K, ? extends IgniteBiTuple<V, ?>> entry)
+            throws CacheWriterException {
+            map.put(entry.getKey(), entry.getValue());
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeAll(Collection<Cache.Entry<? extends K, ? extends IgniteBiTuple<V, ?>>> entries)
+            throws CacheWriterException {
+            for (Cache.Entry<? extends K, ? extends IgniteBiTuple<V, ?>> e : entries)
+                map.put(e.getKey(), e.getValue());
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(Object key) throws CacheWriterException {
+            map.remove(key);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void deleteAll(Collection<?> keys) throws CacheWriterException {
+            for (Object key : keys)
+                map.remove(key);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
new file mode 100644
index 0000000..d2dfcf0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedLocalStoreSelfTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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 static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class GridCachePartitionedLocalStoreSelfTest extends GridCacheAbstractLocalStoreSelfTest {
+    /**
+     *
+     */
+    public GridCachePartitionedLocalStoreSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDisrtMode() {
+        return PARTITIONED_ONLY;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return PARTITIONED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
new file mode 100644
index 0000000..2d43d13
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedLocalStoreSelfTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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 static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class GridCacheReplicatedLocalStoreSelfTest extends GridCacheAbstractLocalStoreSelfTest {
+    /**
+     *
+     */
+    public GridCacheReplicatedLocalStoreSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDisrtMode() {
+        return PARTITIONED_ONLY;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return REPLICATED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
new file mode 100644
index 0000000..e031102
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTxPartitionedLocalStoreSelfTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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 static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class GridCacheTxPartitionedLocalStoreSelfTest extends GridCacheAbstractLocalStoreSelfTest {
+    /**
+     *
+     */
+    public GridCacheTxPartitionedLocalStoreSelfTest() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheDistributionMode getDisrtMode() {
+        return PARTITIONED_ONLY;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode getAtomicMode() {
+        return TRANSACTIONAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode getCacheMode() {
+        return PARTITIONED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3b7db8e/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index df9ffab..b2f6137 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -138,6 +138,9 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTestSuite(GridCacheOffHeapTieredAtomicSelfTest.class);
         suite.addTestSuite(GridCacheOffHeapTieredSelfTest.class);
         suite.addTestSuite(GridCacheGlobalLoadTest.class);
+        suite.addTestSuite(GridCachePartitionedLocalStoreSelfTest.class);
+        suite.addTestSuite(GridCacheReplicatedLocalStoreSelfTest.class);
+        //suite.addTestSuite(GridCacheTxPartitionedLocalStoreSelfTest.class); TODO GG-9762
 
         // Heuristic exception handling. TODO IGNITE-257
 //        suite.addTestSuite(GridCacheColocatedTxExceptionSelfTest.class);


[48/50] incubator-ignite git commit: Merge branch 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into sprint-2

Posted by ak...@apache.org.
Merge branch 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b2675bc3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b2675bc3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b2675bc3

Branch: refs/heads/ignite-368
Commit: b2675bc3a6875c462e3d0aeb1478ee4d72039c44
Parents: 9a93198 3b309f2
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Mar 2 17:50:47 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Mar 2 17:50:47 2015 +0300

----------------------------------------------------------------------
 examples/pom-standalone.xml                       | 2 +-
 modules/core/src/main/resources/ignite.properties | 2 +-
 pom.xml                                           | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[25/50] incubator-ignite git commit: #ignite-239: small fixes.

Posted by ak...@apache.org.
#ignite-239: small fixes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4f0feeec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4f0feeec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4f0feeec

Branch: refs/heads/ignite-368
Commit: 4f0feeecb8c4c48ee7e7ffe4679ff0ac28ef3a0b
Parents: 5830deb
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 16:15:17 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 16:15:17 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 72 ++++++++++----------
 1 file changed, 37 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f0feeec/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 32a3d71..f39cd7e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -119,9 +119,6 @@ public class IgnitionEx {
     /** */
     private static volatile boolean daemon;
 
-    /** */
-    private static final String[] EMPTY_STR_ARR = new String[0];
-
     /**
      * Checks runtime version to be 1.7.x or 1.8.x.
      * This will load pretty much first so we must do these checks here.
@@ -1138,6 +1135,9 @@ public class IgnitionEx {
         private static final Map<MBeanServer, GridMBeanServerData> mbeans =
             new HashMap<>();
 
+        /** */
+        private static final String[] EMPTY_STR_ARR = new String[0];
+
         /** Grid name. */
         private final String name;
 
@@ -1297,6 +1297,17 @@ public class IgnitionEx {
 
             IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new IgniteConfiguration();
 
+            String ggHome = cfg.getIgniteHome();
+
+            // Set Ignite home.
+            if (ggHome == null)
+                ggHome = U.getIgniteHome();
+            else
+                // If user provided IGNITE_HOME - set it as a system property.
+                U.setIgniteHome(ggHome);
+
+            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
+
             // Ensure invariant.
             // It's a bit dirty - but this is a result of late refactoring
             // and I don't want to reshuffle a lot of code.
@@ -1317,20 +1328,18 @@ public class IgnitionEx {
 
             log = cfgLog.getLogger(G.class);
 
-            IgniteConfiguration myCfg = initializeDefaultConfiguration(cfg);
-
-            myCfg.setGridLogger(cfgLog);
+            // Check Ignite home folder (after log is available).
+            if (ggHome != null) {
+                File ggHomeFile = new File(ggHome);
 
-            if (myCfg.getConnectorConfiguration() != null) {
-                restExecSvc = new IgniteThreadPoolExecutor(
-                    "rest-" + cfg.getGridName(),
-                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
-                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
-                    ConnectorConfiguration.DFLT_KEEP_ALIVE_TIME,
-                    new LinkedBlockingQueue<Runnable>(ConnectorConfiguration.DFLT_THREADPOOL_QUEUE_CAP)
-                );
+                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
+                    throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
             }
 
+            IgniteConfiguration myCfg = initializeConfiguration(cfg);
+
+            myCfg.setGridLogger(cfgLog);
+
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1417,6 +1426,16 @@ public class IgnitionEx {
                 0,
                 new LinkedBlockingQueue<Runnable>());
 
+            if (myCfg.getConnectorConfiguration() != null) {
+                restExecSvc = new IgniteThreadPoolExecutor(
+                    "rest-" + myCfg.getGridName(),
+                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
+                    myCfg.getConnectorConfiguration().getThreadPoolSize(),
+                    ConnectorConfiguration.DFLT_KEEP_ALIVE_TIME,
+                    new LinkedBlockingQueue<Runnable>(ConnectorConfiguration.DFLT_THREADPOOL_QUEUE_CAP)
+                );
+            }
+
             utilityCacheExecSvc = new IgniteThreadPoolExecutor(
                 "utility-" + cfg.getGridName(),
                 DFLT_SYSTEM_CORE_THREAD_CNT,
@@ -1499,10 +1518,12 @@ public class IgnitionEx {
          * @param cfg Ignite configuration copy to.
          * @return New ignite configuration.
          */
-        private IgniteConfiguration initializeDefaultConfiguration(IgniteConfiguration cfg)
+        private IgniteConfiguration initializeConfiguration(IgniteConfiguration cfg)
             throws IgniteCheckedException {
             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
+
             initializeDefaultConfigurationParameters(myCfg);
+
             return myCfg;
         }
 
@@ -1510,26 +1531,7 @@ public class IgnitionEx {
          * Initialize default parameters.
          */
         public void initializeDefaultConfigurationParameters(IgniteConfiguration cfg) throws IgniteCheckedException {
-            // Set Ignite home.
-            String ggHome = cfg.getIgniteHome();
-
-            if (ggHome == null)
-                ggHome = U.getIgniteHome();
-            else
-                // If user provided IGNITE_HOME - set it as a system property.
-                U.setIgniteHome(ggHome);
-
-            U.setWorkDirectory(cfg.getWorkDirectory(), ggHome);
-
-            // Check Ignite home folder (after log is available).
-            if (ggHome != null) {
-                File ggHomeFile = new File(ggHome);
-
-                if (!ggHomeFile.exists() || !ggHomeFile.isDirectory())
-                    throw new IgniteCheckedException("Invalid Ignite installation home folder: " + ggHome);
-            }
-
-            cfg.setIgniteHome(ggHome);
+            cfg.setIgniteHome(U.getIgniteHome());
 
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);


[38/50] incubator-ignite git commit: sprint-2 fix for ignite-321

Posted by ak...@apache.org.
sprint-2 fix for ignite-321


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/11efb918
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/11efb918
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/11efb918

Branch: refs/heads/ignite-368
Commit: 11efb91874a547c408dcac58f0651725ad518abe
Parents: 3be22ab
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Mar 2 16:36:02 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Mar 2 16:36:02 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheStoreManager.java | 12 ++++----
 .../GridDistributedCacheAdapter.java            |  2 ++
 .../dataload/IgniteDataLoaderImpl.java          | 29 +++++++++++++++-----
 3 files changed, 30 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/11efb918/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
index 9262a8f..c768f54 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
@@ -616,6 +616,9 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> {
                     handleClassCastException(e);
                 }
                 catch (Exception e) {
+                    if (!(e instanceof CacheWriterException))
+                        e = new CacheWriterException(e);
+
                     if (!entries.isEmpty()) {
                         List<Object> keys = new ArrayList<>(entries.size());
 
@@ -625,9 +628,6 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> {
                         throw new CacheStorePartialUpdateException(keys, e);
                     }
 
-                    if (!(e instanceof CacheWriterException))
-                        e = new CacheWriterException(e);
-
                     throw new IgniteCheckedException(e);
                 }
                 finally {
@@ -725,12 +725,12 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K, V> {
                 handleClassCastException(e);
             }
             catch (Exception e) {
-                if (!keys0.isEmpty())
-                    throw new CacheStorePartialUpdateException(keys0, e);
-
                 if (!(e instanceof CacheWriterException))
                     e = new CacheWriterException(e);
 
+                if (!keys0.isEmpty())
+                    throw new CacheStorePartialUpdateException(keys0, e);
+
                 throw new IgniteCheckedException(e);
             }
             finally {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/11efb918/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index dc82e83..00190d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -277,6 +277,8 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter
                     dht = (GridDhtCacheAdapter<K, V>)cacheAdapter;
 
                 try (IgniteDataLoader<K, V> dataLdr = ignite.dataLoader(cacheName)) {
+                    ((IgniteDataLoaderImpl)dataLdr).maxRemapCount(0);
+
                     dataLdr.updater(GridDataLoadCacheUpdaters.<K, V>batched());
 
                     for (GridDhtLocalPartition<K, V> locPart : dht.topology().currentLocalPartitions()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/11efb918/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
index ced8d1d..ed3bbcb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
@@ -66,7 +66,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
     private byte[] updaterBytes;
 
     /** Max remap count before issuing an error. */
-    private static final int MAX_REMAP_CNT = 32;
+    private static final int DFLT_MAX_REMAP_CNT = 32;
 
     /** Log reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
@@ -156,6 +156,9 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
     /** */
     private boolean skipStore;
 
+    /** */
+    private int maxRemapCnt = DFLT_MAX_REMAP_CNT;
+
     /**
      * @param ctx Grid kernal context.
      * @param cacheName Cache name.
@@ -434,12 +437,6 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
     ) {
         assert entries != null;
 
-        if (remaps >= MAX_REMAP_CNT) {
-            resFut.onDone(new IgniteCheckedException("Failed to finish operation (too many remaps): " + remaps));
-
-            return;
-        }
-
         Map<ClusterNode, Collection<Map.Entry<K, V>>> mappings = new HashMap<>();
 
         boolean initPda = ctx.deploy().enabled() && jobPda == null;
@@ -526,6 +523,10 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
                             resFut.onDone(new IgniteCheckedException("Data loader has been cancelled: " +
                                 IgniteDataLoaderImpl.this, e1));
                         }
+                        else if (remaps + 1 > maxRemapCnt) {
+                            resFut.onDone(new IgniteCheckedException("Failed to finish operation (too many remaps): "
+                                + remaps), e1);
+                        }
                         else
                             load0(entriesForNode, resFut, activeKeys, remaps + 1);
                     }
@@ -760,6 +761,20 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
         close(false);
     }
 
+    /**
+     * @return Max remap count.
+     */
+    public int maxRemapCount() {
+        return maxRemapCnt;
+    }
+
+    /**
+     * @param maxRemapCnt New max remap count.
+     */
+    public void maxRemapCount(int maxRemapCnt) {
+        this.maxRemapCnt = maxRemapCnt;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgniteDataLoaderImpl.class, this);


[47/50] incubator-ignite git commit: Merge branch 'ignite-382' into sprint-2

Posted by ak...@apache.org.
Merge branch 'ignite-382' into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3b309f25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3b309f25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3b309f25

Branch: refs/heads/ignite-368
Commit: 3b309f250e872fff4ea290fb2b8acb7388fadfb2
Parents: 028e446 f252ee4
Author: anovikov <an...@gridgain.com>
Authored: Mon Mar 2 21:48:07 2015 +0700
Committer: anovikov <an...@gridgain.com>
Committed: Mon Mar 2 21:48:07 2015 +0700

----------------------------------------------------------------------
 examples/pom-standalone.xml                       | 2 +-
 modules/core/src/main/resources/ignite.properties | 2 +-
 pom.xml                                           | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[31/50] incubator-ignite git commit: #ignite-239: review.

Posted by ak...@apache.org.
#ignite-239: 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/8476463b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8476463b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8476463b

Branch: refs/heads/ignite-368
Commit: 8476463b9145eff58d28da7e57d83d96e50a066c
Parents: 4ff4fd1
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 18:17:07 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 18:17:07 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/internal/IgnitionEx.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8476463b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 6b8b197..c7e7cb6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1306,8 +1306,6 @@ public class IgnitionEx {
             // and I don't want to reshuffle a lot of code.
             assert F.eq(name, cfg.getGridName());
 
-            IgniteConfiguration myCfg = initializeConfiguration(cfg);
-
             // Validate segmentation configuration.
             GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
 
@@ -1318,6 +1316,8 @@ public class IgnitionEx {
                     "on start?) [segPlc=" + segPlc + ", wait=false]");
             }
 
+            IgniteConfiguration myCfg = initializeConfiguration(cfg);
+
             // Ensure that SPIs support multiple grid instances, if required.
             if (!startCtx.single()) {
                 ensureMultiInstanceSupport(myCfg.getDeploymentSpi());


[50/50] incubator-ignite git commit: # IGNITE-368 WIP.

Posted by ak...@apache.org.
# IGNITE-368 WIP.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c7fc2970
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c7fc2970
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c7fc2970

Branch: refs/heads/ignite-368
Commit: c7fc2970d344790566184776ed2b1406432c8304
Parents: e1c7e12
Author: AKuznetsov <ak...@gridgain.com>
Authored: Mon Mar 2 23:29:38 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Mon Mar 2 23:29:38 2015 +0700

----------------------------------------------------------------------
 .../hadoop/GridHadoopDefaultMapReducePlannerSelfTest.java       | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c7fc2970/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopDefaultMapReducePlannerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopDefaultMapReducePlannerSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopDefaultMapReducePlannerSelfTest.java
index b1b0275..0e10631 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopDefaultMapReducePlannerSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/GridHadoopDefaultMapReducePlannerSelfTest.java
@@ -1001,5 +1001,10 @@ public class GridHadoopDefaultMapReducePlannerSelfTest extends GridHadoopAbstrac
         @Override public String latestVersion() {
             return null;
         }
+
+        /** {@inheritDoc} */
+        @Override public GridKernalContext context() {
+            return null;
+        }
     }
 }


[15/50] incubator-ignite git commit: IGNITE-136 Fixed tests.

Posted by ak...@apache.org.
IGNITE-136 Fixed tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/96e449a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96e449a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96e449a7

Branch: refs/heads/ignite-368
Commit: 96e449a7dfce4385100058a99e0fecd30aeb9a4e
Parents: 8899128
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Feb 25 15:02:16 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Feb 25 15:02:16 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractLocalStoreSelfTest.java    | 48 ++++++++------------
 1 file changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96e449a7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index bf11c5f..781c6a6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -181,8 +181,6 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         checkLocalStore(ignite1, LOCAL_STORE_1);
 
-        final CountDownLatch partExchanged = new CountDownLatch(1);
-
         final AtomicInteger evtCnt = new AtomicInteger(0);
 
         if (getCacheMode() != REPLICATED) {
@@ -197,23 +195,21 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         final Ignite ignite2 = startGrid(2);
 
-        boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
-            @Override public boolean apply() {
-                // Partition count which must be transferred to 2'nd node.
-                int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+        if (getCacheMode() != REPLICATED) {
+            boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                @Override public boolean apply() {
+                    // Partition count which must be transferred to 2'nd node.
+                    int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
 
-                return evtCnt.get() >= parts;
-            }
-        }, 5000);
+                    return evtCnt.get() >= parts;
+                }
+            }, 5000);
 
-        assertTrue(wait);
+            assertTrue(wait);
+        }
 
         assertEquals(Ignition.allGrids().size(), 2);
 
-        // Wait when partition unloaded.
-        if (getCacheMode() != REPLICATED)
-            assert partExchanged.await(2, TimeUnit.SECONDS);
-
         checkLocalStore(ignite1, LOCAL_STORE_1);
         checkLocalStore(ignite2, LOCAL_STORE_2);
     }
@@ -279,8 +275,6 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
         for (int i = 0; i < KEYS; i++)
             assertNull(cache.localPeek(i, CachePeekMode.ONHEAP));
 
-        final CountDownLatch partExchanged = new CountDownLatch(1);
-
         final AtomicInteger evtCnt = new AtomicInteger(0);
 
         if (getCacheMode() != REPLICATED) {
@@ -295,23 +289,21 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         final Ignite ignite2 = startGrid(2);
 
-        boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
-            @Override public boolean apply() {
-                // Partition count which must be transferred to 2'nd node.
-                int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+        if (getCacheMode() != REPLICATED) {
+            boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                @Override public boolean apply() {
+                    // Partition count which must be transferred to 2'nd node.
+                    int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
 
-                return evtCnt.get() >= parts;
-            }
-        }, 5000);
+                    return evtCnt.get() >= parts;
+                }
+            }, 5000);
 
-        assertTrue(wait);
+            assertTrue(wait);
+        }
 
         assertEquals(Ignition.allGrids().size(), 2);
 
-        // Wait when partition unloaded.
-        if (getCacheMode() != REPLICATED)
-            assert partExchanged.await(2, TimeUnit.SECONDS);
-
         checkLocalStore(ignite1, LOCAL_STORE_1);
         checkLocalStore(ignite2, LOCAL_STORE_2);
     }


[14/50] incubator-ignite git commit: # ignite-136 review

Posted by ak...@apache.org.
# ignite-136 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/88991280
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/88991280
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/88991280

Branch: refs/heads/ignite-368
Commit: 8899128028dd3f84b93394f3ef425c24d73e8d67
Parents: f33c074
Author: sboikov <sb...@gridgain.com>
Authored: Wed Feb 25 14:43:16 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Feb 25 14:43:16 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractLocalStoreSelfTest.java    | 72 +++++++++++++-------
 ...chePartitionedOffHeapLocalStoreSelfTest.java |  2 +-
 2 files changed, 48 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/88991280/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index 9bf9bc4..bf11c5f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -24,10 +24,12 @@ import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.processors.cache.store.*;
+import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.lang.*;
 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.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
@@ -103,8 +105,12 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     }
 
     /**
-     * 
+     * @param gridName Grid name.
+     * @param cacheName Cache name.
+     * @param backups Number of backups.
+     * @return Configuration.
      */
+    @SuppressWarnings("unchecked")
     private CacheConfiguration cache(String gridName, String cacheName, int backups) {
         CacheConfiguration cacheCfg = new CacheConfiguration();
 
@@ -128,7 +134,7 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
         cacheCfg.setOffHeapMaxMemory(0);
         cacheCfg.setSwapEnabled(true);
 
-        if (isOffHeapTiredMode())
+        if (isOffHeapTieredMode())
             cacheCfg.setMemoryMode(OFFHEAP_TIERED);
 
         return cacheCfg;
@@ -150,9 +156,9 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     protected abstract CacheMode getCacheMode();
 
     /**
-     * @return Cache memory mode.
+     * @return {@code True} if {@link CacheMemoryMode#OFFHEAP_TIERED} memory mode should be used.
      */
-    protected boolean isOffHeapTiredMode() {
+    protected boolean isOffHeapTieredMode() {
         return false;
     }
 
@@ -177,25 +183,30 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         final CountDownLatch partExchanged = new CountDownLatch(1);
 
-        final int[] leftPartition = new int[1];
+        final AtomicInteger evtCnt = new AtomicInteger(0);
 
         if (getCacheMode() != REPLICATED) {
             ignite1.events().localListen(new IgnitePredicate<Event>() {
-                private AtomicInteger eventCnt = new AtomicInteger(0);
-                
-                @Override public boolean apply(Event event) {
-                    if (leftPartition[0] - eventCnt.incrementAndGet() == 0)
-                        partExchanged.countDown();
-                                            
+                @Override public boolean apply(Event evt) {
+                    evtCnt.incrementAndGet();
+
                     return true;
                 }
             }, EventType.EVT_CACHE_PRELOAD_PART_UNLOADED);
         }
 
-        Ignite ignite2 = startGrid(2);
+        final Ignite ignite2 = startGrid(2);
+
+        boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                // Partition count which must be transferred to 2'nd node.
+                int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
 
-        // Partition count which must be transferred to 2'nd node.
-        leftPartition[0] = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+                return evtCnt.get() >= parts;
+            }
+        }, 5000);
+
+        assertTrue(wait);
 
         assertEquals(Ignition.allGrids().size(), 2);
 
@@ -270,25 +281,30 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         final CountDownLatch partExchanged = new CountDownLatch(1);
 
-        final int[] leftPartition = new int[1];
+        final AtomicInteger evtCnt = new AtomicInteger(0);
 
         if (getCacheMode() != REPLICATED) {
             ignite1.events().localListen(new IgnitePredicate<Event>() {
-                private AtomicInteger eventCnt = new AtomicInteger(0);
-
-                @Override public boolean apply(Event event) {
-                    if (leftPartition[0] - eventCnt.incrementAndGet() == 0)
-                        partExchanged.countDown();
+                @Override public boolean apply(Event evt) {
+                    evtCnt.incrementAndGet();
 
                     return true;
                 }
             }, EventType.EVT_CACHE_PRELOAD_PART_UNLOADED);
         }
 
-        Ignite ignite2 = startGrid(2);
+        final Ignite ignite2 = startGrid(2);
+
+        boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                // Partition count which must be transferred to 2'nd node.
+                int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+
+                return evtCnt.get() >= parts;
+            }
+        }, 5000);
 
-        // Partition count which must be transferred to 2'nd node.
-        leftPartition[0] = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+        assertTrue(wait);
 
         assertEquals(Ignition.allGrids().size(), 2);
 
@@ -301,7 +317,10 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     }
 
     /**
-     * Check that local stores contains only primary entry.
+     * Checks that local stores contains only primary entry.
+     *
+     * @param ignite Ignite.
+     * @param store Store.
      */
     private void checkLocalStore(Ignite ignite, CacheStore<Integer, IgniteBiTuple<Integer, ?>> store) {
         for (int i = 0; i < KEYS; i++) {
@@ -313,7 +332,10 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
     }
 
     /**
-     * Check that local stores contains only primary entry.
+     * Checks that local stores contains only primary entry.
+     *
+     * @param ignite Ignite.
+     * @param store Store.
      */
     private void checkLocalStoreForBackup(Ignite ignite, CacheStore<Integer, IgniteBiTuple<Integer, ?>> store) {
         for (int i = 0; i < KEYS; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/88991280/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java
index 6dfc977..e61b4f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedOffHeapLocalStoreSelfTest.java
@@ -50,7 +50,7 @@ public class GridCachePartitionedOffHeapLocalStoreSelfTest extends GridCacheAbst
     }
 
     /** {@inheritDoc} */
-    @Override protected boolean isOffHeapTiredMode() {
+    @Override protected boolean isOffHeapTieredMode() {
         return true;
     }
 }


[24/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5830deb2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5830deb2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5830deb2

Branch: refs/heads/ignite-368
Commit: 5830deb20bf02705cb82203db074dfc2bb01473d
Parents: 3942853 4e7463d
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 16:04:40 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 16:04:40 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/IgniteFs.java   |   2 +-
 .../ignite/events/DiscoveryCustomEvent.java     |  56 --------
 .../org/apache/ignite/events/EventType.java     |  14 +-
 .../java/org/apache/ignite/igfs/package.html    |   2 +-
 .../internal/events/DiscoveryCustomEvent.java   |  68 +++++++++
 .../discovery/GridDiscoveryManager.java         |   7 +-
 .../cache/VisorCacheMetricsCollectorTask.java   |  10 +-
 .../visor/node/VisorBasicConfiguration.java     |  17 ---
 .../node/VisorNodeEventsCollectorTask.java      |  10 +-
 .../internal/visor/node/VisorNodeGcTask.java    |  10 +-
 .../internal/visor/node/VisorNodePingTask.java  |  10 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   9 +-
 .../internal/GridDiscoveryEventSelfTest.java    |   9 +-
 ...dStartupWithUndefinedIgniteHomeSelfTest.java | 103 ++++++++++++++
 .../testsuites/IgniteKernalSelfTestSuite.java   |   1 +
 .../java/org/apache/ignite/igfs/package.html    |   2 +-
 .../testsuites/IgniteHadoopTestSuite.java       |   7 +-
 .../commands/alert/VisorAlertCommand.scala      |   8 +-
 .../commands/cache/VisorCacheCommand.scala      |  82 +++++++----
 .../config/VisorConfigurationCommand.scala      | 140 ++++++++++---------
 .../commands/disco/VisorDiscoveryCommand.scala  |   2 +-
 .../scala/org/apache/ignite/visor/visor.scala   |  64 ++++++---
 .../commands/tasks/VisorTasksCommandSpec.scala  |   2 +-
 23 files changed, 392 insertions(+), 243 deletions(-)
----------------------------------------------------------------------



[34/50] incubator-ignite git commit: #ignite-239: small refactoring.

Posted by ak...@apache.org.
#ignite-239: small refactoring.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0dfe349c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0dfe349c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0dfe349c

Branch: refs/heads/ignite-368
Commit: 0dfe349c28e2fc24b3b2e092f4f36c1d63f84ff3
Parents: 55669d4
Author: ivasilinets <va...@gmail.com>
Authored: Sun Mar 1 21:21:11 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Sun Mar 1 21:21:11 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0dfe349c/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 9770205..c2c23f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1393,7 +1393,7 @@ public class IgnitionEx {
                 Class helperCls = Class.forName("org.apache.ignite.util.GridConfigurationHelper");
 
                 helperCls.getMethod("overrideConfiguration", IgniteConfiguration.class, Properties.class,
-                        String.class, IgniteLogger.class).invoke(helperCls, myCfg, System.getProperties(), name, log);
+                    String.class, IgniteLogger.class).invoke(helperCls, myCfg, System.getProperties(), name, log);
             }
             catch (Exception ignored) {
                 // No-op.
@@ -1522,14 +1522,14 @@ public class IgnitionEx {
             // for correct segment after segmentation happens.
             if (!F.isEmpty(cfg.getSegmentationResolvers()) && segPlc == RESTART_JVM && !cfg.isWaitForSegmentOnStart()) {
                 U.warn(log, "Found potential configuration problem (forgot to enable waiting for segment" +
-                        "on start?) [segPlc=" + segPlc + ", wait=false]");
+                    "on start?) [segPlc=" + segPlc + ", wait=false]");
             }
 
             myCfg.setTransactionConfiguration(myCfg.getTransactionConfiguration() != null ?
-                    new TransactionConfiguration(myCfg.getTransactionConfiguration()) : null);
+                new TransactionConfiguration(myCfg.getTransactionConfiguration()) : null);
 
             myCfg.setConnectorConfiguration(myCfg.getConnectorConfiguration() != null ?
-                    new ConnectorConfiguration(myCfg.getConnectorConfiguration()) : null);
+                new ConnectorConfiguration(myCfg.getConnectorConfiguration()) : null);
 
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
@@ -1546,7 +1546,7 @@ public class IgnitionEx {
             if (!F.isEmpty(depModeName)) {
                 if (!F.isEmpty(myCfg.getCacheConfiguration())) {
                     U.quietAndInfo(log, "Skipping deployment mode override for caches (custom closure " +
-                            "execution may not work for console Visor)");
+                        "execution may not work for console Visor)");
                 }
                 else {
                     try {
@@ -1557,8 +1557,8 @@ public class IgnitionEx {
                     }
                     catch (IllegalArgumentException e) {
                         throw new IgniteCheckedException("Failed to override deployment mode using system property " +
-                                "(are there any misspellings?)" +
-                                "[name=" + IGNITE_DEP_MODE_OVERRIDE + ", value=" + depModeName + ']', e);
+                            "(are there any misspellings?)" +
+                            "[name=" + IGNITE_DEP_MODE_OVERRIDE + ", value=" + depModeName + ']', e);
                     }
                 }
             }
@@ -1576,18 +1576,18 @@ public class IgnitionEx {
             if (marsh == null) {
                 if (!U.isHotSpot()) {
                     U.warn(log, "OptimizedMarshaller is not supported on this JVM " +
-                            "(only Java HotSpot VMs are supported). Switching to standard JDK marshalling - " +
-                            "object serialization performance will be significantly slower.",
+                        "(only Java HotSpot VMs are supported). Switching to standard JDK marshalling - " +
+                        "object serialization performance will be significantly slower.",
                         "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
 
                     marsh = new JdkMarshaller();
                 }
                 else if (!OptimizedMarshaller.available()) {
                     U.warn(log, "OptimizedMarshaller is not supported on this JVM " +
-                            "(only recent 1.6 and 1.7 versions HotSpot VMs are supported). " +
-                            "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release. " +
-                            "Switching to standard JDK marshalling - " +
-                            "object serialization performance will be significantly slower.",
+                        "(only recent 1.6 and 1.7 versions HotSpot VMs are supported). " +
+                        "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release. " +
+                        "Switching to standard JDK marshalling - " +
+                        "object serialization performance will be significantly slower.",
                         "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
 
                     marsh = new JdkMarshaller();
@@ -1597,7 +1597,7 @@ public class IgnitionEx {
             }
             else if (marsh instanceof OptimizedMarshaller && !U.isHotSpot()) {
                 U.warn(log, "Using OptimizedMarshaller on untested JVM (only Java HotSpot VMs were tested) - " +
-                        "object serialization behavior could yield unexpected results.",
+                    "object serialization behavior could yield unexpected results.",
                     "Using GridOptimizedMarshaller on untested JVM.");
             }
 


[09/50] incubator-ignite git commit: #IGNITE-136 Fixed test.

Posted by ak...@apache.org.
#IGNITE-136 Fixed test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/23338a4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/23338a4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/23338a4c

Branch: refs/heads/ignite-368
Commit: 23338a4c5f3f58a30ce6254c35602644f2222ca9
Parents: c3b7db8
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Feb 24 16:53:10 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Feb 24 16:53:35 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractLocalStoreSelfTest.java    | 26 +++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/23338a4c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index ef33797..4b647a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -24,6 +24,9 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.processors.cache.store.*;
 import org.apache.ignite.lang.*;
+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.jetbrains.annotations.*;
 
@@ -43,6 +46,9 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
  */
 public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbstractTest {
     /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+    
+    /** */
     public static final TestLocalStore<Integer, Integer> LOCAL_STORE_1 = new TestLocalStore<>();
 
     /** */
@@ -74,6 +80,12 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
 
         cfg.setCacheConfiguration(cacheCfg, cacheBackupCfg);
 
+        TcpDiscoverySpi spi = new TcpDiscoverySpi();
+
+        spi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(spi);
+
         return cfg;
     }
 
@@ -82,6 +94,10 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
         super.afterTest();
 
         stopAllGrids();
+
+        LOCAL_STORE_1.clear();
+        LOCAL_STORE_2.clear();
+        LOCAL_STORE_3.clear();
     }
 
     private CacheConfiguration cache(String gridName, String cacheName, int backups) {
@@ -151,6 +167,7 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
             ignite1.events().localListen(new IgnitePredicate<Event>() {
                 @Override public boolean apply(Event event) {
                     startPartExchange.countDown();
+
                     eventOcr.set(true);
 
                     return true;
@@ -174,7 +191,7 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
      */
     private void waitExpirePartition(CountDownLatch startPartExchange, AtomicBoolean eventOcr) throws Exception {
         if (getCacheMode() != REPLICATED) {
-            assert startPartExchange.await(1, TimeUnit.SECONDS);
+            assert startPartExchange.await(2, TimeUnit.SECONDS);
 
             while (true) {
                 if (eventOcr.get()) {
@@ -310,5 +327,12 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
             for (Object key : keys)
                 map.remove(key);
         }
+
+        /**
+         * Clear store.
+         */
+        public void clear(){
+            map.clear();
+        }
     }
 }


[41/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/sprint-2' into sprint-2

Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/sprint-2' into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/403d60fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/403d60fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/403d60fe

Branch: refs/heads/ignite-368
Commit: 403d60feed477a4598509b619b2f63de307b9b5b
Parents: 8baca04 9671471
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Mar 2 17:16:40 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Mar 2 17:16:40 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      |   5 +-
 .../org/apache/ignite/internal/IgnitionEx.java  | 592 +++++++++----------
 .../GridCacheQueueCleanupSelfTest.java          |   1 -
 3 files changed, 267 insertions(+), 331 deletions(-)
----------------------------------------------------------------------



[05/50] incubator-ignite git commit: #ignite-239: wip.

Posted by ak...@apache.org.
#ignite-239: wip.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7e2b2e25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7e2b2e25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7e2b2e25

Branch: refs/heads/ignite-368
Commit: 7e2b2e250ba70b5f936036d0d9003812f2a6d07d
Parents: 5dd1e80
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 20 17:07:15 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 20 17:07:15 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 58 ++++++++++----------
 1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e2b2e25/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 501ff90..34f29a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1302,12 +1302,7 @@ public class IgnitionEx {
         private void start0(GridStartContext startCtx) throws IgniteCheckedException {
             assert grid == null : "Grid is already started: " + name;
 
-            IgniteConfiguration cfg = startCtx.config();
-
-            if (cfg == null)
-                cfg = new IgniteConfiguration();
-
-            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
+            IgniteConfiguration cfg = startCtx.config() != null ? startCtx.config() : new IgniteConfiguration();
 
             String ggHome = cfg.getIgniteHome();
 
@@ -1329,6 +1324,8 @@ public class IgnitionEx {
             if (startCtx.configUrl() != null)
                 System.setProperty(IGNITE_CONFIG_URL, startCtx.configUrl().toString());
 
+            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
+
             myCfg.setGridName(cfg.getGridName());
 
             UUID nodeId = cfg.getNodeId();
@@ -1405,16 +1402,6 @@ public class IgnitionEx {
 
             String[] p2pExclude = cfg.getPeerClassLoadingLocalClassPathExclude();
 
-            CommunicationSpi commSpi = cfg.getCommunicationSpi();
-            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
-            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
-            CollisionSpi colSpi = cfg.getCollisionSpi();
-            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
-            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
-            FailoverSpi[] failSpi = cfg.getFailoverSpi();
-            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
-            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
-            IndexingSpi indexingSpi = cfg.getIndexingSpi();
 
             execSvc = new IgniteThreadPoolExecutor(
                 "pub-" + cfg.getGridName(),
@@ -1547,9 +1534,35 @@ public class IgnitionEx {
 
             myCfg.setPeerClassLoadingLocalClassPathExclude(p2pExclude);
 
+            // REST configuration.
+            myCfg.setConnectorConfiguration(clientCfg);
+
+            // Validate segmentation configuration.
+            GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
+
+            // 1. Warn on potential configuration problem: grid is not configured to wait
+            // for correct segment after segmentation happens.
+            if (!F.isEmpty(cfg.getSegmentationResolvers()) && segPlc == RESTART_JVM && !cfg.isWaitForSegmentOnStart()) {
+                U.warn(log, "Found potential configuration problem (forgot to enable waiting for segment" +
+                    "on start?) [segPlc=" + segPlc + ", wait=false]");
+            }
+
+
+
             /*
              * Initialize default SPI implementations.
              */
+            CommunicationSpi commSpi = cfg.getCommunicationSpi();
+            DiscoverySpi discoSpi = cfg.getDiscoverySpi();
+            EventStorageSpi evtSpi = cfg.getEventStorageSpi();
+            CollisionSpi colSpi = cfg.getCollisionSpi();
+            DeploymentSpi deploySpi = cfg.getDeploymentSpi();
+            CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
+            FailoverSpi[] failSpi = cfg.getFailoverSpi();
+            LoadBalancingSpi[] loadBalancingSpi = cfg.getLoadBalancingSpi();
+            SwapSpaceSpi swapspaceSpi = cfg.getSwapSpaceSpi();
+            IndexingSpi indexingSpi = cfg.getIndexingSpi();
+
 
             if (commSpi == null)
                 commSpi = new TcpCommunicationSpi();
@@ -1614,19 +1627,6 @@ public class IgnitionEx {
             myCfg.setSwapSpaceSpi(swapspaceSpi);
             myCfg.setIndexingSpi(indexingSpi);
 
-            // REST configuration.
-            myCfg.setConnectorConfiguration(clientCfg);
-
-            // Validate segmentation configuration.
-            GridSegmentationPolicy segPlc = cfg.getSegmentationPolicy();
-
-            // 1. Warn on potential configuration problem: grid is not configured to wait
-            // for correct segment after segmentation happens.
-            if (!F.isEmpty(cfg.getSegmentationResolvers()) && segPlc == RESTART_JVM && !cfg.isWaitForSegmentOnStart()) {
-                U.warn(log, "Found potential configuration problem (forgot to enable waiting for segment" +
-                    "on start?) [segPlc=" + segPlc + ", wait=false]");
-            }
-
             CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();
 
             final boolean hasHadoop = IgniteComponentType.HADOOP.inClassPath();


[43/50] incubator-ignite git commit: Merge branch 'ignite-270' into sprint-2

Posted by ak...@apache.org.
Merge branch 'ignite-270' into sprint-2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2511ebe1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2511ebe1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2511ebe1

Branch: refs/heads/ignite-368
Commit: 2511ebe18c564e43e642bc879ffe44b02497c90a
Parents: b0e6ab1 18548b2
Author: anovikov <an...@gridgain.com>
Authored: Mon Mar 2 21:43:59 2015 +0700
Committer: anovikov <an...@gridgain.com>
Committed: Mon Mar 2 21:43:59 2015 +0700

----------------------------------------------------------------------
 modules/scalar/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2511ebe1/modules/scalar/pom.xml
----------------------------------------------------------------------


[27/50] incubator-ignite git commit: # ignite-239

Posted by ak...@apache.org.
# ignite-239


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4f7dbf76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4f7dbf76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4f7dbf76

Branch: refs/heads/ignite-368
Commit: 4f7dbf76ea6638792abd23e7d0327eabd8bc377b
Parents: 1689a20
Author: sboikov <sb...@gridgain.com>
Authored: Fri Feb 27 17:27:18 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Feb 27 17:27:18 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  | 71 +++++++++-----------
 1 file changed, 33 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f7dbf76/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index f39cd7e..ca3abe9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1517,36 +1517,28 @@ public class IgnitionEx {
         /**
          * @param cfg Ignite configuration copy to.
          * @return New ignite configuration.
+         * @throws IgniteCheckedException If failed.
          */
         private IgniteConfiguration initializeConfiguration(IgniteConfiguration cfg)
             throws IgniteCheckedException {
             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
 
-            initializeDefaultConfigurationParameters(myCfg);
-
-            return myCfg;
-        }
-
-        /**
-         * Initialize default parameters.
-         */
-        public void initializeDefaultConfigurationParameters(IgniteConfiguration cfg) throws IgniteCheckedException {
-            cfg.setIgniteHome(U.getIgniteHome());
+            myCfg.setIgniteHome(U.getIgniteHome());
 
             // Local host.
             String locHost = IgniteSystemProperties.getString(IGNITE_LOCAL_HOST);
 
-            cfg.setLocalHost(F.isEmpty(locHost) ? cfg.getLocalHost() : locHost);
+            myCfg.setLocalHost(F.isEmpty(locHost) ? myCfg.getLocalHost() : locHost);
 
             // Override daemon flag if it was set on the factory.
             if (daemon)
-                cfg.setDaemon(true);
+                myCfg.setDaemon(true);
 
-            Marshaller marsh = cfg.getMarshaller();
+            Marshaller marsh = myCfg.getMarshaller();
 
             if (marsh == null) {
                 if (!U.isHotSpot()) {
-                    U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " +
+                    U.warn(log, "OptimizedMarshaller is not supported on this JVM " +
                             "(only Java HotSpot VMs are supported). Switching to standard JDK marshalling - " +
                             "object serialization performance will be significantly slower.",
                         "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release.");
@@ -1554,7 +1546,7 @@ public class IgnitionEx {
                     marsh = new JdkMarshaller();
                 }
                 else if (!OptimizedMarshaller.available()) {
-                    U.warn(log, "GridOptimizedMarshaller is not supported on this JVM " +
+                    U.warn(log, "OptimizedMarshaller is not supported on this JVM " +
                             "(only recent 1.6 and 1.7 versions HotSpot VMs are supported). " +
                             "To enable fast marshalling upgrade to recent 1.6 or 1.7 HotSpot VM release. " +
                             "Switching to standard JDK marshalling - " +
@@ -1567,7 +1559,7 @@ public class IgnitionEx {
                     marsh = new OptimizedMarshaller();
             }
             else if (marsh instanceof OptimizedMarshaller && !U.isHotSpot()) {
-                U.warn(log, "Using GridOptimizedMarshaller on untested JVM (only Java HotSpot VMs were tested) - " +
+                U.warn(log, "Using OptimizedMarshaller on untested JVM (only Java HotSpot VMs were tested) - " +
                         "object serialization behavior could yield unexpected results.",
                     "Using GridOptimizedMarshaller on untested JVM.");
             }
@@ -1576,7 +1568,7 @@ public class IgnitionEx {
             String depModeName = IgniteSystemProperties.getString(IGNITE_DEP_MODE_OVERRIDE);
 
             if (!F.isEmpty(depModeName)) {
-                if (!F.isEmpty(cfg.getCacheConfiguration())) {
+                if (!F.isEmpty(myCfg.getCacheConfiguration())) {
                     U.quietAndInfo(log, "Skipping deployment mode override for caches (custom closure " +
                         "execution may not work for console Visor)");
                 }
@@ -1584,8 +1576,8 @@ public class IgnitionEx {
                     try {
                         DeploymentMode depMode = DeploymentMode.valueOf(depModeName);
 
-                        if (cfg.getDeploymentMode() != depMode)
-                            cfg.setDeploymentMode(depMode);
+                        if (myCfg.getDeploymentMode() != depMode)
+                            myCfg.setDeploymentMode(depMode);
                     }
                     catch (IllegalArgumentException e) {
                         throw new IgniteCheckedException("Failed to override deployment mode using system property " +
@@ -1595,12 +1587,12 @@ public class IgnitionEx {
                 }
             }
 
-            cfg.setMarshaller(marsh);
+            myCfg.setMarshaller(marsh);
 
-            cfg.setConnectorConfiguration(cfg.getConnectorConfiguration() != null ?
-                new ConnectorConfiguration(cfg.getConnectorConfiguration()) : null);
+            myCfg.setConnectorConfiguration(myCfg.getConnectorConfiguration() != null ?
+                new ConnectorConfiguration(myCfg.getConnectorConfiguration()) : null);
 
-            IgfsConfiguration[] igfsCfgs = cfg.getIgfsConfiguration();
+            IgfsConfiguration[] igfsCfgs = myCfg.getIgfsConfiguration();
 
             if (igfsCfgs != null) {
                 IgfsConfiguration[] clone = igfsCfgs.clone();
@@ -1608,19 +1600,19 @@ public class IgnitionEx {
                 for (int i = 0; i < igfsCfgs.length; i++)
                     clone[i] = new IgfsConfiguration(igfsCfgs[i]);
 
-                cfg.setIgfsConfiguration(clone);
+                myCfg.setIgfsConfiguration(clone);
             }
 
-            if (cfg.getMBeanServer() == null)
-                cfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
+            if (myCfg.getMBeanServer() == null)
+                myCfg.setMBeanServer(ManagementFactory.getPlatformMBeanServer());
 
-            if (cfg.getNodeId() == null)
-               cfg.setNodeId(UUID.randomUUID());
+            if (myCfg.getNodeId() == null)
+               myCfg.setNodeId(UUID.randomUUID());
 
-            if (cfg.getPeerClassLoadingLocalClassPathExclude() == null)
-                cfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);
+            if (myCfg.getPeerClassLoadingLocalClassPathExclude() == null)
+                myCfg.setPeerClassLoadingLocalClassPathExclude(EMPTY_STR_ARR);
 
-            StreamerConfiguration[] streamerCfgs = cfg.getStreamerConfiguration();
+            StreamerConfiguration[] streamerCfgs = myCfg.getStreamerConfiguration();
 
             if (streamerCfgs != null) {
                 StreamerConfiguration[] clone = streamerCfgs.clone();
@@ -1628,26 +1620,29 @@ public class IgnitionEx {
                 for (int i = 0; i < streamerCfgs.length; i++)
                     clone[i] = new StreamerConfiguration(streamerCfgs[i]);
 
-                cfg.setStreamerConfiguration(clone);
+                myCfg.setStreamerConfiguration(clone);
             }
 
-            cfg.setTransactionConfiguration(cfg.getTransactionConfiguration() != null ?
-                new TransactionConfiguration(cfg.getTransactionConfiguration()) : null);
+            myCfg.setTransactionConfiguration(myCfg.getTransactionConfiguration() != null ?
+                new TransactionConfiguration(myCfg.getTransactionConfiguration()) : null);
 
-            if (cfg.getUserAttributes() == null) {
+            if (myCfg.getUserAttributes() == null) {
                 Map<String, ?> emptyAttr = Collections.emptyMap();
-                cfg.setUserAttributes(emptyAttr);
+                myCfg.setUserAttributes(emptyAttr);
             }
 
-            initializeDefaultCacheConfiguration(cfg);
+            initializeDefaultCacheConfiguration(myCfg);
+
+            initializeDefaultSpi(myCfg);
 
-            initializeDefaultSpi(cfg);
+            return myCfg;
         }
 
         /**
          * Initialize default cache configuration.
          *
          * @param cfg Ignite configuration.
+         * @throws IgniteCheckedException If failed.
          */
         public void initializeDefaultCacheConfiguration(IgniteConfiguration cfg) throws IgniteCheckedException {
             CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();