ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [49/50] incubator-ignite git commit: Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-471
Date Thu, 02 Apr 2015 02:53:36 GMT
Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-471

Conflicts:
	modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
	modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
	modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java


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

Branch: refs/heads/ignite-471
Commit: fda23f852dea9f773e61143ad732dd3b7496c71d
Parents: d8f6ab9 ed6632a
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Wed Apr 1 15:17:14 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Wed Apr 1 15:17:14 2015 -0700

----------------------------------------------------------------------
 DEVNOTES.txt                                    |  21 +-
 RELEASE_NOTES.txt                               |  20 +-
 examples/pom.xml                                |  19 +-
 examples/schema-import/pom.xml                  |  10 +-
 .../examples/datagrid/CacheQueryExample.java    |  12 +-
 modules/aop/pom.xml                             |   6 +-
 modules/aws/pom.xml                             |   4 +-
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |  12 +-
 modules/clients/pom.xml                         |  10 +-
 .../client/impl/ClientCacheFlagsCodecTest.java  |  18 +-
 modules/codegen/pom.xml                         |   4 +-
 modules/core/pom.xml                            |   5 +-
 .../apache/ignite/cache/CachingProvider.java    |   2 +-
 .../store/jdbc/CacheAbstractJdbcStore.java      |   2 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |   9 +-
 .../configuration/CacheConfiguration.java       |  23 ++
 .../configuration/FileSystemConfiguration.java  |   6 +
 .../ignite/internal/GridCachePluginContext.java |  72 ++++
 .../ignite/internal/GridKernalContextImpl.java  |  17 +-
 .../org/apache/ignite/internal/IgniteEx.java    |   4 +-
 .../apache/ignite/internal/IgniteKernal.java    |  17 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  10 +-
 .../internal/MarshallerContextAdapter.java      |   6 +-
 .../ignite/internal/MarshallerContextImpl.java  |  90 ++++-
 .../internal/client/GridClientCacheFlag.java    |  13 -
 .../impl/connection/GridClientConnection.java   |   9 -
 .../internal/managers/GridManagerAdapter.java   |   4 +
 .../cache/CacheConflictResolutionManager.java   |  30 ++
 .../internal/processors/cache/CacheFlag.java    | 108 ------
 .../processors/cache/CacheFlagException.java    |  67 ----
 .../cache/CacheObjectByteArrayImpl.java         |   2 +-
 .../processors/cache/CacheObjectContext.java    |  14 +-
 .../processors/cache/CacheObjectImpl.java       |  10 +-
 .../cache/CacheOsConflictResolutionManager.java |  58 +++
 .../processors/cache/CacheProjection.java       | 233 +-----------
 .../cache/DynamicCacheDescriptor.java           |   2 +-
 .../internal/processors/cache/GridCache.java    |   3 -
 .../processors/cache/GridCacheAdapter.java      | 275 +++-----------
 .../cache/GridCacheConcurrentMap.java           |  44 +--
 .../processors/cache/GridCacheContext.java      | 256 ++-----------
 .../processors/cache/GridCacheEntryEx.java      |   3 +-
 .../processors/cache/GridCacheMapEntry.java     |  30 +-
 .../processors/cache/GridCacheProcessor.java    | 132 ++++---
 .../processors/cache/GridCacheProjectionEx.java |  29 --
 .../cache/GridCacheProjectionImpl.java          | 357 +++----------------
 .../processors/cache/GridCacheProxyImpl.java    |  55 +--
 .../cache/GridCacheSharedContext.java           |  21 --
 .../processors/cache/GridCacheUtils.java        |  39 ++
 .../processors/cache/IgniteCacheProxy.java      |  31 +-
 .../CacheDataStructuresManager.java             |   4 +-
 .../GridDistributedTxRemoteAdapter.java         |   2 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   2 +-
 .../distributed/dht/GridDhtLocalPartition.java  |   2 +-
 .../distributed/dht/GridDhtLockFuture.java      |   2 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |   2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |   2 +-
 .../dht/GridPartitionedGetFuture.java           |   3 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  32 --
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |   2 -
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |   3 -
 .../dht/atomic/GridNearAtomicUpdateRequest.java |  78 ++--
 .../dht/colocated/GridDhtColocatedCache.java    |   2 -
 .../colocated/GridDhtDetachedCacheEntry.java    |   2 +-
 .../distributed/near/GridNearAtomicCache.java   |   5 +-
 .../distributed/near/GridNearCacheAdapter.java  |   9 -
 .../distributed/near/GridNearGetFuture.java     |   3 +-
 .../near/GridNearTransactionalCache.java        |   2 -
 .../cache/distributed/near/GridNearTxLocal.java |   4 +-
 .../processors/cache/dr/GridCacheDrManager.java |   5 -
 .../cache/dr/GridOsCacheDrManager.java          | 106 ++++++
 .../cache/dr/os/GridOsCacheDrManager.java       | 111 ------
 .../local/atomic/GridLocalAtomicCache.java      |  74 +---
 .../cache/query/GridCacheQueriesImpl.java       |  23 +-
 .../cache/query/GridCacheQueryManager.java      |  16 +-
 .../continuous/CacheContinuousQueryHandler.java |   5 -
 .../CacheContinuousQueryListener.java           |   3 +
 .../continuous/CacheContinuousQueryManager.java |  30 +-
 .../transactions/IgniteTransactionsImpl.java    |   5 +-
 .../transactions/IgniteTxLocalAdapter.java      |  19 +-
 .../cache/transactions/IgniteTxManager.java     |   2 -
 .../version/CacheVersionConflictResolver.java   |  40 +++
 ...ridCacheVersionAbstractConflictResolver.java |  56 ---
 .../GridCacheVersionConflictResolver.java       |  59 ---
 .../IgniteCacheObjectProcessorImpl.java         | 168 ++++++---
 .../datastreamer/DataStreamerImpl.java          |   2 +-
 .../datastructures/DataStructuresProcessor.java |  13 +-
 .../datastructures/GridCacheAtomicLongImpl.java |  14 +-
 .../GridCacheAtomicReferenceImpl.java           |   2 +-
 .../GridCacheAtomicReferenceValue.java          |  15 +-
 .../GridCacheAtomicSequenceImpl.java            |   2 +-
 .../GridCacheAtomicStampedImpl.java             |   2 +-
 .../GridCacheAtomicStampedValue.java            |  15 +-
 .../GridCacheCountDownLatchImpl.java            |   2 +-
 .../processors/igfs/IgfsDataManager.java        |  11 +-
 .../processors/igfs/IgfsFileAffinityRange.java  |  23 +-
 .../processors/igfs/IgfsHelperImpl.java         |   3 +-
 .../processors/plugin/CachePluginManager.java   | 107 ++++++
 .../handlers/cache/GridCacheCommandHandler.java |  66 ++--
 .../ignite/internal/util/IgniteUtils.java       |   2 +-
 .../cache/VisorCacheStoreConfiguration.java     |  18 +-
 .../ignite/marshaller/MarshallerContext.java    |   3 +-
 .../optimized/OptimizedMarshallerUtils.java     |   9 +-
 .../ignite/plugin/CachePluginConfiguration.java |  36 ++
 .../ignite/plugin/CachePluginContext.java       |  54 +++
 .../ignite/plugin/CachePluginProvider.java      |  84 +++++
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |  16 +-
 .../org/apache/ignite/spi/IgniteSpiContext.java |   5 +
 .../communication/tcp/TcpCommunicationSpi.java  |  13 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  21 +-
 .../ignite/startup/BasicWarmupClosure.java      |   2 +-
 .../ignite/IgniteCacheAffinitySelfTest.java     |   8 +-
 ...eJdbcStoreAbstractMultithreadedSelfTest.java |  11 +-
 .../GridProjectionForCachesSelfTest.java        |  12 +-
 .../managers/GridNoopManagerSelfTest.java       |   2 +-
 .../communication/GridIoManagerSelfTest.java    |   9 +-
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +-
 .../cache/GridCacheAbstractFlagsTest.java       |  97 -----
 .../cache/GridCacheAbstractFullApiSelfTest.java |  61 +++-
 .../cache/GridCacheMemoryModeSelfTest.java      |  12 +-
 .../cache/GridCachePutAllFailoverSelfTest.java  |  26 +-
 .../GridCacheReturnValueTransferSelfTest.java   |  36 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   2 +-
 .../IgniteCacheAtomicLocalStoreValueTest.java   |  49 +++
 ...iteCacheAtomicNearEnabledStoreValueTest.java |  30 ++
 ...maryWriteOrderNearEnabledStoreValueTest.java |  31 ++
 ...heAtomicPrimaryWriteOrderStoreValueTest.java |  32 ++
 .../cache/IgniteCacheAtomicStoreValueTest.java  |  55 +++
 .../cache/IgniteCacheDynamicStopSelfTest.java   |  19 +-
 .../cache/IgniteCacheInvokeAbstractTest.java    |  11 -
 .../IgniteCacheStoreValueAbstractTest.java      | 311 ++++++++++++++++
 .../cache/IgniteCacheTxLocalStoreValueTest.java |  49 +++
 .../IgniteCacheTxNearEnabledStoreValueTest.java |  30 ++
 .../cache/IgniteCacheTxStoreValueTest.java      |  49 +++
 ...PartitionedQueueCreateMultiNodeSelfTest.java |   6 +-
 .../IgniteCacheSystemTransactionsSelfTest.java  |  38 +-
 ...GridCacheValueConsistencyAtomicSelfTest.java | 101 ------
 .../near/GridCachePartitionedFlagsTest.java     |  41 ---
 ...achePartitionedMultiNodeFullApiSelfTest.java |   2 +
 .../GridCacheReplicatedFlagsTest.java           |  28 --
 ...IgniteCacheJdbcBlobStoreNodeRestartTest.java |  52 +++
 ...IgniteCacheStoreNodeRestartAbstractTest.java | 116 ++++++
 ...ridCacheContinuousQueryAbstractSelfTest.java |   2 +-
 .../cache/GridCacheCommandHandlerSelfTest.java  |   2 +-
 .../GridServiceReassignmentSelfTest.java        |   5 +-
 .../internal/util/IgniteUtilsSelfTest.java      |   2 +-
 .../loadtests/hashmap/GridCacheTestContext.java |   8 +-
 .../OptimizedMarshallerNodeFailoverTest.java    |  71 +++-
 .../OptimizedObjectStreamSelfTest.java          |   4 -
 .../spi/GridSpiLocalHostInjectionTest.java      |   2 +-
 .../GridPriorityQueueCollisionSpiSelfTest.java  |   2 +-
 ...RobinLoadBalancingSpiNotPerTaskSelfTest.java |   2 +-
 .../testframework/GridSpiTestContext.java       |  18 +-
 .../testframework/junits/GridAbstractTest.java  |  28 +-
 .../junits/GridTestKernalContext.java           |   2 +-
 .../junits/IgniteTestResources.java             |   8 +-
 .../junits/common/GridCommonAbstractTest.java   |   2 +-
 .../junits/spi/GridSpiAbstractTest.java         |  13 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |  12 +-
 modules/extdata/p2p/pom.xml                     |   4 +-
 modules/extdata/uri/pom.xml                     |   4 +-
 modules/geospatial/README.txt                   |  15 +
 modules/geospatial/pom.xml                      |   4 +-
 modules/hadoop/pom.xml                          |   8 +-
 .../hadoop/jobtracker/HadoopJobTracker.java     |   7 +-
 .../HadoopDefaultMapReducePlannerSelfTest.java  |   3 +-
 modules/hibernate/README.txt                    |  15 +
 modules/hibernate/pom.xml                       |   6 +-
 .../hibernate/CacheHibernateBlobStore.java      |   9 +-
 .../CacheHibernateBlobStoreNodeRestartTest.java |  52 +++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 modules/indexing/pom.xml                        |   4 +-
 .../processors/query/h2/IgniteH2Indexing.java   |   4 +-
 .../cache/GridCacheOffHeapSelfTest.java         |   2 +-
 modules/jcl/pom.xml                             |   4 +-
 modules/jta/pom.xml                             |   4 +-
 .../processors/cache/jta/CacheJtaManager.java   |   1 -
 modules/log4j/pom.xml                           |   4 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar/pom.xml                          |  10 +-
 .../ignite/scalar/pimps/ScalarCachePimp.scala   |  36 --
 modules/schedule/README.txt                     |  15 +
 modules/schedule/pom.xml                        |   4 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   8 +-
 modules/ssh/pom.xml                             |   8 +-
 .../ant/beautifier/GridJavadocAntTask.java      |   8 +-
 modules/urideploy/pom.xml                       |   6 +-
 modules/visor-console/pom.xml                   |   8 +-
 .../commands/disco/VisorDiscoveryCommand.scala  |   8 +-
 .../commands/events/VisorEventsCommand.scala    |  24 +-
 .../commands/tasks/VisorTasksCommand.scala      |   6 +-
 .../scala/org/apache/ignite/visor/visor.scala   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   8 +-
 modules/yardstick/pom.xml                       |   6 +-
 parent/pom.xml                                  |  41 +--
 pom.xml                                         |  78 ++--
 199 files changed, 2801 insertions(+), 2801 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
index 2f465b5,6852260..9bdfd79
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
@@@ -561,7 -565,7 +566,7 @@@ public class CacheJdbcBlobStore<K, V> e
       * @throws IgniteCheckedException If failed to convert.
       */
      protected byte[] toBytes(Object obj) throws IgniteCheckedException {
-         return U.toArray(ignite.configuration().getMarshaller().marshal(obj));
 -        return marsh.marshal(obj);
++        return U.toArray(marsh.marshal(obj));
      }
  
      /**
@@@ -576,7 -580,7 +581,7 @@@
          if (bytes == null || bytes.length == 0)
              return null;
  
-         return ignite.configuration().getMarshaller().unmarshal(ByteBuffer.wrap(bytes),
getClass().getClassLoader());
 -        return marsh.unmarshal(bytes, getClass().getClassLoader());
++        return marsh.unmarshal(ByteBuffer.wrap(bytes), getClass().getClassLoader());
      }
  
      /**

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

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

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
index 8cb6734,33a747d..d477d8a
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
@@@ -70,7 -67,12 +70,12 @@@ public class CacheObjectImpl extends Ca
  
              assert valBytes != null;
  
-             val = ctx.unmarshal(valBytes, ctx.kernalContext().config().getClassLoader());
 -            Object val = ctx.processor().unmarshal(ctx, valBytes, ctx.kernalContext().config().getClassLoader());
++            Object val = ctx.unmarshal(valBytes, ctx.kernalContext().config().getClassLoader());
+ 
+             if (ctx.storeValue())
+                 this.val = val;
+ 
+             return (T)val;
          }
          catch (IgniteCheckedException e) {
              throw new IgniteException("Failed to unmarshal object.", e);
@@@ -99,8 -100,8 +103,8 @@@
      @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws
IgniteCheckedException {
          assert val != null || valBytes != null;
  
-         if (val == null && ctx.unmarshalValues())
+         if (val == null && ctx.storeValue())
 -            val = ctx.processor().unmarshal(ctx, valBytes, ldr);
 +            val = ctx.unmarshal(valBytes, ldr);
      }
  
      /** {@inheritDoc} */

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

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

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index d14c8a7,d7fbde9..f9fc502
--- 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
@@@ -3684,9 -3674,9 +3677,10 @@@ public abstract class GridCacheMapEntr
          try {
              GridCacheQueryManager qryMgr = cctx.queries();
  
-             if (qryMgr != null) {
+             if (qryMgr != null && qryMgr.enabled()) {
 -                qryMgr.store(key.value(cctx.cacheObjectContext(), false),
 +                qryMgr.store(
 +                    key.value(cctx.cacheObjectContext(), false),
+                     null,
                      CU.value(val, cctx, false),
                      null,
                      ver,

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

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

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index 6b13b97,3f68a46..dc25218
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@@ -628,8 -602,8 +602,8 @@@ public class GridNearAtomicUpdateReques
  
                  writer.incrementState();
  
-             case 13:
+             case 12:
 -                if (!writer.writeObjectArray("invokeArgsBytes", invokeArgsBytes, MessageCollectionItemType.BYTE_ARR))
 +                if (!writer.writeObjectArray("invokeArgsBytes", invokeArgsBytes, MessageCollectionItemType.BYTE_BUF))
                      return false;
  
                  writer.incrementState();
@@@ -784,8 -750,8 +750,8 @@@
  
                  reader.incrementState();
  
-             case 13:
+             case 12:
 -                invokeArgsBytes = reader.readObjectArray("invokeArgsBytes", MessageCollectionItemType.BYTE_ARR,
byte[].class);
 +                invokeArgsBytes = reader.readObjectArray("invokeArgsBytes", MessageCollectionItemType.BYTE_BUF,
ByteBuffer.class);
  
                  if (!reader.isLastRead())
                      return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 3db0322,f65b7bd..68de90e
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@@ -323,27 -302,108 +292,108 @@@ public class IgniteCacheObjectProcessor
  
          /** {@inheritDoc} */
          @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
-             if (!ctx.processor().immutable(val)) {
-                 try {
+             try {
+                 if (!ctx.processor().immutable(val)) {
                      if (valBytes == null)
 -                        valBytes = ctx.processor().marshal(ctx, val);
 +                        valBytes = ctx.marshal(val);
  
-                     if (ctx.unmarshalValues()) {
-                         ClassLoader ldr = ctx.p2pEnabled() ?
-                             IgniteUtils.detectClass(this.val).getClassLoader() : val.getClass().getClassLoader();
+                     ClassLoader ldr = ctx.p2pEnabled() ?
+                         IgniteUtils.detectClass(this.val).getClassLoader() : val.getClass().getClassLoader();
  
 -                     Object val = ctx.processor().unmarshal(ctx, valBytes, ldr);
 +                        Object val = ctx.unmarshal(valBytes, ldr);
  
-                         return new CacheObjectImpl(val, valBytes);
-                     }
- 
-                     return new CacheObjectImpl(null, valBytes);
+                     return new KeyCacheObjectImpl(val, valBytes);
                  }
-                 catch (IgniteCheckedException e) {
-                     throw new IgniteException("Failed to marshal object: " + val, e);
+ 
+                 return new KeyCacheObjectImpl(val, valBytes);
+             }
+             catch (IgniteCheckedException e) {
+                 throw new IgniteException("Failed to marshal object: " + val, e);
+             }
+         }
+     }
+ 
+     /**
+      * Wraps value provided by user, must be serialized before stored in cache.
+      */
+     private static class UserCacheObjectImpl extends CacheObjectImpl {
+         /** */
+         private static final long serialVersionUID = 0L;
+ 
+         /**
+          *
+          */
+         public UserCacheObjectImpl() {
+             //No-op.
+         }
+ 
+         /**
+          * @param val Value.
+          * @param valBytes Value bytes.
+          */
+         public UserCacheObjectImpl(Object val, byte[] valBytes) {
+             super(val, valBytes);
+         }
+ 
+         /** {@inheritDoc} */
+         @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy)
{
+             return super.value(ctx, false); // Do not need copy since user value is not
in cache.
+         }
+ 
+         /** {@inheritDoc} */
+         @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
+             try {
+                 if (valBytes == null)
+                     valBytes = ctx.processor().marshal(ctx, val);
+ 
+                 if (ctx.storeValue()) {
+                     ClassLoader ldr = ctx.p2pEnabled() ?
+                         IgniteUtils.detectClass(this.val).getClassLoader() : val.getClass().getClassLoader();
+ 
+                     Object val = ctx.processor().unmarshal(ctx, valBytes, ldr);
+ 
+                     return new CacheObjectImpl(val, valBytes);
                  }
-             } else
-                 return new CacheObjectImpl(val, valBytes);
+ 
+                 return new CacheObjectImpl(null, valBytes);
+             }
+             catch (IgniteCheckedException e) {
+                 throw new IgniteException("Failed to marshal object: " + val, e);
+             }
+         }
+     }
+ 
+     /**
+      * Wraps value provided by user, must be copied before stored in cache.
+      */
+     private static class UserCacheObjectByteArrayImpl extends CacheObjectByteArrayImpl {
+         /** */
+         private static final long serialVersionUID = 0L;
+ 
+         /**
+          *
+          */
+         public UserCacheObjectByteArrayImpl() {
+             // No-op.
+         }
+ 
+         /**
+          * @param val Value.
+          */
+         public UserCacheObjectByteArrayImpl(byte[] val) {
+             super(val);
+         }
+ 
+         /** {@inheritDoc} */
+         @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy)
{
+             return super.value(ctx, false); // Do not need copy since user value is not
in cache.
+         }
+ 
+         /** {@inheritDoc} */
+         @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
+             byte[] valCpy = Arrays.copyOf(val, val.length);
+ 
+             return new CacheObjectByteArrayImpl(valCpy);
          }
      }
  }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
----------------------------------------------------------------------
diff --cc modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
index 52182e0,77093b5..ddc8cbc
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
@@@ -570,7 -574,7 +575,7 @@@ public class CacheHibernateBlobStore<K
       * @throws IgniteCheckedException If failed to convert.
       */
      protected byte[] toBytes(Object obj) throws IgniteCheckedException {
-         return U.toArray(ignite.configuration().getMarshaller().marshal(obj));
 -        return marsh.marshal(obj);
++        return U.toArray(marsh.marshal(obj));
      }
  
      /**
@@@ -585,7 -589,7 +590,7 @@@
          if (bytes == null || bytes.length == 0)
              return null;
  
-         return ignite.configuration().getMarshaller().unmarshal(ByteBuffer.wrap(bytes),
getClass().getClassLoader());
 -        return marsh.unmarshal(bytes, getClass().getClassLoader());
++        return marsh.unmarshal(ByteBuffer.wrap(bytes), getClass().getClassLoader());
      }
  
      /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fda23f85/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------


Mime
View raw message