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/11/21 03:02:10 UTC
[32/50] [abbrv] ignite git commit: Merged ignite-1945 into ignite-1282
Merged ignite-1945 into ignite-1282
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c505f48a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c505f48a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c505f48a
Branch: refs/heads/ignite-1753-1282
Commit: c505f48a882e7fb702918d903a210fc0a7e65f5a
Parents: b876f76
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Fri Nov 20 12:07:27 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Fri Nov 20 12:07:27 2015 +0300
----------------------------------------------------------------------
.../config/binary/example-ignite-binary.xml | 2 +-
.../java/org/apache/ignite/IgniteBinary.java | 9 +-
.../java/org/apache/ignite/IgniteCache.java | 3 +-
.../apache/ignite/binary/BinaryIdMapper.java | 4 +-
.../org/apache/ignite/binary/BinaryObject.java | 5 +-
.../apache/ignite/binary/BinarySerializer.java | 4 +-
.../ignite/binary/BinaryTypeConfiguration.java | 47 +--
.../configuration/BinaryConfiguration.java | 139 +++++++
.../configuration/IgniteConfiguration.java | 29 +-
.../apache/ignite/internal/IgniteKernal.java | 7 +-
.../internal/portable/BinaryObjectImpl.java | 11 +-
.../portable/PortableClassDescriptor.java | 16 +-
.../internal/portable/PortableContext.java | 85 ++--
.../processors/cache/GridCacheProcessor.java | 4 +-
.../CacheObjectBinaryProcessorImpl.java | 17 +-
.../cache/store/CacheOsStoreManager.java | 4 +-
.../cpp/PlatformCppConfigurationClosure.java | 30 +-
.../PlatformDotNetConfigurationClosure.java | 34 +-
.../marshaller/portable/BinaryMarshaller.java | 146 +++++++
.../marshaller/portable/PortableMarshaller.java | 299 --------------
.../resources/META-INF/classnames.properties | 31 +-
.../portable/BinaryFieldsAbstractSelfTest.java | 33 +-
.../portable/BinaryFieldsHeapSelfTest.java | 4 +-
.../portable/BinaryFieldsOffheapSelfTest.java | 4 +-
.../BinaryFooterOffsetsAbstractSelfTest.java | 27 +-
.../BinaryFooterOffsetsHeapSelfTest.java | 4 +-
.../BinaryFooterOffsetsOffheapSelfTest.java | 4 +-
.../portable/BinaryMarshallerSelfTest.java | 402 +++++++------------
.../BinaryObjectBuilderAdditionalSelfTest.java | 13 +-
.../portable/BinaryObjectBuilderSelfTest.java | 43 +-
.../GridPortableAffinityKeySelfTest.java | 13 +-
...idPortableMarshallerCtxDisabledSelfTest.java | 10 +-
.../portable/GridPortableMetaDataSelfTest.java | 13 +-
.../portable/GridPortableWildcardsSelfTest.java | 243 ++++++-----
.../BinaryFieldsHeapNonCompactSelfTest.java | 4 -
...IgniteCacheAbstractExecutionContextTest.java | 4 +-
.../IgniteCacheTxExecutionContextTest.java | 2 -
...naryObjectsAbstractDataStreamerSelfTest.java | 10 +-
...aryObjectsAbstractMultiThreadedSelfTest.java | 10 +-
.../GridCacheBinaryObjectsAbstractSelfTest.java | 4 +-
...ntNodeBinaryObjectMetadataMultinodeTest.java | 4 +-
...CacheClientNodeBinaryObjectMetadataTest.java | 19 +-
.../GridCachePortableStoreAbstractSelfTest.java | 11 +-
...ridPortableCacheEntryMemorySizeSelfTest.java | 10 +-
...leDuplicateIndexObjectsAbstractSelfTest.java | 11 +-
.../DataStreamProcessorPortableSelfTest.java | 4 +-
.../GridDataStreamerImplSelfTest.java | 4 +-
...ridCacheAffinityRoutingPortableSelfTest.java | 13 +-
.../GridCacheMemoryModePortableSelfTest.java | 4 +-
...acheOffHeapTieredAtomicPortableSelfTest.java | 9 +-
...eapTieredEvictionAtomicPortableSelfTest.java | 9 +-
...heOffHeapTieredEvictionPortableSelfTest.java | 9 +-
.../GridCacheOffHeapTieredPortableSelfTest.java | 9 +-
...sNearPartitionedByteArrayValuesSelfTest.java | 4 +-
...sPartitionedOnlyByteArrayValuesSelfTest.java | 4 +-
.../IgnitePortableCacheFullApiTestSuite.java | 4 +-
.../IgnitePortableCacheTestSuite.java | 4 +-
.../IgnitePortableObjectsTestSuite.java | 2 +-
...niteCacheP2pUnmarshallingQueryErrorTest.java | 6 +-
.../IgnitePortableCacheQueryTestSuite.java | 4 +-
.../Config/Compute/compute-grid1.xml | 46 ++-
.../Config/marshaller-explicit.xml | 8 +-
62 files changed, 925 insertions(+), 1046 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/examples/config/binary/example-ignite-binary.xml
----------------------------------------------------------------------
diff --git a/examples/config/binary/example-ignite-binary.xml b/examples/config/binary/example-ignite-binary.xml
index cde15ea..dbec5e9 100644
--- a/examples/config/binary/example-ignite-binary.xml
+++ b/examples/config/binary/example-ignite-binary.xml
@@ -38,7 +38,7 @@
<bean parent="ignite.cfg">
<!-- Enables portable marshaller -->
<property name="marshaller">
- <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"/>
+ <bean class="org.apache.ignite.marshaller.portable.BinaryMarshaller"/>
</property>
</bean>
</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
index 364bf4b..5eb2670 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
@@ -25,7 +25,6 @@ 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.binary.BinaryObjectBuilder;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.binary.BinaryType;
@@ -69,7 +68,7 @@ import org.jetbrains.annotations.Nullable;
* </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
+ * {@link org.apache.ignite.marshaller.portable.BinaryMarshaller#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);
@@ -152,7 +151,7 @@ import org.jetbrains.annotations.Nullable;
* <h1 class="header">Configuration</h1>
* By default all your objects are considered as binary 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)}.
+ * explicitly by calling {@link org.apache.ignite.marshaller.portable.BinaryMarshaller#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
@@ -236,7 +235,7 @@ import org.jetbrains.annotations.Nullable;
* }
* </pre>
* Alternatively, if you cannot change class definitions, you can provide custom serialization
- * logic in {@link org.apache.ignite.binary.BinarySerializer} either globally in {@link PortableMarshaller} or
+ * logic in {@link org.apache.ignite.binary.BinarySerializer} either globally in {@link org.apache.ignite.marshaller.portable.BinaryMarshaller} or
* for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance.
* <p>
* Similar to java serialization you can use {@code writeReplace()} and {@code readResolve()} methods.
@@ -256,7 +255,7 @@ import org.jetbrains.annotations.Nullable;
* internally. However, in cases when you want to provide your own ID mapping schema,
* you can provide your own {@link org.apache.ignite.binary.BinaryIdMapper} implementation.
* <p>
- * ID-mapper may be provided either globally in {@link PortableMarshaller},
+ * ID-mapper may be provided either globally in {@link org.apache.ignite.marshaller.portable.BinaryMarshaller},
* or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance.
* <h1 class="header">Query Indexing</h1>
* Portable objects can be indexed for querying by specifying index fields in
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index 4cb82da..5fcf8a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -55,7 +55,6 @@ import org.apache.ignite.lang.IgniteAsyncSupported;
import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgniteFuture;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
import org.apache.ignite.mxbean.CacheMetricsMXBean;
import org.jetbrains.annotations.Nullable;
@@ -163,7 +162,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
* BinaryObject po = prj.get(1);
* </pre>
* <p>
- * Note that this method makes sense only if cache is working in binary mode ({@link PortableMarshaller} is used).
+ * Note that this method makes sense only if cache is working in binary mode ({@link org.apache.ignite.marshaller.portable.BinaryMarshaller} is used).
* If not, this method is no-op and will return current cache.
*
* @return New cache instance for portable objects.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java
index 363b34d..a4a18f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java
@@ -17,8 +17,6 @@
package org.apache.ignite.binary;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
-
/**
* Type and field ID mapper for binary objects. Ignite never writes full
* strings for field or type names. Instead, for performance reasons, Ignite
@@ -29,7 +27,7 @@ import org.apache.ignite.marshaller.portable.PortableMarshaller;
* actually do collide {@code BinaryIdMapper} allows to override the automatically
* generated hash code IDs for the type and field names.
* <p>
- * Binary ID mapper can be configured for all binary objects via {@link PortableMarshaller#getIdMapper()} method,
+ * Binary ID mapper can be configured for all binary objects via {@link org.apache.ignite.marshaller.portable.BinaryMarshaller#getIdMapper()} method,
* or for a specific binary type via {@link BinaryTypeConfiguration#getIdMapper()} method.
*/
public interface BinaryIdMapper {
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
index f098c16..2691c7b 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.TreeMap;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
/**
* Wrapper for binary object in binary format. Once an object is defined as binary,
@@ -46,9 +45,7 @@ import org.apache.ignite.marshaller.portable.PortableMarshaller;
* 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:
+ * typed objects at all times. In this case we do incur the deserialization cost.
* <pre name=code class=java>
* IgniteCache<MyKey.class, MyValue.class> cache = grid.cache(null);
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/binary/BinarySerializer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinarySerializer.java b/modules/core/src/main/java/org/apache/ignite/binary/BinarySerializer.java
index 6fa4237..31b3d30 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinarySerializer.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinarySerializer.java
@@ -17,15 +17,13 @@
package org.apache.ignite.binary;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
-
/**
* Interface that allows to implement custom serialization logic for binary objects.
* Can be used instead of {@link Binarylizable} in case if the class
* cannot be changed directly.
* <p>
* Binary serializer can be configured for all binary objects via
- * {@link PortableMarshaller#getSerializer()} method, or for a specific
+ * {@link org.apache.ignite.marshaller.portable.BinaryMarshaller#getSerializer()} method, or for a specific
* binary type via {@link BinaryTypeConfiguration#getSerializer()} method.
*/
public interface BinarySerializer {
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
index c737ee2..d216866 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
@@ -17,22 +17,20 @@
package org.apache.ignite.binary;
-import java.util.Collection;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.BinaryConfiguration;
/**
* Defines configuration properties for a specific binary type. Providing per-type
* configuration is optional, as it is generally enough, and also optional, to provide global binary
- * configuration using {@link PortableMarshaller#setClassNames(Collection)}.
+ * configuration using {@link IgniteConfiguration#setBinaryConfiguration(BinaryConfiguration)}.
* However, this class allows you to change configuration properties for a specific
* binary type without affecting configuration for other binary types.
- * <p>
- * Per-type binary configuration can be specified in {@link PortableMarshaller#getTypeConfigurations()} method.
*/
public class BinaryTypeConfiguration {
/** Class name. */
- private String clsName;
+ private String typeName;
/** ID mapper. */
private BinaryIdMapper idMapper;
@@ -40,9 +38,6 @@ public class BinaryTypeConfiguration {
/** Serializer. */
private BinarySerializer serializer;
- /** Keep deserialized flag. */
- private Boolean keepDeserialized;
-
/**
*/
public BinaryTypeConfiguration() {
@@ -50,10 +45,10 @@ public class BinaryTypeConfiguration {
}
/**
- * @param clsName Class name.
+ * @param typeName Class name.
*/
- public BinaryTypeConfiguration(String clsName) {
- this.clsName = clsName;
+ public BinaryTypeConfiguration(String typeName) {
+ this.typeName = typeName;
}
/**
@@ -61,17 +56,17 @@ public class BinaryTypeConfiguration {
*
* @return Type name.
*/
- public String getClassName() {
- return clsName;
+ public String getTypeName() {
+ return typeName;
}
/**
* Sets type name.
*
- * @param clsName Type name.
+ * @param typeName Type name.
*/
- public void setClassName(String clsName) {
- this.clsName = clsName;
+ public void setTypeName(String typeName) {
+ this.typeName = typeName;
}
/**
@@ -110,24 +105,6 @@ public class BinaryTypeConfiguration {
this.serializer = serializer;
}
- /**
- * Defines whether {@link BinaryObject} should cache deserialized instance. If provided,
- * this value will override {@link PortableMarshaller#isKeepDeserialized()}
- * property.
- *
- * @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;
- }
-
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(BinaryTypeConfiguration.class, this, super.toString());
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
new file mode 100644
index 0000000..6d8f918
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
@@ -0,0 +1,139 @@
+/*
+ * 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.configuration;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.apache.ignite.binary.BinaryIdMapper;
+import org.apache.ignite.binary.BinarySerializer;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+
+/**
+ * Configuration object for Ignite Binary Objects.
+ * @see org.apache.ignite.IgniteBinary
+ */
+public class BinaryConfiguration {
+ /** Default compact footer flag setting. */
+ public static final boolean DFLT_COMPACT_FOOTER = true;
+
+ /** ID mapper. */
+ private BinaryIdMapper idMapper;
+
+ /** Serializer. */
+ private BinarySerializer serializer;
+
+ /** Types. */
+ private Collection<BinaryTypeConfiguration> typeCfgs;
+
+ /** Compact footer flag. */
+ private boolean compactFooter = DFLT_COMPACT_FOOTER;
+
+ /**
+ * Sets class names of portable objects explicitly.
+ *
+ * @param clsNames Class names.
+ */
+ public void setClassNames(Collection<String> clsNames) {
+ if (typeCfgs == null)
+ typeCfgs = new ArrayList<>(clsNames.size());
+
+ for (String clsName : clsNames)
+ typeCfgs.add(new BinaryTypeConfiguration(clsName));
+ }
+
+ /**
+ * Gets ID mapper.
+ *
+ * @return ID mapper.
+ */
+ public BinaryIdMapper getIdMapper() {
+ return idMapper;
+ }
+
+ /**
+ * Sets ID mapper.
+ *
+ * @param idMapper ID mapper.
+ */
+ public void setIdMapper(BinaryIdMapper idMapper) {
+ this.idMapper = idMapper;
+ }
+
+ /**
+ * Gets serializer.
+ *
+ * @return Serializer.
+ */
+ public BinarySerializer getSerializer() {
+ return serializer;
+ }
+
+ /**
+ * Sets serializer.
+ *
+ * @param serializer Serializer.
+ */
+ public void setSerializer(BinarySerializer serializer) {
+ this.serializer = serializer;
+ }
+
+ /**
+ * Gets types configuration.
+ *
+ * @return Types configuration.
+ */
+ public Collection<BinaryTypeConfiguration> getTypeConfigurations() {
+ return typeCfgs;
+ }
+
+ /**
+ * Sets type configurations.
+ *
+ * @param typeCfgs Type configurations.
+ */
+ public void setTypeConfigurations(Collection<BinaryTypeConfiguration> typeCfgs) {
+ this.typeCfgs = typeCfgs;
+ }
+
+ /**
+ * Get whether to write footers in compact form. When enabled, Ignite will not write fields metadata
+ * when serializing objects, because internally {@code PortableMarshaller} already distribute metadata inside
+ * cluster. This increases serialization performance.
+ * <p>
+ * <b>WARNING!</b> This mode should be disabled when already serialized data can be taken from some external
+ * sources (e.g. cache store which stores data in binary form, data center replication, etc.). Otherwise binary
+ * objects without any associated metadata could appear in the cluster and Ignite will not be able to deserialize
+ * it.
+ * <p>
+ * Defaults to {@link #DFLT_COMPACT_FOOTER}.
+ *
+ * @return Whether to write footers in compact form.
+ */
+ public boolean isCompactFooter() {
+ return compactFooter;
+ }
+
+ /**
+ * Set whether to write footers in compact form. See {@link #isCompactFooter()} for more info.
+ *
+ * @param compactFooter Whether to write footers in compact form.
+ */
+ public void setCompactFooter(boolean compactFooter) {
+ this.compactFooter = compactFooter;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/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 2069a90..ee9f92a 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
@@ -437,6 +437,9 @@ public class IgniteConfiguration {
/** Cache key configuration. */
private CacheKeyConfiguration[] cacheKeyCfg;
+ /** */
+ private BinaryConfiguration binaryCfg;
+
/**
* Creates valid grid configuration with all default values.
*/
@@ -471,6 +474,7 @@ public class IgniteConfiguration {
addrRslvr = cfg.getAddressResolver();
allResolversPassReq = cfg.isAllSegmentationResolversPassRequired();
atomicCfg = cfg.getAtomicConfiguration();
+ binaryCfg = cfg.getBinaryConfiguration();
daemon = cfg.isDaemon();
cacheCfg = cfg.getCacheConfiguration();
cacheKeyCfg = cfg.getCacheKeyConfiguration();
@@ -1360,11 +1364,12 @@ public class IgniteConfiguration {
*
* Default is {@code 1} which has minimal impact on the operation of the grid.
*
- * @param size Size.
+ * @param rebalanceThreadPoolSize Number of system threads that will be assigned for partition transfer during
+ * rebalancing.
* @return {@code this} for chaining.
*/
- public IgniteConfiguration setRebalanceThreadPoolSize(int size) {
- this.rebalanceThreadPoolSize = size;
+ public IgniteConfiguration setRebalanceThreadPoolSize(int rebalanceThreadPoolSize) {
+ this.rebalanceThreadPoolSize = rebalanceThreadPoolSize;
return this;
}
@@ -2004,6 +2009,24 @@ public class IgniteConfiguration {
}
/**
+ * Gets configuration for Ignite Binary objects.
+ *
+ * @return Binary configuration object.
+ */
+ public BinaryConfiguration getBinaryConfiguration() {
+ return binaryCfg;
+ }
+
+ /**
+ * Sets configuration for Ignite Binary objects.
+ *
+ * @param binaryCfg Binary configuration object.
+ */
+ public void setBinaryConfiguration(BinaryConfiguration binaryCfg) {
+ this.binaryCfg = binaryCfg;
+ }
+
+ /**
* Gets flag indicating whether cache sanity check is enabled. If enabled, then Ignite
* will perform the following checks and throw an exception if check fails:
* <ul>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 2e8520e..1779ff0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -76,6 +76,7 @@ import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterMetrics;
import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.CollectionConfiguration;
import org.apache.ignite.configuration.ConnectorConfiguration;
@@ -156,7 +157,6 @@ import org.apache.ignite.lifecycle.LifecycleBean;
import org.apache.ignite.lifecycle.LifecycleEventType;
import org.apache.ignite.marshaller.MarshallerExclusions;
import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
import org.apache.ignite.mxbean.ClusterLocalNodeMetricsMXBean;
import org.apache.ignite.mxbean.IgniteMXBean;
import org.apache.ignite.mxbean.ThreadPoolMXBean;
@@ -1274,8 +1274,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
add(ATTR_MARSHALLER_USE_DFLT_SUID,
getBoolean(IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID, OptimizedMarshaller.USE_DFLT_SUID));
- if (cfg.getMarshaller() instanceof PortableMarshaller)
- add(ATTR_MARSHALLER_COMPACT_FOOTER, ((PortableMarshaller)cfg.getMarshaller()).isCompactFooter());
+ add(ATTR_MARSHALLER_COMPACT_FOOTER, cfg.getBinaryConfiguration() == null ?
+ BinaryConfiguration.DFLT_COMPACT_FOOTER :
+ cfg.getBinaryConfiguration().isCompactFooter());
add(ATTR_USER_NAME, System.getProperty("user.name"));
add(ATTR_GRID_NAME, gridName);
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java
index 37c88e2..65272b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java
@@ -65,8 +65,7 @@ import static org.apache.ignite.internal.portable.GridPortableMarshaller.UUID;
* Portable object implementation.
*/
@IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator.
-public final class BinaryObjectImpl extends BinaryObjectEx implements Externalizable,
- Message, CacheObject, KeyCacheObject {
+public final class BinaryObjectImpl extends BinaryObjectEx implements Externalizable, KeyCacheObject {
/** */
public static final byte TYPE_BINARY = 100;
@@ -133,7 +132,7 @@ public final class BinaryObjectImpl extends BinaryObjectEx implements Externaliz
Object obj0 = obj;
if (obj0 == null || cpy)
- obj0 = deserializeValue();
+ obj0 = deserializeValue(ctx);
return (T)obj0;
}
@@ -425,7 +424,7 @@ public final class BinaryObjectImpl extends BinaryObjectEx implements Externaliz
Object obj0 = obj;
if (obj0 == null)
- obj0 = deserializeValue();
+ obj0 = deserializeValue(null);
return (T)obj0;
@@ -555,7 +554,7 @@ public final class BinaryObjectImpl extends BinaryObjectEx implements Externaliz
* Runs value deserialization regardless of whether obj already has the deserialized value.
* Will set obj if descriptor is configured to keep deserialized values.
*/
- private Object deserializeValue() {
+ private Object deserializeValue(@Nullable CacheObjectContext coCtx) {
// TODO: IGNITE-1272 - Deserialize with proper class loader.
BinaryReaderExImpl reader = newReader();
@@ -565,7 +564,7 @@ public final class BinaryObjectImpl extends BinaryObjectEx implements Externaliz
assert desc != null;
- if (desc.keepDeserialized())
+ if (coCtx != null && coCtx.storeValue())
obj = obj0;
return obj0;
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
index c233267..a1720f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java
@@ -22,7 +22,6 @@ import org.apache.ignite.internal.processors.cache.CacheObjectImpl;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.MarshallerExclusions;
import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
import org.jetbrains.annotations.Nullable;
import java.io.Externalizable;
@@ -105,9 +104,6 @@ public class PortableClassDescriptor {
private final PortableSchemaRegistry schemaReg;
/** */
- private final boolean keepDeserialized;
-
- /** */
private final boolean registered;
/** */
@@ -126,7 +122,6 @@ public class PortableClassDescriptor {
* @param idMapper ID mapper.
* @param serializer Serializer.
* @param metaDataEnabled Metadata enabled flag.
- * @param keepDeserialized Keep deserialized flag.
* @param registered Whether typeId has been successfully registered by MarshallerContext or not.
* @param predefined Whether the class is predefined or not.
* @throws BinaryObjectException In case of error.
@@ -141,7 +136,6 @@ public class PortableClassDescriptor {
@Nullable BinaryIdMapper idMapper,
@Nullable BinarySerializer serializer,
boolean metaDataEnabled,
- boolean keepDeserialized,
boolean registered,
boolean predefined
) throws BinaryObjectException {
@@ -157,7 +151,6 @@ public class PortableClassDescriptor {
this.affKeyFieldName = affKeyFieldName;
this.serializer = serializer;
this.idMapper = idMapper;
- this.keepDeserialized = keepDeserialized;
this.registered = registered;
schemaReg = ctx.schemaRegistry(typeId);
@@ -320,13 +313,6 @@ public class PortableClassDescriptor {
}
/**
- * @return Keep deserialized flag.
- */
- boolean keepDeserialized() {
- return keepDeserialized;
- }
-
- /**
* @return Whether typeId has been successfully registered by MarshallerContext or not.
*/
public boolean registered() {
@@ -334,7 +320,7 @@ public class PortableClassDescriptor {
}
/**
- * @return {@code true} if {@link OptimizedMarshaller} must be used instead of {@link PortableMarshaller}
+ * @return {@code true} if {@link OptimizedMarshaller} must be used instead of {@link org.apache.ignite.marshaller.portable.BinaryMarshaller}
* for object serialization and deserialization.
*/
public boolean useOptimizedMarshaller() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
index a88498a..01bc9d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java
@@ -52,6 +52,7 @@ import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.CacheKeyConfiguration;
+import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.binary.BinaryTypeConfiguration;
import org.apache.ignite.binary.BinaryObjectException;
@@ -70,7 +71,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.marshaller.MarshallerContext;
import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.marshaller.portable.BinaryMarshaller;
import org.jetbrains.annotations.Nullable;
import org.jsr166.ConcurrentHashMap8;
@@ -126,9 +127,6 @@ public class PortableContext implements Externalizable {
/** */
private final OptimizedMarshaller optmMarsh = new OptimizedMarshaller();
- /** */
- private boolean keepDeserialized;
-
/** Compact footer flag. */
private boolean compactFooter;
@@ -224,61 +222,43 @@ public class PortableContext implements Externalizable {
* @param marsh Portable marshaller.
* @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
- public void configure(PortableMarshaller marsh) throws BinaryObjectException {
+ public void configure(BinaryMarshaller marsh, IgniteConfiguration cfg) throws BinaryObjectException {
if (marsh == null)
return;
- keepDeserialized = marsh.isKeepDeserialized();
-
marshCtx = marsh.getContext();
+ BinaryConfiguration binaryCfg = cfg.getBinaryConfiguration();
+
+ if (binaryCfg == null)
+ binaryCfg = new BinaryConfiguration();
+
assert marshCtx != null;
optmMarsh.setContext(marshCtx);
configure(
- marsh.getIdMapper(),
- marsh.getSerializer(),
- marsh.isKeepDeserialized(),
- marsh.getClassNames(),
- marsh.getTypeConfigurations()
+ binaryCfg.getIdMapper(),
+ binaryCfg.getSerializer(),
+ binaryCfg.getTypeConfigurations()
);
- compactFooter = marsh.isCompactFooter();
+ compactFooter = binaryCfg.isCompactFooter();
}
/**
* @param globalIdMapper ID mapper.
* @param globalSerializer Serializer.
- * @param globalKeepDeserialized Keep deserialized flag.
- * @param clsNames Class names.
* @param typeCfgs Type configurations.
* @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
private void configure(
BinaryIdMapper globalIdMapper,
BinarySerializer globalSerializer,
- boolean globalKeepDeserialized,
- Collection<String> clsNames,
Collection<BinaryTypeConfiguration> typeCfgs
) throws BinaryObjectException {
TypeDescriptors descs = new TypeDescriptors();
- if (clsNames != null) {
- BinaryIdMapper idMapper = BinaryInternalIdMapper.create(globalIdMapper);
-
- for (String clsName : clsNames) {
- if (clsName.endsWith(".*")) { // Package wildcard
- String pkgName = clsName.substring(0, clsName.length() - 2);
-
- for (String clsName0 : classesInPackage(pkgName))
- descs.add(clsName0, idMapper, null, null, globalKeepDeserialized, true);
- }
- else // Regular single class
- descs.add(clsName, idMapper, null, null, globalKeepDeserialized, true);
- }
- }
-
Map<String, String> affFields = new HashMap<>();
if (!F.isEmpty(igniteCfg.getCacheKeyConfiguration())) {
@@ -288,7 +268,7 @@ public class PortableContext implements Externalizable {
if (typeCfgs != null) {
for (BinaryTypeConfiguration typeCfg : typeCfgs) {
- String clsName = typeCfg.getClassName();
+ String clsName = typeCfg.getTypeName();
if (clsName == null)
throw new BinaryObjectException("Class name is required for portable type configuration.");
@@ -305,25 +285,21 @@ public class PortableContext implements Externalizable {
if (typeCfg.getSerializer() != null)
serializer = typeCfg.getSerializer();
- boolean keepDeserialized = typeCfg.isKeepDeserialized() != null ? typeCfg.isKeepDeserialized() :
- globalKeepDeserialized;
-
if (clsName.endsWith(".*")) {
String pkgName = clsName.substring(0, clsName.length() - 2);
for (String clsName0 : classesInPackage(pkgName))
descs.add(clsName0, idMapper, serializer, affFields.get(clsName0),
- keepDeserialized, true);
+ true);
}
else
descs.add(clsName, idMapper, serializer, affFields.get(clsName),
- keepDeserialized, false);
+ false);
}
}
for (TypeDescriptor desc : descs.descriptors()) {
- registerUserType(desc.clsName, desc.idMapper, desc.serializer, desc.affKeyFieldName,
- desc.keepDeserialized);
+ registerUserType(desc.clsName, desc.idMapper, desc.serializer, desc.affKeyFieldName);
}
}
@@ -491,7 +467,6 @@ public class PortableContext implements Externalizable {
BinaryInternalIdMapper.defaultInstance(),
null,
false,
- keepDeserialized,
true, /* registered */
false /* predefined */
);
@@ -538,11 +513,14 @@ public class PortableContext implements Externalizable {
idMapper,
null,
true,
- keepDeserialized,
registered,
false /* predefined */
);
+ Collection<PortableSchema> schemas = desc.schema() != null ? Collections.singleton(desc.schema()) : null;
+
+ metaHnd.addMeta(typeId, new BinaryMetadata(typeId, typeName, desc.fieldsMeta(), null, schemas).wrap(this));
+
// perform put() instead of putIfAbsent() because "registered" flag might have been changed or class loader
// might have reloaded described class.
if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
@@ -552,10 +530,6 @@ public class PortableContext implements Externalizable {
mappers.putIfAbsent(typeId, idMapper);
- Collection<PortableSchema> schemas = desc.schema() != null ? Collections.singleton(desc.schema()) : null;
-
- metaHnd.addMeta(typeId, new BinaryMetadata(typeId, typeName, desc.fieldsMeta(), null, schemas).wrap(this));
-
return desc;
}
@@ -679,7 +653,6 @@ public class PortableContext implements Externalizable {
BinaryInternalIdMapper.defaultInstance(),
null,
false,
- false,
true, /* registered */
true /* predefined */
);
@@ -697,15 +670,13 @@ public class PortableContext implements Externalizable {
* @param idMapper ID mapper.
* @param serializer Serializer.
* @param affKeyFieldName Affinity key field name.
- * @param keepDeserialized Keep deserialized flag.
* @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
@SuppressWarnings("ErrorNotRethrown")
public void registerUserType(String clsName,
BinaryIdMapper idMapper,
@Nullable BinarySerializer serializer,
- @Nullable String affKeyFieldName,
- boolean keepDeserialized)
+ @Nullable String affKeyFieldName)
throws BinaryObjectException {
assert idMapper != null;
@@ -750,7 +721,6 @@ public class PortableContext implements Externalizable {
idMapper,
serializer,
true,
- keepDeserialized,
true, /* registered */
false /* predefined */
);
@@ -926,7 +896,7 @@ public class PortableContext implements Externalizable {
*/
private static class TypeDescriptors {
/** Descriptors map. */
- private final Map<String, TypeDescriptor> descs = new HashMap<>();
+ private final Map<String, TypeDescriptor> descs = new LinkedHashMap<>();
/**
* Add type descriptor.
@@ -935,7 +905,6 @@ public class PortableContext implements Externalizable {
* @param idMapper ID mapper.
* @param serializer Serializer.
* @param affKeyFieldName Affinity key field name.
- * @param keepDeserialized Keep deserialized flag.
* @param canOverride Whether this descriptor can be override.
* @throws org.apache.ignite.binary.BinaryObjectException If failed.
*/
@@ -943,14 +912,12 @@ public class PortableContext implements Externalizable {
BinaryIdMapper idMapper,
BinarySerializer serializer,
String affKeyFieldName,
- boolean keepDeserialized,
boolean canOverride)
throws BinaryObjectException {
TypeDescriptor desc = new TypeDescriptor(clsName,
idMapper,
serializer,
affKeyFieldName,
- keepDeserialized,
canOverride);
TypeDescriptor oldDesc = descs.get(clsName);
@@ -987,9 +954,6 @@ public class PortableContext implements Externalizable {
/** Affinity key field name. */
private String affKeyFieldName;
- /** Keep deserialized flag. */
- private boolean keepDeserialized;
-
/** Whether this descriptor can be override. */
private boolean canOverride;
@@ -1000,16 +964,14 @@ public class PortableContext implements Externalizable {
* @param idMapper ID mapper.
* @param serializer Serializer.
* @param affKeyFieldName Affinity key field name.
- * @param keepDeserialized Keep deserialized flag.
* @param canOverride Whether this descriptor can be override.
*/
private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer serializer,
- String affKeyFieldName, boolean keepDeserialized, boolean canOverride) {
+ String affKeyFieldName, boolean canOverride) {
this.clsName = clsName;
this.idMapper = idMapper;
this.serializer = serializer;
this.affKeyFieldName = affKeyFieldName;
- this.keepDeserialized = keepDeserialized;
this.canOverride = canOverride;
}
@@ -1026,7 +988,6 @@ public class PortableContext implements Externalizable {
idMapper = other.idMapper;
serializer = other.serializer;
affKeyFieldName = other.affKeyFieldName;
- keepDeserialized = other.keepDeserialized;
canOverride = other.canOverride;
}
else if (!other.canOverride)
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/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 4fe8d84..4439eee 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
@@ -112,7 +112,7 @@ import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.lifecycle.LifecycleAware;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.jdk.JdkMarshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.marshaller.portable.BinaryMarshaller;
import org.apache.ignite.spi.IgniteNodeValidationResult;
import org.jetbrains.annotations.Nullable;
@@ -1019,7 +1019,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
// Intentionally compare Boolean references using '!=' below to check if the flag has been explicitly set.
if (cfg.isKeepBinaryInStore() && cfg.isKeepBinaryInStore() != CacheConfiguration.DFLT_KEEP_BINARY_IN_STORE
- && !(ctx.config().getMarshaller() instanceof PortableMarshaller))
+ && !(ctx.config().getMarshaller() instanceof BinaryMarshaller))
U.warn(log, "CacheConfiguration.isKeepBinaryInStore() configuration property will be ignored because " +
"PortableMarshaller is not used");
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
index 551ada5..05e9263 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java
@@ -69,7 +69,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.marshaller.portable.BinaryMarshaller;
import org.jetbrains.annotations.Nullable;
import org.jsr166.ConcurrentHashMap8;
import sun.misc.Unsafe;
@@ -157,7 +157,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public void start() throws IgniteCheckedException {
- if (marsh instanceof PortableMarshaller) {
+ if (marsh instanceof BinaryMarshaller) {
BinaryMetadataHandler metaHnd = new BinaryMetadataHandler() {
@Override public void addMeta(int typeId, BinaryType newMeta) throws BinaryObjectException {
assert newMeta != null;
@@ -201,11 +201,12 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
}
};
- PortableMarshaller pMarh0 = (PortableMarshaller)marsh;
+ BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh;
portableCtx = new PortableContext(metaHnd, ctx.config());
- IgniteUtils.invoke(PortableMarshaller.class, pMarh0, "setPortableContext", portableCtx);
+ IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx,
+ ctx.config());
portableMarsh = new GridPortableMarshaller(portableCtx);
@@ -272,12 +273,12 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
}
}
- startLatch.countDown();
-
for (Map.Entry<Integer, BinaryMetadata> e : metaBuf.entrySet())
addMeta(e.getKey(), e.getValue().wrap(portableCtx));
metaBuf.clear();
+
+ startLatch.countDown();
}
/** {@inheritDoc} */
@@ -544,7 +545,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public boolean isPortableEnabled(CacheConfiguration<?, ?> ccfg) {
- return marsh instanceof PortableMarshaller;
+ return marsh instanceof BinaryMarshaller;
}
/**
@@ -601,7 +602,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
@Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException {
assert cfg != null;
- boolean portableEnabled = marsh instanceof PortableMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) &&
+ boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) &&
!GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName());
CacheObjectContext ctx0 = super.contextForCache(cfg);
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
index b84908d..29d5155 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
@@ -23,7 +23,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.processors.platform.PlatformProcessor;
import org.apache.ignite.internal.processors.platform.cache.store.PlatformCacheStore;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.marshaller.portable.BinaryMarshaller;
/**
* Default store manager implementation.
@@ -82,6 +82,6 @@ public class CacheOsStoreManager extends GridCacheStoreManagerAdapter {
/** {@inheritDoc} */
@Override public boolean configuredConvertPortable() {
- return !(ctx.config().getMarshaller() instanceof PortableMarshaller && cfg.isKeepBinaryInStore());
+ return !(ctx.config().getMarshaller() instanceof BinaryMarshaller && cfg.isKeepBinaryInStore());
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cpp/PlatformCppConfigurationClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cpp/PlatformCppConfigurationClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cpp/PlatformCppConfigurationClosure.java
index e9cd1e3..b53cc46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cpp/PlatformCppConfigurationClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cpp/PlatformCppConfigurationClosure.java
@@ -19,13 +19,14 @@ package org.apache.ignite.internal.processors.platform.cpp;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.PlatformConfiguration;
import org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure;
import org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManagerImpl;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
+import org.apache.ignite.marshaller.portable.BinaryMarshaller;
import org.apache.ignite.platform.cpp.PlatformCppConfiguration;
import java.util.Collections;
@@ -71,20 +72,27 @@ public class PlatformCppConfigurationClosure extends PlatformAbstractConfigurati
Marshaller marsh = igniteCfg.getMarshaller();
if (marsh == null) {
- PortableMarshaller marsh0 = new PortableMarshaller();
-
- marsh0.setCompactFooter(false);
-
- igniteCfg.setMarshaller(marsh0);
+ igniteCfg.setMarshaller(new BinaryMarshaller());
cppCfg0.warnings(Collections.singleton("Marshaller is automatically set to " +
- PortableMarshaller.class.getName() + " (other nodes must have the same marshaller type)."));
+ BinaryMarshaller.class.getName() + " (other nodes must have the same marshaller type)."));
}
- else if (!(marsh instanceof PortableMarshaller))
- throw new IgniteException("Unsupported marshaller (only " + PortableMarshaller.class.getName() +
+ else if (!(marsh instanceof BinaryMarshaller))
+ throw new IgniteException("Unsupported marshaller (only " + BinaryMarshaller.class.getName() +
" can be used when running Apache Ignite C++): " + marsh.getClass().getName());
- else if (((PortableMarshaller)marsh).isCompactFooter())
- throw new IgniteException("Unsupported " + PortableMarshaller.class.getName() +
+
+ BinaryConfiguration bCfg = igniteCfg.getBinaryConfiguration();
+
+ if (bCfg == null) {
+ bCfg = new BinaryConfiguration();
+
+ bCfg.setCompactFooter(false);
+
+ igniteCfg.setBinaryConfiguration(bCfg);
+ }
+
+ if (bCfg.isCompactFooter())
+ throw new IgniteException("Unsupported " + BinaryMarshaller.class.getName() +
" \"compactFooter\" flag: must be false when running Apache Ignite C++.");
// Set Ignite home so that marshaller context works.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
index a59fd22..a0c5a0b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.platform.dotnet;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.PlatformConfiguration;
import org.apache.ignite.internal.MarshallerContextImpl;
@@ -36,8 +37,8 @@ import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lifecycle.LifecycleBean;
import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.portable.PortableMarshaller;
import org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration;
+import org.apache.ignite.marshaller.portable.BinaryMarshaller;
import org.apache.ignite.platform.dotnet.PlatformDotNetLifecycleBean;
import java.util.ArrayList;
@@ -92,20 +93,27 @@ public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigur
Marshaller marsh = igniteCfg.getMarshaller();
if (marsh == null) {
- PortableMarshaller marsh0 = new PortableMarshaller();
-
- marsh0.setCompactFooter(false);
-
- igniteCfg.setMarshaller(marsh0);
+ igniteCfg.setMarshaller(new BinaryMarshaller());
dotNetCfg0.warnings(Collections.singleton("Marshaller is automatically set to " +
- PortableMarshaller.class.getName() + " (other nodes must have the same marshaller type)."));
+ BinaryMarshaller.class.getName() + " (other nodes must have the same marshaller type)."));
}
- else if (!(marsh instanceof PortableMarshaller))
- throw new IgniteException("Unsupported marshaller (only " + PortableMarshaller.class.getName() +
+ else if (!(marsh instanceof BinaryMarshaller))
+ throw new IgniteException("Unsupported marshaller (only " + BinaryMarshaller.class.getName() +
" can be used when running Apache Ignite.NET): " + marsh.getClass().getName());
- else if (((PortableMarshaller)marsh).isCompactFooter())
- throw new IgniteException("Unsupported " + PortableMarshaller.class.getName() +
+
+ BinaryConfiguration bCfg = igniteCfg.getBinaryConfiguration();
+
+ if (bCfg == null) {
+ bCfg = new BinaryConfiguration();
+
+ bCfg.setCompactFooter(false);
+
+ igniteCfg.setBinaryConfiguration(bCfg);
+ }
+
+ if (bCfg.isCompactFooter())
+ throw new IgniteException("Unsupported " + BinaryMarshaller.class.getName() +
" \"compactFooter\" flag: must be false when running Apache Ignite.NET.");
// Set Ignite home so that marshaller context works.
@@ -235,11 +243,11 @@ public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigur
try {
PortableContext ctx = new PortableContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration());
- PortableMarshaller marsh = new PortableMarshaller();
+ BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(new MarshallerContextImpl(null));
- ctx.configure(marsh);
+ ctx.configure(marsh, new IgniteConfiguration());
return new GridPortableMarshaller(ctx);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/BinaryMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/BinaryMarshaller.java
new file mode 100644
index 0000000..455c83e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/BinaryMarshaller.java
@@ -0,0 +1,146 @@
+/*
+ * 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 org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.configuration.IgniteConfiguration;
+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.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 BinaryMarshaller extends AbstractMarshaller {
+ /** */
+ private GridPortableMarshaller impl;
+
+ /**
+ * Returns currently set {@link MarshallerContext}.
+ *
+ * @return Marshaller context.
+ */
+ public MarshallerContext getContext() {
+ return ctx;
+ }
+
+ /**
+ * Sets {@link PortableContext}.
+ * <p/>
+ * @param ctx Portable context.
+ */
+ @SuppressWarnings("UnusedDeclaration")
+ private void setPortableContext(PortableContext ctx, IgniteConfiguration cfg) {
+ ctx.configure(this, cfg);
+
+ impl = new GridPortableMarshaller(ctx);
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte[] marshal(@Nullable Object obj) throws IgniteCheckedException {
+ return impl.marshal(obj);
+ }
+
+ /** {@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 BinaryObjectException("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 buf = new ByteArrayOutputStream();
+
+ // we have to fully read the InputStream because GridPortableMarshaller requires support of a method that
+ // returns number of bytes remaining.
+ try {
+ byte[] arr = new byte[4096];
+
+ int cnt;
+
+ while ((cnt = in.read(arr)) != -1)
+ buf.write(arr, 0, cnt);
+
+ buf.flush();
+
+ return impl.deserialize(buf.toByteArray(), clsLdr);
+ }
+ catch (IOException e) {
+ throw new BinaryObjectException("Failed to unmarshal the object from InputStream", e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onUndeploy(ClassLoader ldr) {
+ impl.context().onUndeploy(ldr);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
----------------------------------------------------------------------
diff --git 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
deleted file mode 100644
index 1704c8a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.marshaller.portable;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-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.binary.BinaryTypeConfiguration;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryIdMapper;
-import org.apache.ignite.binary.BinarySerializer;
-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 value of "keep deserialized" flag. */
- public static final boolean DFLT_KEEP_DESERIALIZED = true;
-
- /** Default value of "compact footer" flag. */
- public static final boolean DFLT_COMPACT_FOOTER = true;
-
- // TODO ignite-1282 Move to IgniteConfiguration.
- /** Class names. */
- private Collection<String> clsNames;
-
- /** ID mapper. */
- private BinaryIdMapper idMapper;
-
- /** Serializer. */
- private BinarySerializer serializer;
-
- /** Types. */
- private Collection<BinaryTypeConfiguration> typeCfgs;
-
- /** Keep deserialized flag. */
- private boolean keepDeserialized = DFLT_KEEP_DESERIALIZED;
-
- /** Compact footer. */
- private boolean compactFooter = DFLT_COMPACT_FOOTER;
-
- /** */
- 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 BinaryIdMapper getIdMapper() {
- return idMapper;
- }
-
- /**
- * Sets ID mapper.
- *
- * @param idMapper ID mapper.
- */
- public void setIdMapper(BinaryIdMapper idMapper) {
- this.idMapper = idMapper;
- }
-
- /**
- * Gets serializer.
- *
- * @return Serializer.
- */
- public BinarySerializer getSerializer() {
- return serializer;
- }
-
- /**
- * Sets serializer.
- *
- * @param serializer Serializer.
- */
- public void setSerializer(BinarySerializer serializer) {
- this.serializer = serializer;
- }
-
- /**
- * Gets types configuration.
- *
- * @return Types configuration.
- */
- public Collection<BinaryTypeConfiguration> getTypeConfigurations() {
- return typeCfgs;
- }
-
- /**
- * Sets type configurations.
- *
- * @param typeCfgs Type configurations.
- */
- public void setTypeConfigurations(Collection<BinaryTypeConfiguration> typeCfgs) {
- this.typeCfgs = typeCfgs;
- }
-
- /**
- * If {@code true}, {@link org.apache.ignite.binary.BinaryObject} will cache deserialized instance after
- * {@link org.apache.ignite.binary.BinaryObject#deserialize()} is called. All consequent calls of this
- * method on the same instance of {@link org.apache.ignite.binary.BinaryObject} will return that cached
- * value without actually deserializing portable object. If you need to override this
- * behaviour for some specific type, use {@link org.apache.ignite.binary.BinaryTypeConfiguration#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;
- }
-
- /**
- * Get whether to write footers in compact form. When enabled, Ignite will not write fields metadata
- * when serializing objects, because internally {@code PortableMarshaller} already distribute metadata inside
- * cluster. This increases serialization performance.
- * <p>
- * <b>WARNING!</b> This mode should be disabled when already serialized data can be taken from some external
- * sources (e.g. cache store which stores data in binary form, data center replication, etc.). Otherwise binary
- * objects without any associated metadata could appear in the cluster and Ignite will not be able to deserialize
- * it.
- * <p>
- * Defaults to {@link #DFLT_COMPACT_FOOTER}.
- *
- * @return Whether to write footers in compact form.
- */
- public boolean isCompactFooter() {
- return compactFooter;
- }
-
- /**
- * Set whether to write footers in compact form. See {@link #isCompactFooter()} for more info.
- *
- * @param compactFooter Whether to write footers in compact form.
- */
- public void setCompactFooter(boolean compactFooter) {
- this.compactFooter = compactFooter;
- }
-
- /**
- * Returns currently set {@link MarshallerContext}.
- *
- * @return Marshaller context.
- */
- public MarshallerContext getContext() {
- return ctx;
- }
-
- /**
- * Sets {@link PortableContext}.
- * <p/>
- * @param ctx Portable context.
- */
- @SuppressWarnings("UnusedDeclaration")
- 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);
- }
-
- /** {@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 BinaryObjectException("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 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)
- buf.write(arr, 0, cnt);
-
- buf.flush();
-
- return impl.deserialize(buf.toByteArray(), clsLdr);
- }
- catch (IOException e) {
- throw new BinaryObjectException("Failed to unmarshal the object from InputStream", e);
- }
- }
-
- /** {@inheritDoc} */
- @Override public void onUndeploy(ClassLoader ldr) {
- impl.context().onUndeploy(ldr);
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c505f48a/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 4b2c8ee..94deec2 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -292,13 +292,14 @@ org.apache.ignite.internal.managers.eventstorage.GridEventStorageMessage
org.apache.ignite.internal.managers.indexing.GridIndexingManager$1
org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerAdapter
org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerManager$1
-org.apache.ignite.internal.portable.BinaryMetaDataImpl
+org.apache.ignite.internal.portable.BinaryMetadata
org.apache.ignite.internal.portable.BinaryObjectEx
org.apache.ignite.internal.portable.BinaryObjectImpl
org.apache.ignite.internal.portable.BinaryObjectOffheapImpl
org.apache.ignite.internal.portable.BinaryReaderExImpl$Flag
org.apache.ignite.internal.portable.PortableClassDescriptor$Mode
org.apache.ignite.internal.portable.PortableContext
+org.apache.ignite.internal.portable.PortableSchema
org.apache.ignite.internal.portable.builder.PortableLazyMap$1$1$1
org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion
org.apache.ignite.internal.processors.affinity.GridAffinityAssignment
@@ -434,6 +435,7 @@ org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$3
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$4
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$5
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$6
+org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$7
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeFutureSet
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$MessageHandler
org.apache.ignite.internal.processors.cache.GridCacheProcessor$2
@@ -542,7 +544,7 @@ org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtGetFuture$1
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtGetFuture$2
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtGetFuture$3
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException
-org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition$4
+org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition$3
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLockFuture$1
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLockFuture$2
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLockFuture$3
@@ -577,7 +579,6 @@ org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFutu
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$3
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$4
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$5
-org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture$6
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareResponse
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxRemote
@@ -636,16 +637,18 @@ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtFor
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysRequest
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysResponse
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandPool$1
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandPool$2$1
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandPool$DemandWorker$1
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandPool$DemandWorker$2
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$2
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$4$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$DemandWorker$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$DemandWorker$2
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplier$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplier$SupplyContextPhase
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyPool$1
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyPool$DemandMessage
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessageV2
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsAbstractMessage
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture$2
@@ -654,7 +657,6 @@ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPar
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleMessage
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleRequest
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$10
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$2
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$3
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$4
@@ -739,10 +741,11 @@ org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$9
org.apache.ignite.internal.processors.cache.portable.CacheDefaultPortableAffinityKeyMapper
org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$1
org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$4
+org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$5
org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$MetaDataEntryFilter
org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$MetaDataPredicate
-org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$MetaDataProcessor
-org.apache.ignite.internal.processors.cache.portable.PortableMetaDataKey
+org.apache.ignite.internal.processors.cache.portable.CacheObjectBinaryProcessorImpl$MetadataProcessor
+org.apache.ignite.internal.processors.cache.portable.PortableMetadataKey
org.apache.ignite.internal.processors.cache.query.CacheQueryType
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$1
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$3
@@ -1158,7 +1161,8 @@ org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandle
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$GetAndRemoveCommand
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$GetAndReplaceCommand
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$GetCommand
-org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$MetadataCommand
+org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$MetadataJob
+org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$MetadataTask
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$MetricsCommand
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$PrependCommand
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler$PutAllCommand
@@ -1174,6 +1178,7 @@ org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheRestResponse
org.apache.ignite.internal.processors.rest.handlers.datastructures.DataStructuresCommandHandler$1
org.apache.ignite.internal.processors.rest.handlers.query.CacheQueryFieldsMetaResult
org.apache.ignite.internal.processors.rest.handlers.query.CacheQueryResult
+org.apache.ignite.internal.processors.rest.handlers.query.QueryCommandHandler$QueryCursorIterator
org.apache.ignite.internal.processors.rest.handlers.task.GridTaskCommandHandler$2
org.apache.ignite.internal.processors.rest.handlers.task.GridTaskCommandHandler$ExeCallable
org.apache.ignite.internal.processors.rest.handlers.task.GridTaskResultRequest