You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2015/10/23 11:52:21 UTC
[38/50] [abbrv] ignite git commit: Merge branch 'master' into
ignite-1486
Merge branch 'master' into ignite-1486
Conflicts:
modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d1247152
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d1247152
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d1247152
Branch: refs/heads/ignite-950-new
Commit: d124715280deec146f7340b03495ed31a78fb7df
Parents: e7eb2b3 3a29b97
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Oct 21 15:17:18 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Oct 21 15:17:18 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 3 +
assembly/dependencies-fabric.xml | 2 +-
assembly/release-fabric.xml | 10 +-
bin/igniterouter.bat | 2 +-
bin/igniterouter.sh | 2 +-
examples/config/filesystem/README.txt | 2 +-
examples/config/filesystem/example-igfs.xml | 7 -
examples/schema-import/pom-standalone.xml | 90 ++
examples/schema-import/pom.xml | 23 +-
.../computegrid/ComputeClosureExample.java | 2 +-
.../socket/WordsSocketStreamerServer.java | 5 +-
modules/apache-license-gen/README.txt | 33 +
modules/apache-license-gen/pom.xml | 3 +
.../JettyRestProcessorAbstractSelfTest.java | 252 +++-
.../TcpDiscoveryCloudIpFinderSelfTest.java | 2 +
.../org/apache/ignite/IgniteAtomicLong.java | 17 +-
.../apache/ignite/IgniteAtomicReference.java | 9 +-
.../org/apache/ignite/IgniteAtomicSequence.java | 9 +-
.../org/apache/ignite/IgniteAtomicStamped.java | 13 +-
.../org/apache/ignite/IgniteFileSystem.java | 4 +-
.../java/org/apache/ignite/IgnitePortables.java | 2 +-
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../org/apache/ignite/IgniteTransactions.java | 4 -
.../apache/ignite/cache/CacheAtomicityMode.java | 17 +-
.../configuration/CacheConfiguration.java | 23 +-
.../configuration/NearCacheConfiguration.java | 18 +-
.../java/org/apache/ignite/igfs/IgfsPath.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 78 +-
.../managers/discovery/CustomEventListener.java | 4 +-
.../discovery/GridDiscoveryManager.java | 81 +-
.../internal/portable/PortableContext.java | 7 +
.../cache/DynamicCacheChangeRequest.java | 19 +
.../cache/DynamicCacheDescriptor.java | 46 +-
.../processors/cache/GridCacheAdapter.java | 29 +-
.../processors/cache/GridCacheContext.java | 8 +-
.../processors/cache/GridCacheEventManager.java | 12 +-
.../cache/GridCacheEvictionManager.java | 6 +-
.../cache/GridCacheEvictionResponse.java | 2 +-
.../cache/GridCacheExplicitLockSpan.java | 13 +-
.../processors/cache/GridCacheIoManager.java | 152 +-
.../processors/cache/GridCacheMapEntry.java | 66 +-
.../processors/cache/GridCacheMessage.java | 14 +-
.../cache/GridCacheMvccCandidate.java | 5 +-
.../processors/cache/GridCacheMvccManager.java | 93 +-
.../GridCachePartitionExchangeManager.java | 127 +-
.../processors/cache/GridCacheProcessor.java | 224 ++-
.../cache/GridCacheSharedContext.java | 32 -
.../cache/GridCacheSwapEntryImpl.java | 31 +-
.../processors/cache/GridCacheSwapManager.java | 124 +-
.../processors/cache/GridCacheUtils.java | 8 -
.../processors/cache/IgniteCacheProxy.java | 4 +-
.../distributed/GridDistributedCacheEntry.java | 2 +-
.../GridDistributedLockResponse.java | 6 +-
.../GridDistributedTxPrepareResponse.java | 6 +-
.../GridDistributedTxRemoteAdapter.java | 8 +-
.../dht/GridClientPartitionTopology.java | 117 +-
.../dht/GridDhtAffinityAssignmentRequest.java | 5 -
.../dht/GridDhtAffinityAssignmentResponse.java | 5 -
.../cache/distributed/dht/GridDhtGetFuture.java | 4 +-
.../distributed/dht/GridDhtLocalPartition.java | 29 +-
.../distributed/dht/GridDhtLockRequest.java | 10 +-
.../dht/GridDhtPartitionTopology.java | 4 +-
.../dht/GridDhtPartitionTopologyImpl.java | 28 +-
.../distributed/dht/GridDhtTopologyFuture.java | 6 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 2 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 5 -
.../distributed/dht/GridDhtTxPrepareFuture.java | 8 +-
.../dht/GridDhtTxPrepareRequest.java | 7 +-
.../dht/GridPartitionedGetFuture.java | 5 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 7 +-
.../dht/atomic/GridDhtAtomicUpdateResponse.java | 12 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 33 +-
.../dht/atomic/GridNearAtomicUpdateRequest.java | 2 +
.../atomic/GridNearAtomicUpdateResponse.java | 11 +-
.../dht/colocated/GridDhtColocatedCache.java | 12 +-
.../colocated/GridDhtColocatedLockFuture.java | 71 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 2 +-
.../dht/preloader/GridDhtForceKeysRequest.java | 5 -
.../dht/preloader/GridDhtForceKeysResponse.java | 11 +-
.../GridDhtPartitionDemandMessage.java | 9 +-
.../GridDhtPartitionSupplyMessage.java | 8 +-
.../GridDhtPartitionsAbstractMessage.java | 5 -
.../GridDhtPartitionsExchangeFuture.java | 31 +-
.../preloader/GridDhtPartitionsFullMessage.java | 12 +-
.../GridDhtPartitionsSingleMessage.java | 11 +-
.../dht/preloader/GridDhtPreloader.java | 26 +-
.../distributed/near/GridNearGetFuture.java | 2 +
.../distributed/near/GridNearGetResponse.java | 6 +-
.../distributed/near/GridNearLockFuture.java | 37 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 47 +-
.../near/GridNearTxFinishFuture.java | 36 +-
.../near/GridNearTxFinishResponse.java | 6 +-
.../cache/distributed/near/GridNearTxLocal.java | 21 +-
.../cache/local/GridLocalCacheEntry.java | 2 +-
.../query/GridCacheDistributedQueryFuture.java | 27 +-
.../cache/query/GridCacheLocalQueryFuture.java | 5 +
.../cache/query/GridCacheQueryAdapter.java | 170 ++-
.../query/GridCacheQueryFutureAdapter.java | 11 +-
.../cache/query/GridCacheQueryManager.java | 63 +-
.../cache/query/GridCacheQueryResponse.java | 6 +-
.../cache/query/GridCacheSqlIndexMetadata.java | 7 +-
.../cache/query/GridCacheSqlMetadata.java | 22 +-
.../continuous/CacheContinuousQueryHandler.java | 22 +-
.../continuous/CacheContinuousQueryManager.java | 66 +-
.../cache/transactions/IgniteTxHandler.java | 9 +-
.../transactions/IgniteTxLocalAdapter.java | 37 +-
.../continuous/GridContinuousProcessor.java | 42 +-
.../datastreamer/DataStreamerImpl.java | 2 -
.../datastructures/DataStructuresProcessor.java | 54 +-
.../processors/igfs/IgfsDataManager.java | 2 -
.../processors/igfs/IgfsDeleteWorker.java | 102 +-
.../internal/processors/igfs/IgfsFileInfo.java | 15 +-
.../processors/igfs/IgfsFileWorkerBatch.java | 15 +-
.../internal/processors/igfs/IgfsImpl.java | 372 +----
.../processors/igfs/IgfsMetaManager.java | 1251 ++++++++++++----
.../processors/igfs/IgfsOutputStreamImpl.java | 2 +
.../internal/processors/igfs/IgfsUtils.java | 23 +
.../processors/rest/GridRestCommand.java | 8 +-
.../processors/rest/GridRestProcessor.java | 364 ++++-
.../handlers/cache/GridCacheCommandHandler.java | 364 ++---
.../handlers/query/QueryCommandHandler.java | 195 ++-
.../top/GridTopologyCommandHandler.java | 31 +-
.../rest/request/RestQueryRequest.java | 175 +++
.../rest/request/RestSqlQueryRequest.java | 125 --
.../ignite/internal/util/GridArgumentCheck.java | 5 +-
.../ignite/internal/util/GridJavaProcess.java | 12 +-
.../ignite/internal/util/GridSpinBusyLock.java | 10 +
.../ignite/internal/util/IgniteUtils.java | 18 +-
.../ignite/internal/util/lang/GridFunc.java | 12 +
.../util/nio/GridNioRecoveryDescriptor.java | 4 +-
.../util/offheap/GridOffHeapEvictListener.java | 2 +-
.../util/offheap/GridOffHeapPartitionedMap.java | 1 +
.../util/offheap/unsafe/GridUnsafeMap.java | 4 +-
.../apache/ignite/marshaller/Marshaller.java | 2 +-
.../optimized/OptimizedMarshallerUtils.java | 6 +-
.../marshaller/portable/PortableMarshaller.java | 20 +-
.../org/apache/ignite/mxbean/IgniteMXBean.java | 8 +-
.../communication/tcp/TcpCommunicationSpi.java | 29 +-
.../discovery/DiscoverySpiCustomMessage.java | 12 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 410 ++++--
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 6 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 2 +-
.../tcp/internal/TcpDiscoveryNodesRing.java | 94 +-
.../messages/TcpDiscoveryDiscardMessage.java | 15 +-
.../TcpDiscoveryNodeAddFinishedMessage.java | 2 +-
.../messages/TcpDiscoveryNodeAddedMessage.java | 19 +-
.../org/apache/ignite/stream/StreamAdapter.java | 104 +-
.../stream/StreamMultipleTupleExtractor.java | 38 +
.../stream/StreamSingleTupleExtractor.java | 40 +
.../ignite/stream/StreamTupleExtractor.java | 20 +-
.../ignite/stream/socket/SocketStreamer.java | 3 +-
.../ignite/igfs/IgfsEventsAbstractSelfTest.java | 6 +-
.../ignite/igfs/IgfsFragmentizerSelfTest.java | 2 +-
.../internal/GridUpdateNotifierSelfTest.java | 1 +
.../IgniteClientReconnectAbstractTest.java | 35 +-
.../IgniteClientReconnectCacheTest.java | 154 ++
.../GridDiscoveryManagerAliveCacheSelfTest.java | 2 +
.../processors/cache/CrossCacheLockTest.java | 142 ++
.../GridCacheAbstractFailoverSelfTest.java | 3 +
.../cache/GridCacheAbstractFullApiSelfTest.java | 493 ++++---
.../GridCacheAbstractRemoveFailureTest.java | 208 ++-
.../GridCacheDeploymentOffHeapSelfTest.java | 15 +
.../GridCacheFinishPartitionsSelfTest.java | 5 +-
.../cache/GridCacheMemoryModeSelfTest.java | 9 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 60 +
.../GridCacheVariableTopologySelfTest.java | 3 +-
...IgniteCacheAtomicPutAllFailoverSelfTest.java | 4 +
.../IgniteCacheConfigurationTemplateTest.java | 31 +
.../cache/IgniteCacheCreateRestartSelfTest.java | 109 ++
.../IgniteCacheEntryListenerAbstractTest.java | 65 +-
.../cache/IgniteCacheEntryListenerTxTest.java | 4 +
.../IgniteCacheEntryProcessorNodeJoinTest.java | 97 +-
.../IgniteCacheP2pUnmarshallingErrorTest.java | 7 +
...CacheP2pUnmarshallingRebalanceErrorTest.java | 12 +-
.../cache/IgniteCachePutAllRestartTest.java | 4 +-
.../cache/IgniteDynamicCacheFilterTest.java | 150 ++
.../IgniteTxExceptionAbstractSelfTest.java | 3 +
...omicOffheapQueueCreateMultiNodeSelfTest.java | 5 -
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 9 +-
...artitionedOffHeapValuesQueueApiSelfTest.java | 4 +
...PartitionedQueueCreateMultiNodeSelfTest.java | 16 +-
...nedQueueFailoverDataConsistencySelfTest.java | 5 -
...GridCachePartitionedSetFailoverSelfTest.java | 4 +
.../distributed/CacheAffinityEarlyTest.java | 168 +++
...acheAsyncOperationsFailoverAbstractTest.java | 11 +
.../CacheGetFutureHangsSelfTest.java | 159 +-
.../CacheNoValueClassOnServerNodeTest.java | 1 +
.../CachePutAllFailoverAbstractTest.java | 11 +
.../GridCacheAbstractNodeRestartSelfTest.java | 149 +-
.../IgniteCacheAtomicNodeRestartTest.java | 8 +
...niteCacheClientNodeChangingTopologyTest.java | 6 +-
.../IgniteCacheCreatePutMultiNodeSelfTest.java | 151 ++
.../distributed/IgniteCacheCreatePutTest.java | 125 ++
.../IgniteCachePutGetRestartAbstractTest.java | 3 +
.../IgniteCacheSizeFailoverTest.java | 3 +
.../IgniteTxPreloadAbstractTest.java | 43 +-
.../GridCacheColocatedTxExceptionSelfTest.java | 5 -
.../GridCacheDhtAtomicRemoveFailureTest.java | 16 +-
.../dht/GridCacheDhtPreloadPerformanceTest.java | 133 ++
.../dht/GridCacheDhtRemoveFailureTest.java | 16 +-
.../dht/GridCacheTxNodeFailureSelfTest.java | 2 +-
.../dht/GridNearCacheTxNodeFailureSelfTest.java | 4 +
...gniteAtomicLongChangingTopologySelfTest.java | 186 ++-
.../IgniteCacheCrossCacheTxFailoverTest.java | 56 +-
.../IgniteCachePutRetryAbstractSelfTest.java | 199 ++-
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 2 +
...gniteCachePutRetryTransactionalSelfTest.java | 50 +-
.../IgniteCrossCacheTxNearEnabledSelfTest.java | 28 +
.../dht/IgniteCrossCacheTxSelfTest.java | 213 +++
...eAtomicInvalidPartitionHandlingSelfTest.java | 98 +-
...tomicPrimaryWriteOrderRemoveFailureTest.java | 15 +-
.../GridCacheAtomicRemoveFailureTest.java | 15 +-
...GridCacheValueConsistencyAtomicSelfTest.java | 2 +-
...tomicClientOnlyMultiNodeFullApiSelfTest.java | 71 +-
...ledFairAffinityMultiNodeFullApiSelfTest.java | 4 +
.../GridCacheAtomicNearRemoveFailureTest.java | 15 +-
...cPrimaryWriteOrderNearRemoveFailureTest.java | 15 +-
.../near/GridCacheNearRemoveFailureTest.java | 15 +-
.../near/GridCacheNearTxExceptionSelfTest.java | 9 +-
.../near/GridCacheNearTxForceKeyTest.java | 2 +-
...achePartitionedMultiNodeFullApiSelfTest.java | 129 +-
.../GridCachePartitionedNodeRestartTest.java | 9 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 9 +-
.../near/NearCacheMultithreadedUpdateTest.java | 217 +++
.../GridCacheReplicatedInvalidateSelfTest.java | 249 ----
.../GridCacheReplicatedNodeRestartSelfTest.java | 8 +-
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 -
.../replicated/GridReplicatedTxPreloadTest.java | 2 -
...eCacheExpiryPolicyWithStoreAbstractTest.java | 5 +-
.../GridCacheLocalTxExceptionSelfTest.java | 5 -
...bledFairAffinityMultiJvmFullApiSelfTest.java | 5 +
...tomicNearEnabledMultiJvmFullApiSelfTest.java | 5 +
.../GridCacheSwapScanQueryAbstractSelfTest.java | 118 +-
...ontinuousQueryReplicatedOneNodeSelfTest.java | 120 ++
.../DataStreamerMultiThreadedSelfTest.java | 4 +-
.../DataStreamerMultinodeCreateCacheTest.java | 2 +
.../processors/igfs/IgfsAbstractSelfTest.java | 983 ++++++++++---
.../igfs/IgfsClientCacheSelfTest.java | 15 +-
.../igfs/IgfsDataManagerSelfTest.java | 13 +-
.../igfs/IgfsDualAbstractSelfTest.java | 10 +-
.../igfs/IgfsMetaManagerSelfTest.java | 258 ++--
.../processors/igfs/IgfsMetricsSelfTest.java | 2 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 41 +-
.../igfs/UniversalFileSystemAdapter.java | 1 -
.../offheap/GridOffHeapMapAbstractSelfTest.java | 6 +-
...idOffHeapPartitionedMapAbstractSelfTest.java | 10 +-
.../loadtests/hashmap/GridCacheTestContext.java | 4 +-
...lientDiscoverySpiFailureTimeoutSelfTest.java | 139 +-
.../tcp/TcpClientDiscoverySpiSelfTest.java | 15 +-
.../tcp/TcpDiscoveryMultiThreadedTest.java | 53 +-
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 315 +++-
.../stream/socket/SocketStreamerSelfTest.java | 112 +-
.../ignite/testframework/GridTestUtils.java | 131 +-
.../testframework/junits/GridAbstractTest.java | 116 +-
.../junits/IgniteTestResources.java | 8 +-
.../junits/common/GridCommonAbstractTest.java | 15 +-
.../junits/multijvm/AffinityProcessProxy.java | 440 ++++--
.../multijvm/IgniteCacheProcessProxy.java | 1352 ++++++++++++++----
.../multijvm/IgniteClusterProcessProxy.java | 115 +-
.../multijvm/IgniteEventsProcessProxy.java | 50 +-
.../junits/multijvm/IgniteNodeRunner.java | 39 +-
.../junits/multijvm/IgniteProcessProxy.java | 105 +-
.../IgniteCacheFailoverTestSuite.java | 10 -
.../IgniteCacheFailoverTestSuite3.java | 48 +
.../testsuites/IgniteCacheRestartTestSuite.java | 15 +-
.../IgniteCacheRestartTestSuite2.java | 47 +
.../testsuites/IgniteCacheTestSuite3.java | 2 -
.../testsuites/IgniteCacheTestSuite4.java | 24 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 6 +
.../hadoop/SecondaryFileSystemProvider.java | 4 +-
.../processors/hadoop/igfs/HadoopIgfsUtils.java | 36 +
.../hadoop/igfs/HadoopIgfsWrapper.java | 144 +-
...oopFileSystemUniversalFileSystemAdapter.java | 4 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 34 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 7 +-
.../testsuites/IgniteHadoopTestSuite.java | 25 +-
.../processors/query/h2/IgniteH2Indexing.java | 19 +-
.../query/h2/opt/GridH2AbstractKeyValueRow.java | 73 +-
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 11 +-
.../query/h2/opt/GridH2RowDescriptor.java | 5 +
.../processors/query/h2/opt/GridH2Table.java | 10 +-
.../processors/query/h2/sql/GridSqlArray.java | 52 +
.../processors/query/h2/sql/GridSqlElement.java | 2 +-
.../query/h2/sql/GridSqlFunction.java | 60 +-
.../query/h2/sql/GridSqlFunctionType.java | 3 +
.../query/h2/sql/GridSqlPlaceholder.java | 7 +-
.../query/h2/sql/GridSqlQueryParser.java | 84 +-
.../processors/query/h2/sql/GridSqlType.java | 29 +-
.../cache/CacheConfigurationP2PTest.java | 3 +
.../cache/CacheIndexStreamerTest.java | 154 ++
...CacheScanPartitionQueryFallbackSelfTest.java | 244 +---
.../processors/cache/GridCacheSwapSelfTest.java | 4 +-
...QueryOffheapEvictsMultiThreadedSelfTest.java | 5 -
...lientQueryReplicatedNodeRestartSelfTest.java | 8 +-
.../IgniteCacheQueryNodeRestartSelfTest.java | 4 +-
.../IgniteCacheQueryNodeRestartSelfTest2.java | 10 +-
.../query/h2/sql/GridQueryParsingTest.java | 27 +
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
.../IgniteCacheWithIndexingTestSuite.java | 2 +
modules/mqtt/pom.xml | 114 ++
.../apache/ignite/stream/mqtt/MqttStreamer.java | 611 ++++++++
.../stream/mqtt/IgniteMqttStreamerTest.java | 553 +++++++
.../mqtt/IgniteMqttStreamerTestSuite.java | 34 +
.../main/cpp/common/project/vs/common.vcxproj | 4 +-
.../Apache.Ignite.Core/Impl/IgniteManager.cs | 2 -
.../http/jetty/GridJettyJsonConfig.java | 158 +-
.../http/jetty/GridJettyRestHandler.java | 186 +--
.../ignite/visor/commands/VisorConsole.scala | 37 +-
.../visor/commands/kill/VisorKillCommand.scala | 2 +-
.../scala/org/apache/ignite/visor/visor.scala | 1 -
.../config/benchmark-put-indexed-val.properties | 2 +-
modules/yardstick/config/ignite-base-config.xml | 2 +-
modules/yardstick/pom.xml | 10 +-
.../yardstick/IgniteBenchmarkArguments.java | 24 +-
.../org/apache/ignite/yardstick/IgniteNode.java | 12 +-
pom.xml | 37 +-
316 files changed, 13977 insertions(+), 4865 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/IgnitePortables.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/IgnitePortables.java
index ee0a4ec,0000000..1c63df7
mode 100644,000000..100644
--- a/modules/core/src/main/java/org/apache/ignite/IgnitePortables.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgnitePortables.java
@@@ -1,370 -1,0 +1,370 @@@
+/*
+ * 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;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.TreeMap;
+import java.util.UUID;
+import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.portable.PortableBuilder;
+import org.apache.ignite.portable.PortableException;
+import org.apache.ignite.portable.PortableIdMapper;
+import org.apache.ignite.portable.PortableMarshalAware;
+import org.apache.ignite.portable.PortableMetadata;
+import org.apache.ignite.portable.PortableObject;
+import org.apache.ignite.portable.PortableSerializer;
+import org.apache.ignite.portable.PortableTypeConfiguration;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Defines portable objects functionality. With portable objects you are able to:
+ * <ul>
+ * <li>Seamlessly interoperate between Java, .NET, and C++.</li>
+ * <li>Make any object portable with zero code change to your existing code.</li>
+ * <li>Nest portable objects within each other.</li>
+ * <li>Automatically handle {@code circular} or {@code null} references.</li>
+ * <li>Automatically convert collections and maps between Java, .NET, and C++.</li>
+ * <li>
+ * Optionally avoid deserialization of objects on the server side
+ * (objects are stored in {@link PortableObject} format).
+ * </li>
+ * <li>Avoid need to have concrete class definitions on the server side.</li>
+ * <li>Dynamically change structure of the classes without having to restart the cluster.</li>
+ * <li>Index into portable objects for querying purposes.</li>
+ * </ul>
+ * <h1 class="header">Working With Portables Directly</h1>
+ * Once an object is defined as portable,
+ * Ignite will always store it in memory in the portable (i.e. binary) format.
+ * User can choose to work either with the portable format or with the deserialized form
+ * (assuming that class definitions are present in the classpath).
+ * <p>
+ * To work with the portable format directly, user should create a special cache projection
- * using {@link IgniteCache#withKeepPortable()} method and then retrieve individual fields as needed:
++ * using IgniteCache.withKeepPortable() method and then retrieve individual fields as needed:
+ * <pre name=code class=java>
+ * IgniteCache<PortableObject, PortableObject> prj = cache.withKeepPortable();
+ *
+ * // Convert instance of MyKey to portable format.
+ * // We could also use PortableBuilder to create the key in portable format directly.
+ * PortableObject key = grid.portables().toPortable(new MyKey());
+ *
+ * PortableObject val = prj.get(key);
+ *
+ * String field = val.field("myFieldName");
+ * </pre>
+ * Alternatively, if we have class definitions in the classpath, we may choose to work with deserialized
+ * typed objects at all times. In this case we do incur the deserialization cost. However, if
+ * {@link PortableMarshaller#isKeepDeserialized()} is {@code true} then Ignite will only deserialize on the first access
+ * and will cache the deserialized object, so it does not have to be deserialized again:
+ * <pre name=code class=java>
+ * IgniteCache<MyKey.class, MyValue.class> cache = grid.cache(null);
+ *
+ * MyValue val = cache.get(new MyKey());
+ *
+ * // Normal java getter.
+ * String fieldVal = val.getMyFieldName();
+ * </pre>
+ * If we used, for example, one of the automatically handled portable types for a key, like integer,
+ * and still wanted to work with binary portable format for values, then we would declare cache projection
+ * as follows:
+ * <pre name=code class=java>
+ * IgniteCache<Integer.class, PortableObject> prj = cache.withKeepPortable();
+ * </pre>
+ * <h1 class="header">Automatic Portable Types</h1>
+ * Note that only portable classes are converted to {@link PortableObject} format. Following
+ * classes are never converted (e.g., {@link #toPortable(Object)} method will return original
+ * object, and instances of these classes will be stored in cache without changes):
+ * <ul>
+ * <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li>
+ * <li>Arrays of primitives (byte[], int[], ...)</li>
+ * <li>{@link String} and array of {@link String}s</li>
+ * <li>{@link UUID} and array of {@link UUID}s</li>
+ * <li>{@link Date} and array of {@link Date}s</li>
+ * <li>{@link Timestamp} and array of {@link Timestamp}s</li>
+ * <li>Enums and array of enums</li>
+ * <li>
+ * Maps, collections and array of objects (but objects inside
+ * them will still be converted if they are portable)
+ * </li>
+ * </ul>
+ * <h1 class="header">Working With Maps and Collections</h1>
+ * All maps and collections in the portable objects are serialized automatically. When working
+ * with different platforms, e.g. C++ or .NET, Ignite will automatically pick the most
+ * adequate collection or map in either language. For example, {@link ArrayList} in Java will become
+ * {@code List} in C#, {@link LinkedList} in Java is {@link LinkedList} in C#, {@link HashMap}
+ * in Java is {@code Dictionary} in C#, and {@link TreeMap} in Java becomes {@code SortedDictionary}
+ * in C#, etc.
+ * <h1 class="header">Building Portable Objects</h1>
+ * Ignite comes with {@link PortableBuilder} which allows to build portable objects dynamically:
+ * <pre name=code class=java>
+ * PortableBuilder builder = Ignition.ignite().portables().builder();
+ *
+ * builder.typeId("MyObject");
+ *
+ * builder.stringField("fieldA", "A");
+ * build.intField("fieldB", "B");
+ *
+ * PortableObject portableObj = builder.build();
+ * </pre>
+ * For the cases when class definition is present
+ * in the class path, it is also possible to populate a standard POJO and then
+ * convert it to portable format, like so:
+ * <pre name=code class=java>
+ * MyObject obj = new MyObject();
+ *
+ * obj.setFieldA("A");
+ * obj.setFieldB(123);
+ *
+ * PortableObject portableObj = Ignition.ignite().portables().toPortable(obj);
+ * </pre>
+ * NOTE: you don't need to convert typed objects to portable format before storing
+ * them in cache, Ignite will do that automatically.
+ * <h1 class="header">Portable Metadata</h1>
+ * Even though Ignite portable protocol only works with hash codes for type and field names
+ * to achieve better performance, Ignite provides metadata for all portable types which
+ * can be queried ar runtime via any of the {@link IgnitePortables#metadata(Class)}
+ * methods. Having metadata also allows for proper formatting of {@code PortableObject#toString()} method,
+ * even when portable objects are kept in binary format only, which may be necessary for audit reasons.
+ * <h1 class="header">Dynamic Structure Changes</h1>
+ * Since objects are always cached in the portable binary format, server does not need to
+ * be aware of the class definitions. Moreover, if class definitions are not present or not
+ * used on the server, then clients can continuously change the structure of the portable
+ * objects without having to restart the cluster. For example, if one client stores a
+ * certain class with fields A and B, and another client stores the same class with
+ * fields B and C, then the server-side portable object will have the fields A, B, and C.
+ * As the structure of a portable object changes, the new fields become available for SQL queries
+ * automatically.
+ * <h1 class="header">Configuration</h1>
+ * By default all your objects are considered as portables and no specific configuration is needed.
+ * However, in some cases, like when an object is used by both Java and .Net, you may need to specify portable objects
+ * explicitly by calling {@link PortableMarshaller#setClassNames(Collection)}.
+ * The only requirement Ignite imposes is that your object has an empty
+ * constructor. Note, that since server side does not have to know the class definition,
+ * you only need to list portable objects in configuration on the client side. However, if you
+ * list them on the server side as well, then you get the ability to deserialize portable objects
+ * into concrete types on the server as well as on the client.
+ * <p>
+ * Here is an example of portable configuration (note that star (*) notation is supported):
+ * <pre name=code class=xml>
+ * ...
+ * <!-- Explicit portable objects configuration. -->
+ * <property name="marshaller">
+ * <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller">
+ * <property name="classNames">
+ * <list>
+ * <value>my.package.for.portable.objects.*</value>
+ * <value>org.apache.ignite.examples.client.portable.Employee</value>
+ * </list>
+ * </property>
+ * </bean>
+ * </property>
+ * ...
+ * </pre>
+ * or from code:
+ * <pre name=code class=java>
+ * IgniteConfiguration cfg = new IgniteConfiguration();
+ *
+ * PortableMarshaller marsh = new PortableMarshaller();
+ *
+ * marsh.setClassNames(Arrays.asList(
+ * Employee.class.getName(),
+ * Address.class.getName())
+ * );
+ *
+ * cfg.setMarshaller(marsh);
+ * </pre>
+ * You can also specify class name for a portable object via {@link PortableTypeConfiguration}.
+ * Do it in case if you need to override other configuration properties on per-type level, like
+ * ID-mapper, or serializer.
+ * <h1 class="header">Custom Affinity Keys</h1>
+ * Often you need to specify an alternate key (not the cache key) for affinity routing whenever
+ * storing objects in cache. For example, if you are caching {@code Employee} object with
+ * {@code Organization}, and want to colocate employees with organization they work for,
+ * so you can process them together, you need to specify an alternate affinity key.
+ * With portable objects you would have to do it as following:
+ * <pre name=code class=xml>
+ * <property name="marshaller">
+ * <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller">
+ * ...
+ * <property name="typeConfigurations">
+ * <list>
+ * <bean class="org.apache.ignite.portable.PortableTypeConfiguration">
+ * <property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/>
+ * <property name="affinityKeyFieldName" value="organizationId"/>
+ * </bean>
+ * </list>
+ * </property>
+ * ...
+ * </bean>
+ * </property>
+ * </pre>
+ * <h1 class="header">Serialization</h1>
+ * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom
+ * serialization logic by optionally implementing {@link PortableMarshalAware} interface, like so:
+ * <pre name=code class=java>
+ * public class Address implements PortableMarshalAware {
+ * private String street;
+ * private int zip;
+ *
+ * // Empty constructor required for portable deserialization.
+ * public Address() {}
+ *
+ * @Override public void writePortable(PortableWriter writer) throws PortableException {
+ * writer.writeString("street", street);
+ * writer.writeInt("zip", zip);
+ * }
+ *
+ * @Override public void readPortable(PortableReader reader) throws PortableException {
+ * street = reader.readString("street");
+ * zip = reader.readInt("zip");
+ * }
+ * }
+ * </pre>
+ * Alternatively, if you cannot change class definitions, you can provide custom serialization
+ * logic in {@link PortableSerializer} either globally in {@link PortableMarshaller} or
+ * for a specific type via {@link PortableTypeConfiguration} instance.
+ * <p>
+ * Similar to java serialization you can use {@code writeReplace()} and {@code readResolve()} methods.
+ * <ul>
+ * <li>
+ * {@code readResolve} is defined as follows: {@code ANY-ACCESS-MODIFIER Object readResolve()}.
+ * It may be used to replace the de-serialized object by another one of your choice.
+ * </li>
+ * <li>
+ * {@code writeReplace} is defined as follows: {@code ANY-ACCESS-MODIFIER Object writeReplace()}. This method
+ * allows the developer to provide a replacement object that will be serialized instead of the original one.
+ * </li>
+ * </ul>
+ *
+ * <h1 class="header">Custom ID Mappers</h1>
+ * Ignite implementation uses name hash codes to generate IDs for class names or field names
+ * internally. However, in cases when you want to provide your own ID mapping schema,
+ * you can provide your own {@link PortableIdMapper} implementation.
+ * <p>
+ * ID-mapper may be provided either globally in {@link PortableMarshaller},
+ * or for a specific type via {@link PortableTypeConfiguration} instance.
+ * <h1 class="header">Query Indexing</h1>
+ * Portable objects can be indexed for querying by specifying index fields in
+ * {@link org.apache.ignite.cache.CacheTypeMetadata} inside of specific
+ * {@link org.apache.ignite.configuration.CacheConfiguration} instance,
+ * like so:
+ * <pre name=code class=xml>
+ * ...
+ * <bean class="org.apache.ignite.cache.CacheConfiguration">
+ * ...
+ * <property name="typeMetadata">
+ * <list>
+ * <bean class="CacheTypeMetadata">
+ * <property name="type" value="Employee"/>
+ *
+ * <!-- Fields to index in ascending order. -->
+ * <property name="ascendingFields">
+ * <map>
+ * <entry key="name" value="java.lang.String"/>
+ *
+ * <!-- Nested portable objects can also be indexed. -->
+ * <entry key="address.zip" value="java.lang.Integer"/>
+ * </map>
+ * </property>
+ * </bean>
+ * </list>
+ * </property>
+ * </bean>
+ * </pre>
+ */
+public interface IgnitePortables {
+ /**
+ * Gets type ID for given type name.
+ *
+ * @param typeName Type name.
+ * @return Type ID.
+ */
+ public int typeId(String typeName);
+
+ /**
+ * Converts provided object to instance of {@link PortableObject}.
+ *
+ * @param obj Object to convert.
+ * @return Converted object.
+ * @throws PortableException In case of error.
+ */
+ public <T> T toPortable(@Nullable Object obj) throws PortableException;
+
+ /**
+ * Creates new portable builder.
+ *
+ * @param typeId ID of the type.
+ * @return Newly portable builder.
+ */
+ public PortableBuilder builder(int typeId);
+
+ /**
+ * Creates new portable builder.
+ *
+ * @param typeName Type name.
+ * @return Newly portable builder.
+ */
+ public PortableBuilder builder(String typeName);
+
+ /**
+ * Creates portable builder initialized by existing portable object.
+ *
+ * @param portableObj Portable object to initialize builder.
+ * @return Portable builder.
+ */
+ public PortableBuilder builder(PortableObject portableObj);
+
+ /**
+ * Gets metadata for provided class.
+ *
+ * @param cls Class.
+ * @return Metadata.
+ * @throws PortableException In case of error.
+ */
+ @Nullable public PortableMetadata metadata(Class<?> cls) throws PortableException;
+
+ /**
+ * Gets metadata for provided class name.
+ *
+ * @param typeName Type name.
+ * @return Metadata.
+ * @throws PortableException In case of error.
+ */
+ @Nullable public PortableMetadata metadata(String typeName) throws PortableException;
+
+ /**
+ * Gets metadata for provided type ID.
+ *
+ * @param typeId Type ID.
+ * @return Metadata.
+ * @throws PortableException In case of error.
+ */
+ @Nullable public PortableMetadata metadata(int typeId) throws PortableException;
+
+ /**
+ * Gets metadata for all known types.
+ *
+ * @return Metadata.
+ * @throws PortableException In case of error.
+ */
+ public Collection<PortableMetadata> metadata() throws PortableException;
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 9fb56bc,6ac2b64..d0b15ce
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@@ -17,10 -17,25 +17,17 @@@
package org.apache.ignite.configuration;
+ import java.io.Serializable;
+ import java.util.Collection;
-import java.util.HashSet;
+ import javax.cache.Cache;
+ import javax.cache.configuration.CompleteConfiguration;
+ import javax.cache.configuration.Factory;
+ import javax.cache.configuration.MutableConfiguration;
+ import javax.cache.expiry.ExpiryPolicy;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheAtomicWriteOrderMode;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheEntryProcessor;
-import org.apache.ignite.cache.CacheInterceptor;
-import org.apache.ignite.cache.CacheMemoryMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.CacheTypeMetadata;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.AffinityFunction;
import org.apache.ignite.cache.affinity.AffinityKeyMapper;
import org.apache.ignite.cache.eviction.EvictionFilter;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
index bfc34cd,0000000..30a9804
mode 100644,000000..100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
@@@ -1,358 -1,0 +1,358 @@@
+/*
+ * 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.marshaller.portable;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.portable.GridPortableMarshaller;
+import org.apache.ignite.internal.portable.PortableContext;
+import org.apache.ignite.marshaller.AbstractMarshaller;
+import org.apache.ignite.marshaller.MarshallerContext;
- import org.apache.ignite.portable.PortableException;
- import org.apache.ignite.portable.PortableIdMapper;
- import org.apache.ignite.portable.PortableObject;
- import org.apache.ignite.portable.PortableProtocolVersion;
- import org.apache.ignite.portable.PortableSerializer;
- import org.apache.ignite.portable.PortableTypeConfiguration;
++import org.apache.ignite.internal.portable.api.PortableException;
++import org.apache.ignite.internal.portable.api.PortableIdMapper;
++import org.apache.ignite.internal.portable.api.PortableObject;
++import org.apache.ignite.internal.portable.api.PortableProtocolVersion;
++import org.apache.ignite.internal.portable.api.PortableSerializer;
++import org.apache.ignite.internal.portable.api.PortableTypeConfiguration;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Implementation of {@link org.apache.ignite.marshaller.Marshaller} that lets to serialize and deserialize all objects
+ * in the portable format.
+ * <p>
+ * {@code PortableMarshaller} is tested only on Java HotSpot VM on other VMs it could yield unexpected results.
+ * <p>
+ * <h1 class="header">Configuration</h1>
+ * <h2 class="header">Mandatory</h2>
+ * This marshaller has no mandatory configuration parameters.
+ * <h2 class="header">Java Example</h2>
+ * <pre name="code" class="java">
+ * PortableMarshaller marshaller = new PortableMarshaller();
+ *
+ * IgniteConfiguration cfg = new IgniteConfiguration();
+ *
+ * // Override marshaller.
+ * cfg.setMarshaller(marshaller);
+ *
+ * // Starts grid.
+ * G.start(cfg);
+ * </pre>
+ * <h2 class="header">Spring Example</h2>
+ * PortableMarshaller can be configured from Spring XML configuration file:
+ * <pre name="code" class="xml">
+ * <bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" singleton="true">
+ * ...
+ * <property name="marshaller">
+ * <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller">
+ * ...
+ * </bean>
+ * </property>
+ * ...
+ * </bean>
+ * </pre>
+ * <p>
+ * <img src="http://ignite.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class PortableMarshaller extends AbstractMarshaller {
+ /** Default portable protocol version. */
+ public static final PortableProtocolVersion DFLT_PORTABLE_PROTO_VER = PortableProtocolVersion.VER_1_4_0;
+
+ /** Class names. */
+ private Collection<String> clsNames;
+
+ /** ID mapper. */
+ private PortableIdMapper idMapper;
+
+ /** Serializer. */
+ private PortableSerializer serializer;
+
+ /** Types. */
+ private Collection<PortableTypeConfiguration> typeCfgs;
+
+ /** Use timestamp flag. */
+ private boolean useTs = true;
+
+ /** Whether to convert string to bytes using UTF-8 encoding. */
+ private boolean convertString = true;
+
+ /** Meta data enabled flag. */
+ private boolean metaDataEnabled = true;
+
+ /** Keep deserialized flag. */
+ private boolean keepDeserialized = true;
+
+ /** Protocol version. */
+ private PortableProtocolVersion protoVer = DFLT_PORTABLE_PROTO_VER;
+
+ /** */
+ private GridPortableMarshaller impl;
+
+ /**
+ * Gets class names.
+ *
+ * @return Class names.
+ */
+ public Collection<String> getClassNames() {
+ return clsNames;
+ }
+
+ /**
+ * Sets class names of portable objects explicitly.
+ *
+ * @param clsNames Class names.
+ */
+ public void setClassNames(Collection<String> clsNames) {
+ this.clsNames = new ArrayList<>(clsNames.size());
+
+ for (String clsName : clsNames)
+ this.clsNames.add(clsName.trim());
+ }
+
+ /**
+ * Gets ID mapper.
+ *
+ * @return ID mapper.
+ */
+ public PortableIdMapper getIdMapper() {
+ return idMapper;
+ }
+
+ /**
+ * Sets ID mapper.
+ *
+ * @param idMapper ID mapper.
+ */
+ public void setIdMapper(PortableIdMapper idMapper) {
+ this.idMapper = idMapper;
+ }
+
+ /**
+ * Gets serializer.
+ *
+ * @return Serializer.
+ */
+ public PortableSerializer getSerializer() {
+ return serializer;
+ }
+
+ /**
+ * Sets serializer.
+ *
+ * @param serializer Serializer.
+ */
+ public void setSerializer(PortableSerializer serializer) {
+ this.serializer = serializer;
+ }
+
+ /**
+ * Gets types configuration.
+ *
+ * @return Types configuration.
+ */
+ public Collection<PortableTypeConfiguration> getTypeConfigurations() {
+ return typeCfgs;
+ }
+
+ /**
+ * Sets type configurations.
+ *
+ * @param typeCfgs Type configurations.
+ */
+ public void setTypeConfigurations(Collection<PortableTypeConfiguration> typeCfgs) {
+ this.typeCfgs = typeCfgs;
+ }
+
+ /**
+ * If {@code true} then date values converted to {@link Timestamp} on deserialization.
+ * <p>
+ * Default value is {@code true}.
+ *
+ * @return Flag indicating whether date values converted to {@link Timestamp} during unmarshalling.
+ */
+ public boolean isUseTimestamp() {
+ return useTs;
+ }
+
+ /**
+ * @param useTs Flag indicating whether date values converted to {@link Timestamp} during unmarshalling.
+ */
+ public void setUseTimestamp(boolean useTs) {
+ this.useTs = useTs;
+ }
+
+ /**
+ * Gets strings must be converted to or from bytes using UTF-8 encoding.
+ * <p>
+ * Default value is {@code true}.
+ *
+ * @return Flag indicating whether string must be converted to byte array using UTF-8 encoding.
+ */
+ public boolean isConvertStringToBytes() {
+ return convertString;
+ }
+
+ /**
+ * Sets strings must be converted to or from bytes using UTF-8 encoding.
+ * <p>
+ * Default value is {@code true}.
+ *
+ * @param convertString Flag indicating whether string must be converted to byte array using UTF-8 encoding.
+ */
+ public void setConvertStringToBytes(boolean convertString) {
+ this.convertString = convertString;
+ }
+
+ /**
+ * If {@code true}, meta data will be collected or all types. If you need to override this behaviour for
+ * some specific type, use {@link PortableTypeConfiguration#setMetaDataEnabled(Boolean)} method.
+ * <p>
+ * Default value if {@code true}.
+ *
+ * @return Whether meta data is collected.
+ */
+ public boolean isMetaDataEnabled() {
+ return metaDataEnabled;
+ }
+
+ /**
+ * @param metaDataEnabled Whether meta data is collected.
+ */
+ public void setMetaDataEnabled(boolean metaDataEnabled) {
+ this.metaDataEnabled = metaDataEnabled;
+ }
+
+ /**
+ * If {@code true}, {@link PortableObject} will cache deserialized instance after
+ * {@link PortableObject#deserialize()} is called. All consequent calls of this
+ * method on the same instance of {@link PortableObject} will return that cached
+ * value without actually deserializing portable object. If you need to override this
+ * behaviour for some specific type, use {@link PortableTypeConfiguration#setKeepDeserialized(Boolean)}
+ * method.
+ * <p>
+ * Default value if {@code true}.
+ *
+ * @return Whether deserialized value is kept.
+ */
+ public boolean isKeepDeserialized() {
+ return keepDeserialized;
+ }
+
+ /**
+ * @param keepDeserialized Whether deserialized value is kept.
+ */
+ public void setKeepDeserialized(boolean keepDeserialized) {
+ this.keepDeserialized = keepDeserialized;
+ }
+
+ /**
+ * Gets portable protocol version.
+ * <p>
+ * Defaults to {@link #DFLT_PORTABLE_PROTO_VER}.
+ *
+ * @return Portable protocol version.
+ */
+ public PortableProtocolVersion getProtocolVersion() {
+ return protoVer;
+ }
+
+ /**
+ * Sets portable protocol version.
+ * <p>
+ * Defaults to {@link #DFLT_PORTABLE_PROTO_VER}.
+ *
+ * @param protoVer Portable protocol version.
+ */
+ public void setProtocolVersion(PortableProtocolVersion protoVer) {
+ if (protoVer == null)
+ throw new IllegalArgumentException("Wrong portable protocol version: " + protoVer);
+
+ this.protoVer = protoVer;
+ }
+
+ /**
+ * Returns currently set {@link MarshallerContext}.
+ *
+ * @return Marshaller context.
+ */
+ public MarshallerContext getContext() {
+ return ctx;
+ }
+
+ /**
+ * Sets {@link PortableContext}.
+ * <p/>
+ * @param ctx Portable context.
+ */
+ private void setPortableContext(PortableContext ctx) {
+ ctx.configure(this);
+
+ impl = new GridPortableMarshaller(ctx);
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte[] marshal(@Nullable Object obj) throws IgniteCheckedException {
+ return impl.marshal(obj, 0);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void marshal(@Nullable Object obj, OutputStream out) throws IgniteCheckedException {
+ byte[] arr = marshal(obj);
+
+ try {
+ out.write(arr);
+ }
+ catch (IOException e) {
+ throw new PortableException("Failed to marshal the object: " + obj, e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> T unmarshal(byte[] bytes, @Nullable ClassLoader clsLdr) throws IgniteCheckedException {
+ return impl.deserialize(bytes, clsLdr);
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> T unmarshal(InputStream in, @Nullable ClassLoader clsLdr) throws IgniteCheckedException {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
++ ByteArrayOutputStream buf = new ByteArrayOutputStream();
+
+ byte[] arr = new byte[4096];
+ int cnt;
+
+ // we have to fully read the InputStream because GridPortableMarshaller requires support of a method that
+ // returns number of bytes remaining.
+ try {
+ while ((cnt = in.read(arr)) != -1)
- buffer.write(arr, 0, cnt);
++ buf.write(arr, 0, cnt);
+
- buffer.flush();
++ buf.flush();
+
- return impl.deserialize(buffer.toByteArray(), clsLdr);
++ return impl.deserialize(buf.toByteArray(), clsLdr);
+ }
+ catch (IOException e) {
+ throw new PortableException("Failed to unmarshal the object from InputStream", e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d1247152/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
----------------------------------------------------------------------