diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java index d5f8cc09308af..01be0bc7e0552 100644 --- a/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java +++ b/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java @@ -27,20 +27,20 @@ public class CacheClientBinaryExampleTest extends GridAbstractExamplesTest { /** {@inheritDoc} */ @Override protected String defaultConfig() { - return "examples/config/portable/example-ignite-portable.xml"; + return "examples/config/binary/example-ignite-binary.xml"; } /** * @throws Exception If failed. */ - public void testPortablePutGetExample() throws Exception { + public void testBinaryPutGetExample() throws Exception { CacheClientBinaryPutGetExample.main(new String[] {}); } /** * @throws Exception If failed. */ - public void testPortableQueryExample() throws Exception { + public void testBinaryQueryExample() throws Exception { CacheClientBinaryQueryExample.main(new String[] {}); } } diff --git a/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java index bdba7c3196d8d..5dcad62d2ddb8 100644 --- a/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java +++ b/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java @@ -25,13 +25,13 @@ public class ComputeClientBinaryExampleTest extends GridAbstractExamplesTest { /** {@inheritDoc} */ @Override protected String defaultConfig() { - return "examples/config/portable/example-ignite-portable.xml"; + return "examples/config/binary/example-ignite-binary.xml"; } /** * @throws Exception If failed. */ - public void testPortableTaskExecutionExample() throws Exception { + public void testBinaryTaskExecutionExample() throws Exception { ComputeClientBinaryTaskExecutionExample.main(new String[] {}); } } diff --git a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java index 54fa8a3717c77..fcf9be90e2715 100644 --- a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java +++ b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java @@ -88,7 +88,7 @@ public static TestSuite suite() throws Exception { suite.addTest(new TestSuite(MemcacheRestExamplesMultiNodeSelfTest.class)); suite.addTest(new TestSuite(MonteCarloExamplesMultiNodeSelfTest.class)); - // Portable. + // Binary. suite.addTest(new TestSuite(CacheClientBinaryExampleTest.class)); suite.addTest(new TestSuite(ComputeClientBinaryExampleTest.class)); diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java index bd7ca717163b0..22e9a2545fa91 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java @@ -26,7 +26,7 @@ import org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler; import org.apache.ignite.internal.util.typedef.F; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; /** * Tests conversions between GridClientCacheFlag. @@ -37,7 +37,7 @@ public class ClientCacheFlagsCodecTest extends TestCase { */ public void testEncodingDecodingFullness() { for (GridClientCacheFlag f : GridClientCacheFlag.values()) { - if (f == KEEP_PORTABLES) + if (f == KEEP_BINARIES) continue; int bits = GridClientConnection.encodeCacheFlags(Collections.singleton(f)); @@ -71,8 +71,8 @@ private void doTestGroup(GridClientCacheFlag... flags) { boolean out = GridCacheCommandHandler.parseCacheFlags(bits); - int length = flagSet.contains(KEEP_PORTABLES) ? flagSet.size() - 1 : flagSet.size(); + int length = flagSet.contains(KEEP_BINARIES) ? flagSet.size() - 1 : flagSet.size(); assertEquals(length > 0, out); } -} \ No newline at end of file +} diff --git a/modules/clients/src/test/resources/spring-server-node.xml b/modules/clients/src/test/resources/spring-server-node.xml index 176f0d5adc536..f52640b46033f 100644 --- a/modules/clients/src/test/resources/spring-server-node.xml +++ b/modules/clients/src/test/resources/spring-server-node.xml @@ -123,12 +123,12 @@ - + - + @@ -146,7 +146,7 @@ - + @@ -159,7 +159,7 @@ - + diff --git a/modules/clients/src/test/resources/spring-server-ssl-node.xml b/modules/clients/src/test/resources/spring-server-ssl-node.xml index ceaab53f0d23b..073ac6562887d 100644 --- a/modules/clients/src/test/resources/spring-server-ssl-node.xml +++ b/modules/clients/src/test/resources/spring-server-ssl-node.xml @@ -125,12 +125,12 @@ - + - + @@ -148,7 +148,7 @@ - + @@ -161,7 +161,7 @@ - + diff --git a/modules/core/pom.xml b/modules/core/pom.xml index e4e975e5bb98c..065082dcc1e6b 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -36,8 +36,8 @@ - ignite-portables-test-repo - file://${basedir}/src/test/portables/repo + ignite-binaries-test-repo + file://${basedir}/src/test/binaries/repo 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 2f68e7a87db09..450cf7088555e 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java @@ -32,11 +32,11 @@ import org.jetbrains.annotations.Nullable; /** - * Defines portable objects functionality. With portable objects you are able to: + * Defines binary objects functionality. With binary objects you are able to: * * Seamlessly interoperate between Java, .NET, and C++. - * Make any object portable with zero code change to your existing code. - * Nest portable objects within each other. + * Make any object binary with zero code change to your existing code. + * Nest binary objects within each other. * Automatically handle {@code circular} or {@code null} references. * Automatically convert collections and maps between Java, .NET, and C++. * @@ -45,24 +45,24 @@ * * Avoid need to have concrete class definitions on the server side. * Dynamically change structure of the classes without having to restart the cluster. - * Index into portable objects for querying purposes. + * Index into binary objects for querying purposes. * - * Working With Portables Directly - * 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 + * Working With Binaries Directly + * Once an object is defined as binary, + * Ignite will always store it in memory in the binary (i.e. binary) format. + * User can choose to work either with the binary format or with the deserialized form * (assuming that class definitions are present in the classpath). * - * To work with the portable format directly, user should create a special cache projection + * To work with the binary format directly, user should create a special cache projection * using IgniteCache.withKeepBinary() method and then retrieve individual fields as needed: * - * IgniteCache<PortableObject, PortableObject> prj = cache.withKeepBinary(); + * IgniteCache<BinaryObject, BinaryObject> prj = cache.withKeepBinary(); * - * // Convert instance of MyKey to portable format. - * // We could also use PortableBuilder to create the key in portable format directly. - * PortableObject key = grid.binary().toBinary(new MyKey()); + * // Convert instance of MyKey to binary format. + * // We could also use BinaryBuilder to create the key in binary format directly. + * BinaryObject key = grid.binary().toBinary(new MyKey()); * - * PortableObject val = prj.get(key); + * BinaryObject val = prj.get(key); * * String field = val.field("myFieldName"); * @@ -76,14 +76,14 @@ * // Normal java getter. * String fieldVal = val.getMyFieldName(); * - * 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 + * If we used, for example, one of the automatically handled binary types for a key, like integer, + * and still wanted to work with binary binary format for values, then we would declare cache projection * as follows: * - * IgniteCache<Integer.class, PortableObject> prj = cache.withKeepBinary(); + * IgniteCache<Integer.class, BinaryObject> prj = cache.withKeepBinary(); * - * Automatic Portable Types - * Note that only portable classes are converted to {@link org.apache.ignite.binary.BinaryObject} format. Following + * Automatic Binary Types + * Note that only binary classes are converted to {@link org.apache.ignite.binary.BinaryObject} format. Following * classes are never converted (e.g., {@link #toBinary(Object)} method will return original * object, and instances of these classes will be stored in cache without changes): * @@ -96,74 +96,74 @@ * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * Working With Maps and Collections - * All maps and collections in the portable objects are serialized automatically. When working + * All maps and collections in the binary 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. - * Building Portable Objects - * Ignite comes with {@link org.apache.ignite.binary.BinaryObjectBuilder} which allows to build portable objects dynamically: + * Building Binary Objects + * Ignite comes with {@link org.apache.ignite.binary.BinaryObjectBuilder} which allows to build binary objects dynamically: * - * PortableBuilder builder = Ignition.ignite().binary().builder(); + * BinaryBuilder builder = Ignition.ignite().binary().builder(); * * builder.typeId("MyObject"); * * builder.stringField("fieldA", "A"); * build.intField("fieldB", "B"); * - * PortableObject portableObj = builder.build(); + * BinaryObject binaryObj = builder.build(); * * 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: + * convert it to binary format, like so: * * MyObject obj = new MyObject(); * * obj.setFieldA("A"); * obj.setFieldB(123); * - * PortableObject portableObj = Ignition.ignite().binary().toBinary(obj); + * BinaryObject binaryObj = Ignition.ignite().binary().toBinary(obj); * - * NOTE: you don't need to convert typed objects to portable format before storing + * NOTE: you don't need to convert typed objects to binary format before storing * them in cache, Ignite will do that automatically. - * Portable Metadata - * 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 + * Binary Metadata + * Even though Ignite binary protocol only works with hash codes for type and field names + * to achieve better performance, Ignite provides metadata for all binary types which * can be queried ar runtime via any of the {@link IgniteBinary#type(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. + * methods. Having metadata also allows for proper formatting of {@code BinaryObject#toString()} method, + * even when binary objects are kept in binary format only, which may be necessary for audit reasons. * Dynamic Structure Changes - * Since objects are always cached in the portable binary format, server does not need to + * Since objects are always cached in the binary 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 + * used on the server, then clients can continuously change the structure of the binary * 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 + * fields B and C, then the server-side binary object will have the fields A, B, and C. + * As the structure of a binary object changes, the new fields become available for SQL queries * automatically. * Configuration * By default all your objects are considered as binary and no specific configuration is needed. * 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 + * you only need to list binary 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 binary objects * into concrete types on the server as well as on the client. * - * Here is an example of portable configuration (note that star (*) notation is supported): + * Here is an example of binary configuration (note that star (*) notation is supported): * * ... - * <!-- Explicit portable objects configuration. --> + * <!-- Explicit binary objects configuration. --> * <property name="marshaller"> - * <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"> + * <bean class="org.apache.ignite.marshaller.binary.BinaryMarshaller"> * <property name="classNames"> * <list> - * <value>my.package.for.portable.objects.*</value> - * <value>org.apache.ignite.examples.client.portable.Employee</value> + * <value>my.package.for.binary.objects.*</value> + * <value>org.apache.ignite.examples.client.binary.Employee</value> * </list> * </property> * </bean> @@ -174,7 +174,7 @@ * * IgniteConfiguration cfg = new IgniteConfiguration(); * - * PortableMarshaller marsh = new PortableMarshaller(); + * BinaryMarshaller marsh = new BinaryMarshaller(); * * marsh.setClassNames(Arrays.asList( * Employee.class.getName(), @@ -183,7 +183,7 @@ * * cfg.setMarshaller(marsh); * - * You can also specify class name for a portable object via {@link org.apache.ignite.binary.BinaryTypeConfiguration}. + * You can also specify class name for a binary object via {@link org.apache.ignite.binary.BinaryTypeConfiguration}. * Do it in case if you need to override other configuration properties on per-type level, like * ID-mapper, or serializer. * Custom Affinity Keys @@ -191,15 +191,15 @@ * 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: + * With binary objects you would have to do it as following: * * <property name="marshaller"> - * <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller"> + * <bean class="org.gridgain.grid.marshaller.binary.BinaryMarshaller"> * ... * <property name="typeConfigurations"> * <list> - * <bean class="org.apache.ignite.binary.PortableTypeConfiguration"> - * <property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/> + * <bean class="org.apache.ignite.binary.BinaryTypeConfiguration"> + * <property name="className" value="org.apache.ignite.examples.client.binary.EmployeeKey"/> * <property name="affinityKeyFieldName" value="organizationId"/> * </bean> * </list> @@ -212,19 +212,19 @@ * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom * serialization logic by optionally implementing {@link org.apache.ignite.binary.Binarylizable} interface, like so: * - * public class Address implements PortableMarshalAware { + * public class Address implements BinaryMarshalAware { * private String street; * private int zip; * - * // Empty constructor required for portable deserialization. + * // Empty constructor required for binary deserialization. * public Address() {} * - * @Override public void writeBinary(PortableWriter writer) throws PortableException { + * @Override public void writeBinary(BinaryWriter writer) throws BinaryException { * writer.writeString("street", street); * writer.writeInt("zip", zip); * } * - * @Override public void readBinary(PortableReader reader) throws PortableException { + * @Override public void readBinary(BinaryReader reader) throws BinaryException { * street = reader.readString("street"); * zip = reader.readInt("zip"); * } @@ -255,7 +255,7 @@ * ID-mapper may be provided either globally in {@link org.apache.ignite.configuration.BinaryConfiguration}, * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. * Query Indexing - * Portable objects can be indexed for querying by specifying index fields in + * Binary 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: @@ -273,7 +273,7 @@ * <map> * <entry key="name" value="java.lang.String"/> * - * <!-- Nested portable objects can also be indexed. --> + * <!-- Nested binary objects can also be indexed. --> * <entry key="address.zip" value="java.lang.Integer"/> * </map> * </property> @@ -302,20 +302,20 @@ public interface IgniteBinary { public T toBinary(@Nullable Object obj) throws BinaryObjectException; /** - * Creates new portable builder. + * Creates new binary builder. * * @param typeName Type name. - * @return Newly portable builder. + * @return Newly binary builder. */ public BinaryObjectBuilder builder(String typeName) throws BinaryObjectException; /** - * Creates portable builder initialized by existing portable object. + * Creates binary builder initialized by existing binary object. * - * @param portableObj Portable object to initialize builder. - * @return Portable builder. + * @param binaryObj Binary object to initialize builder. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj) throws BinaryObjectException; + public BinaryObjectBuilder builder(BinaryObject binaryObj) throws BinaryObjectException; /** * Gets metadata for provided class. 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 3376abce61ae9..f98d50adb7ac1 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -138,7 +138,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the cache can contain only following types: * - * org.apache.ignite.binary.PortableObject for portable classes + * org.apache.ignite.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -148,7 +148,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * @@ -158,7 +158,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * * IgniteCache prj = cache.withKeepBinary(); * - * // Value is not deserialized and returned in portable format. + * // Value is not deserialized and returned in binary format. * BinaryObject po = prj.get(1); * * @@ -166,7 +166,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * if default marshaller is used. * If not, this method is no-op and will return current cache. * - * @return New cache instance for portable objects. + * @return New cache instance for binary objects. */ public IgniteCache withKeepBinary(); diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java index be7a156117e8a..93a9469eb1592 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * Reader for portable objects used in {@link Binarylizable} implementations. + * Reader for binary objects used in {@link Binarylizable} implementations. * Useful for the cases when user wants a fine-grained control over serialization. * * Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
- * To work with the portable format directly, user should create a special cache projection + * To work with the binary format directly, user should create a special cache projection * using IgniteCache.withKeepBinary() method and then retrieve individual fields as needed: *
- * IgniteCache<PortableObject, PortableObject> prj = cache.withKeepBinary(); + * IgniteCache<BinaryObject, BinaryObject> prj = cache.withKeepBinary(); * - * // Convert instance of MyKey to portable format. - * // We could also use PortableBuilder to create the key in portable format directly. - * PortableObject key = grid.binary().toBinary(new MyKey()); + * // Convert instance of MyKey to binary format. + * // We could also use BinaryBuilder to create the key in binary format directly. + * BinaryObject key = grid.binary().toBinary(new MyKey()); * - * PortableObject val = prj.get(key); + * BinaryObject val = prj.get(key); * * String field = val.field("myFieldName"); *
- * IgniteCache<Integer.class, PortableObject> prj = cache.withKeepBinary(); + * IgniteCache<Integer.class, BinaryObject> prj = cache.withKeepBinary(); *
- * PortableBuilder builder = Ignition.ignite().binary().builder(); + * BinaryBuilder builder = Ignition.ignite().binary().builder(); * * builder.typeId("MyObject"); * * builder.stringField("fieldA", "A"); * build.intField("fieldB", "B"); * - * PortableObject portableObj = builder.build(); + * BinaryObject binaryObj = builder.build(); *
* MyObject obj = new MyObject(); * * obj.setFieldA("A"); * obj.setFieldB(123); * - * PortableObject portableObj = Ignition.ignite().binary().toBinary(obj); + * BinaryObject binaryObj = Ignition.ignite().binary().toBinary(obj); *
- * Here is an example of portable configuration (note that star (*) notation is supported): + * Here is an example of binary configuration (note that star (*) notation is supported): *
* ... - * <!-- Explicit portable objects configuration. --> + * <!-- Explicit binary objects configuration. --> * <property name="marshaller"> - * <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"> + * <bean class="org.apache.ignite.marshaller.binary.BinaryMarshaller"> * <property name="classNames"> * <list> - * <value>my.package.for.portable.objects.*</value> - * <value>org.apache.ignite.examples.client.portable.Employee</value> + * <value>my.package.for.binary.objects.*</value> + * <value>org.apache.ignite.examples.client.binary.Employee</value> * </list> * </property> * </bean> @@ -174,7 +174,7 @@ * * IgniteConfiguration cfg = new IgniteConfiguration(); * - * PortableMarshaller marsh = new PortableMarshaller(); + * BinaryMarshaller marsh = new BinaryMarshaller(); * * marsh.setClassNames(Arrays.asList( * Employee.class.getName(), @@ -183,7 +183,7 @@ * * cfg.setMarshaller(marsh); * - * You can also specify class name for a portable object via {@link org.apache.ignite.binary.BinaryTypeConfiguration}. + * You can also specify class name for a binary object via {@link org.apache.ignite.binary.BinaryTypeConfiguration}. * Do it in case if you need to override other configuration properties on per-type level, like * ID-mapper, or serializer. * Custom Affinity Keys @@ -191,15 +191,15 @@ * 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: + * With binary objects you would have to do it as following: * * <property name="marshaller"> - * <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller"> + * <bean class="org.gridgain.grid.marshaller.binary.BinaryMarshaller"> * ... * <property name="typeConfigurations"> * <list> - * <bean class="org.apache.ignite.binary.PortableTypeConfiguration"> - * <property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/> + * <bean class="org.apache.ignite.binary.BinaryTypeConfiguration"> + * <property name="className" value="org.apache.ignite.examples.client.binary.EmployeeKey"/> * <property name="affinityKeyFieldName" value="organizationId"/> * </bean> * </list> @@ -212,19 +212,19 @@ * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom * serialization logic by optionally implementing {@link org.apache.ignite.binary.Binarylizable} interface, like so: * - * public class Address implements PortableMarshalAware { + * public class Address implements BinaryMarshalAware { * private String street; * private int zip; * - * // Empty constructor required for portable deserialization. + * // Empty constructor required for binary deserialization. * public Address() {} * - * @Override public void writeBinary(PortableWriter writer) throws PortableException { + * @Override public void writeBinary(BinaryWriter writer) throws BinaryException { * writer.writeString("street", street); * writer.writeInt("zip", zip); * } * - * @Override public void readBinary(PortableReader reader) throws PortableException { + * @Override public void readBinary(BinaryReader reader) throws BinaryException { * street = reader.readString("street"); * zip = reader.readInt("zip"); * } @@ -255,7 +255,7 @@ * ID-mapper may be provided either globally in {@link org.apache.ignite.configuration.BinaryConfiguration}, * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. * Query Indexing - * Portable objects can be indexed for querying by specifying index fields in + * Binary 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: @@ -273,7 +273,7 @@ * <map> * <entry key="name" value="java.lang.String"/> * - * <!-- Nested portable objects can also be indexed. --> + * <!-- Nested binary objects can also be indexed. --> * <entry key="address.zip" value="java.lang.Integer"/> * </map> * </property> @@ -302,20 +302,20 @@ public interface IgniteBinary { public T toBinary(@Nullable Object obj) throws BinaryObjectException; /** - * Creates new portable builder. + * Creates new binary builder. * * @param typeName Type name. - * @return Newly portable builder. + * @return Newly binary builder. */ public BinaryObjectBuilder builder(String typeName) throws BinaryObjectException; /** - * Creates portable builder initialized by existing portable object. + * Creates binary builder initialized by existing binary object. * - * @param portableObj Portable object to initialize builder. - * @return Portable builder. + * @param binaryObj Binary object to initialize builder. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj) throws BinaryObjectException; + public BinaryObjectBuilder builder(BinaryObject binaryObj) throws BinaryObjectException; /** * Gets metadata for provided class. 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 3376abce61ae9..f98d50adb7ac1 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -138,7 +138,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the cache can contain only following types: * - * org.apache.ignite.binary.PortableObject for portable classes + * org.apache.ignite.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -148,7 +148,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * @@ -158,7 +158,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * * IgniteCache prj = cache.withKeepBinary(); * - * // Value is not deserialized and returned in portable format. + * // Value is not deserialized and returned in binary format. * BinaryObject po = prj.get(1); * * @@ -166,7 +166,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * if default marshaller is used. * If not, this method is no-op and will return current cache. * - * @return New cache instance for portable objects. + * @return New cache instance for binary objects. */ public IgniteCache withKeepBinary(); diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java index be7a156117e8a..93a9469eb1592 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * Reader for portable objects used in {@link Binarylizable} implementations. + * Reader for binary objects used in {@link Binarylizable} implementations. * Useful for the cases when user wants a fine-grained control over serialization. * * Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
* IgniteConfiguration cfg = new IgniteConfiguration(); * - * PortableMarshaller marsh = new PortableMarshaller(); + * BinaryMarshaller marsh = new BinaryMarshaller(); * * marsh.setClassNames(Arrays.asList( * Employee.class.getName(), @@ -183,7 +183,7 @@ * * cfg.setMarshaller(marsh); *
* <property name="marshaller"> - * <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller"> + * <bean class="org.gridgain.grid.marshaller.binary.BinaryMarshaller"> * ... * <property name="typeConfigurations"> * <list> - * <bean class="org.apache.ignite.binary.PortableTypeConfiguration"> - * <property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/> + * <bean class="org.apache.ignite.binary.BinaryTypeConfiguration"> + * <property name="className" value="org.apache.ignite.examples.client.binary.EmployeeKey"/> * <property name="affinityKeyFieldName" value="organizationId"/> * </bean> * </list> @@ -212,19 +212,19 @@ * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom * serialization logic by optionally implementing {@link org.apache.ignite.binary.Binarylizable} interface, like so: * - * public class Address implements PortableMarshalAware { + * public class Address implements BinaryMarshalAware { * private String street; * private int zip; * - * // Empty constructor required for portable deserialization. + * // Empty constructor required for binary deserialization. * public Address() {} * - * @Override public void writeBinary(PortableWriter writer) throws PortableException { + * @Override public void writeBinary(BinaryWriter writer) throws BinaryException { * writer.writeString("street", street); * writer.writeInt("zip", zip); * } * - * @Override public void readBinary(PortableReader reader) throws PortableException { + * @Override public void readBinary(BinaryReader reader) throws BinaryException { * street = reader.readString("street"); * zip = reader.readInt("zip"); * } @@ -255,7 +255,7 @@ * ID-mapper may be provided either globally in {@link org.apache.ignite.configuration.BinaryConfiguration}, * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. * Query Indexing - * Portable objects can be indexed for querying by specifying index fields in + * Binary 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: @@ -273,7 +273,7 @@ * <map> * <entry key="name" value="java.lang.String"/> * - * <!-- Nested portable objects can also be indexed. --> + * <!-- Nested binary objects can also be indexed. --> * <entry key="address.zip" value="java.lang.Integer"/> * </map> * </property> @@ -302,20 +302,20 @@ public interface IgniteBinary { public T toBinary(@Nullable Object obj) throws BinaryObjectException; /** - * Creates new portable builder. + * Creates new binary builder. * * @param typeName Type name. - * @return Newly portable builder. + * @return Newly binary builder. */ public BinaryObjectBuilder builder(String typeName) throws BinaryObjectException; /** - * Creates portable builder initialized by existing portable object. + * Creates binary builder initialized by existing binary object. * - * @param portableObj Portable object to initialize builder. - * @return Portable builder. + * @param binaryObj Binary object to initialize builder. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj) throws BinaryObjectException; + public BinaryObjectBuilder builder(BinaryObject binaryObj) throws BinaryObjectException; /** * Gets metadata for provided class. 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 3376abce61ae9..f98d50adb7ac1 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -138,7 +138,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the cache can contain only following types: * - * org.apache.ignite.binary.PortableObject for portable classes + * org.apache.ignite.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -148,7 +148,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * @@ -158,7 +158,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * * IgniteCache prj = cache.withKeepBinary(); * - * // Value is not deserialized and returned in portable format. + * // Value is not deserialized and returned in binary format. * BinaryObject po = prj.get(1); * * @@ -166,7 +166,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * if default marshaller is used. * If not, this method is no-op and will return current cache. * - * @return New cache instance for portable objects. + * @return New cache instance for binary objects. */ public IgniteCache withKeepBinary(); diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java index be7a156117e8a..93a9469eb1592 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * Reader for portable objects used in {@link Binarylizable} implementations. + * Reader for binary objects used in {@link Binarylizable} implementations. * Useful for the cases when user wants a fine-grained control over serialization. * * Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
- * public class Address implements PortableMarshalAware { + * public class Address implements BinaryMarshalAware { * private String street; * private int zip; * - * // Empty constructor required for portable deserialization. + * // Empty constructor required for binary deserialization. * public Address() {} * - * @Override public void writeBinary(PortableWriter writer) throws PortableException { + * @Override public void writeBinary(BinaryWriter writer) throws BinaryException { * writer.writeString("street", street); * writer.writeInt("zip", zip); * } * - * @Override public void readBinary(PortableReader reader) throws PortableException { + * @Override public void readBinary(BinaryReader reader) throws BinaryException { * street = reader.readString("street"); * zip = reader.readInt("zip"); * } @@ -255,7 +255,7 @@ * ID-mapper may be provided either globally in {@link org.apache.ignite.configuration.BinaryConfiguration}, * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. * Query Indexing - * Portable objects can be indexed for querying by specifying index fields in + * Binary 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: @@ -273,7 +273,7 @@ * <map> * <entry key="name" value="java.lang.String"/> * - * <!-- Nested portable objects can also be indexed. --> + * <!-- Nested binary objects can also be indexed. --> * <entry key="address.zip" value="java.lang.Integer"/> * </map> * </property> @@ -302,20 +302,20 @@ public interface IgniteBinary { public T toBinary(@Nullable Object obj) throws BinaryObjectException; /** - * Creates new portable builder. + * Creates new binary builder. * * @param typeName Type name. - * @return Newly portable builder. + * @return Newly binary builder. */ public BinaryObjectBuilder builder(String typeName) throws BinaryObjectException; /** - * Creates portable builder initialized by existing portable object. + * Creates binary builder initialized by existing binary object. * - * @param portableObj Portable object to initialize builder. - * @return Portable builder. + * @param binaryObj Binary object to initialize builder. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj) throws BinaryObjectException; + public BinaryObjectBuilder builder(BinaryObject binaryObj) throws BinaryObjectException; /** * Gets metadata for provided class. 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 3376abce61ae9..f98d50adb7ac1 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -138,7 +138,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the cache can contain only following types: * - * org.apache.ignite.binary.PortableObject for portable classes + * org.apache.ignite.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -148,7 +148,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * @@ -158,7 +158,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * * IgniteCache prj = cache.withKeepBinary(); * - * // Value is not deserialized and returned in portable format. + * // Value is not deserialized and returned in binary format. * BinaryObject po = prj.get(1); * * @@ -166,7 +166,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * if default marshaller is used. * If not, this method is no-op and will return current cache. * - * @return New cache instance for portable objects. + * @return New cache instance for binary objects. */ public IgniteCache withKeepBinary(); diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java index be7a156117e8a..93a9469eb1592 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * Reader for portable objects used in {@link Binarylizable} implementations. + * Reader for binary objects used in {@link Binarylizable} implementations. * Useful for the cases when user wants a fine-grained control over serialization. * * Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
org.apache.ignite.binary.PortableObject
org.apache.ignite.binary.BinaryObject
@@ -158,7 +158,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * * IgniteCache prj = cache.withKeepBinary(); * - * // Value is not deserialized and returned in portable format. + * // Value is not deserialized and returned in binary format. * BinaryObject po = prj.get(1); * * @@ -166,7 +166,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * if default marshaller is used. * If not, this method is no-op and will return current cache. * - * @return New cache instance for portable objects. + * @return New cache instance for binary objects. */ public IgniteCache withKeepBinary(); diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java index be7a156117e8a..93a9469eb1592 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * Reader for portable objects used in {@link Binarylizable} implementations. + * Reader for binary objects used in {@link Binarylizable} implementations. * Useful for the cases when user wants a fine-grained control over serialization. * * Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
* IgniteCache prj = cache.withKeepBinary(); * - * // Value is not deserialized and returned in portable format. + * // Value is not deserialized and returned in binary format. * BinaryObject po = prj.get(1); *
@@ -166,7 +166,7 @@ public interface IgniteCache extends javax.cache.Cache, IgniteAsyncS * if default marshaller is used. * If not, this method is no-op and will return current cache. * - * @return New cache instance for portable objects. + * @return New cache instance for binary objects. */ public IgniteCache withKeepBinary(); diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java index be7a156117e8a..93a9469eb1592 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java @@ -25,7 +25,7 @@ import java.util.UUID; /** - * Reader for portable objects used in {@link Binarylizable} implementations. + * Reader for binary objects used in {@link Binarylizable} implementations. * Useful for the cases when user wants a fine-grained control over serialization. * * Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
* Note that Ignite never writes full strings for field or type names. Instead, @@ -286,4 +286,4 @@ public Collection readCollection(String fieldName, BinaryCollectionFactor * @return Raw reader. */ public BinaryRawReader rawReader(); -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java index c879da6f11c69..fb5b0399f36a8 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java @@ -29,8 +29,8 @@ * will help to map keys to the same nodes whenever possible. * * Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
* Note that on case clients exist they will query this object from the server and use it for affinity calculation. - * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format, - * i.e. all parties have object class(es) configured as portable. + * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format, + * i.e. all parties have object class(es) configured as binary. * * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead. */ @@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable { */ @Deprecated public Object resolve(ClusterNode node); -} \ No newline at end of file +} 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 index 6d8f91876abe7..1151245b6aeda 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java @@ -44,7 +44,7 @@ public class BinaryConfiguration { private boolean compactFooter = DFLT_COMPACT_FOOTER; /** - * Sets class names of portable objects explicitly. + * Sets class names of binary objects explicitly. * * @param clsNames Class names. */ @@ -112,7 +112,7 @@ public void setTypeConfigurations(Collection 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 + * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside * cluster. This increases serialization performance. * * WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. * - * @param ctx Portable context. + * @param ctx Binary context. */ @SuppressWarnings("UnusedDeclaration") - private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { + private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) { ctx.configure(this, cfg); impl = new GridBinaryMarshaller(ctx); @@ -116,7 +116,7 @@ private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) { @Override public 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 + // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java index a8ff1400708f1..7de73b80ec280 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; /** - * Portable metadata which is passed over a wire. + * Binary metadata which is passed over a wire. */ public class BinaryMetadata implements Externalizable { /** */ @@ -146,7 +146,7 @@ public boolean isEnum() { /** * Wrap metadata into binary type. * - * @param ctx Portable context. + * @param ctx Binary context. * @return Binary type. */ public BinaryTypeImpl wrap(BinaryContext ctx) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java index fea2893fefc1c..29ff7b35df922 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java @@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryType; /** - * Portable meta data handler. + * Binary meta data handler. */ public interface BinaryMetadataHandler { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java index 252c49554ee76..404300dfcab70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** - * Internal portable object interface. + * Internal binary object interface. */ public abstract class BinaryObjectExImpl implements BinaryObjectEx { /** @@ -245,7 +245,7 @@ else if (val instanceof BigDecimal[]) return toString(ctx, new IdentityHashMap()); } catch (BinaryObjectException e) { - throw new IgniteException("Failed to create string representation of portable object.", e); + throw new IgniteException("Failed to create string representation of binary object.", e); } } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java index 9fd5901d737c6..2342766932fbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java @@ -46,7 +46,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation. + * Binary object implementation. */ @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator. public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject { @@ -142,7 +142,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ @@ -156,7 +156,7 @@ public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) { } /** - * @return Detached portable object. + * @return Detached binary object. */ public BinaryObject detach() { if (!detachAllowed || detached()) @@ -227,7 +227,7 @@ public void context(BinaryContext ctx) { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java index 1206db7962be3..0246a36185476 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java @@ -45,7 +45,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable object implementation over offheap memory + * Binary object implementation over offheap memory */ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject { /** */ @@ -141,7 +141,7 @@ public BinaryObject heapCopy() { /** {@inheritDoc} */ @Nullable @Override public BinaryType type() throws BinaryObjectException { if (ctx == null) - throw new BinaryObjectException("PortableContext is not set for the object."); + throw new BinaryObjectException("BinaryContext is not set for the object."); return ctx.metadata(typeId()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java index b673e27ad6305..8f9cc92865c3b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java @@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH; -import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ; +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING; @@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR; /** - * Portable reader implementation. + * Binary reader implementation. */ @SuppressWarnings("unchecked") public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Input stream. */ @@ -185,7 +185,7 @@ public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader l start = in.position(); - // Perform full header parsing in case of portable object. + // Perform full header parsing in case of binary object. if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) { // Ensure protocol is fine. BinaryUtils.checkProtocolVersion(in.readByte()); @@ -312,12 +312,12 @@ public Object unmarshal(int offset) throws BinaryObjectException { /** * @param fieldId Field ID. - * @return Portable object. + * @return Binary object. * @throws BinaryObjectException In case of error. */ - @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException { + @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException { if (findFieldById(fieldId)) { - if (checkFlag(PORTABLE_OBJ) == Flag.NULL) + if (checkFlag(BINARY_OBJ) == Flag.NULL) return null; return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt()); @@ -1598,12 +1598,12 @@ else if (flag == NULL) break; - case PORTABLE_OBJ: - obj = BinaryUtils.doReadPortableObject(in, ctx); + case BINARY_OBJ: + obj = BinaryUtils.doReadBinaryObject(in, ctx); ((BinaryObjectImpl)obj).context(ctx); - if (!GridBinaryMarshaller.KEEP_PORTABLES.get()) + if (!GridBinaryMarshaller.KEEP_BINARIES.get()) obj = ((BinaryObject)obj).deserialize(); break; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java index 99e642cacc475..156ac0fc20305 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java @@ -26,7 +26,7 @@ import java.util.List; /** - * Schema describing portable object content. We rely on the following assumptions: + * Schema describing binary object content. We rely on the following assumptions: * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing * for quick comparisons performed within already fetched L1 cache line. * - When there are more fields, we store them inside a hash map. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java index 6920a34276995..91f29b22cfd8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java @@ -22,7 +22,7 @@ import java.util.HashMap; /** - * Portable schema registry. Contains all well-known object schemas. + * Binary schema registry. Contains all well-known object schemas. * * We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
* WARNING! This mode should be disabled when already serialized data can be taken from some external diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java index 946b68649a734..ba0440373b5ed 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java @@ -141,8 +141,8 @@ public final class IgniteNodeAttributes { /** Node consistent id. */ public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id"; - /** Portable protocol version. */ - public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver"; + /** Binary protocol version. */ + public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver"; /** * Enforces singleton. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 0c3275e0241c5..4a93bf6ea157b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isTransient; /** - * Portable class descriptor. + * Binary class descriptor. */ public class BinaryClassDescriptor { /** */ @@ -167,9 +167,9 @@ public class BinaryClassDescriptor { mode = BinaryWriteMode.EXCLUSION; else { if (cls == BinaryEnumObjectImpl.class) - mode = BinaryWriteMode.PORTABLE_ENUM; + mode = BinaryWriteMode.BINARY_ENUM; else - mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls); + mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } switch (mode) { @@ -210,9 +210,9 @@ public class BinaryClassDescriptor { case OBJECT_ARR: case COL: case MAP: - case PORTABLE_OBJ: + case BINARY_OBJ: case ENUM: - case PORTABLE_ENUM: + case BINARY_ENUM: case ENUM_ARR: case CLASS: case EXCLUSION: @@ -223,7 +223,7 @@ public class BinaryClassDescriptor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: ctor = constructor(cls); fields = null; @@ -284,7 +284,7 @@ public class BinaryClassDescriptor { throw new BinaryObjectException("Invalid mode: " + mode); } - if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE || + if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE || mode == BinaryWriteMode.OBJECT) { readResolveMtd = U.findNonPublicMethod(cls, "readResolve"); writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace"); @@ -362,14 +362,14 @@ public boolean excluded() { } /** - * @return portableWriteReplace() method + * @return binaryWriteReplace() method */ @Nullable Method getWriteReplaceMethod() { return writeReplaceMtd; } /** - * @return portableReadResolve() method + * @return binaryReadResolve() method */ @SuppressWarnings("UnusedDeclaration") @Nullable Method getReadResolveMethod() { @@ -546,8 +546,8 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_ENUM: - writer.doWritePortableEnum((BinaryEnumObjectImpl)obj); + case BINARY_ENUM: + writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj); break; @@ -561,12 +561,12 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException { break; - case PORTABLE_OBJ: - writer.doWritePortableObject((BinaryObjectImpl)obj); + case BINARY_OBJ: + writer.doWriteBinaryObject((BinaryObjectImpl)obj); break; - case PORTABLE: + case BINARY: if (preWrite(writer, obj)) { try { if (serializer != null) @@ -660,7 +660,7 @@ Object read(BinaryReaderExImpl reader) throws BinaryObjectException { Object res; switch (mode) { - case PORTABLE: + case BINARY: res = newInstance(); reader.setHandle(res); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 6293cfec4c40c..7f9bacfcbad49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -75,7 +75,7 @@ import java.util.jar.JarFile; /** - * Portable context. + * Binary context. */ public class BinaryContext implements Externalizable { /** */ @@ -224,7 +224,7 @@ public IgniteConfiguration configuration(){ } /** - * @param marsh Portable marshaller. + * @param marsh Binary marshaller. * @param cfg Configuration. * @throws BinaryObjectException In case of error. */ @@ -279,7 +279,7 @@ private void configure( String clsName = typeCfg.getTypeName(); if (clsName == null) - throw new BinaryObjectException("Class name is required for portable type configuration."); + throw new BinaryObjectException("Class name is required for binary type configuration."); BinaryIdMapper idMapper = globalIdMapper; @@ -675,7 +675,7 @@ private String affinityFieldName(Class cls) { } /** - * @return Portable context. + * @return Binary context. * @throws ObjectStreamException In case of error. */ protected Object readResolve() throws ObjectStreamException { @@ -685,7 +685,7 @@ protected Object readResolve() throws ObjectStreamException { if (g == null) throw new IllegalStateException("Failed to find grid for name: " + gridName); - return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext(); + return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext(); } catch (IllegalStateException e) { throw U.withCause(new InvalidObjectException(e.getMessage()), e); @@ -695,7 +695,7 @@ protected Object readResolve() throws ObjectStreamException { /** * @param cls Class. * @param id Type ID. - * @return GridPortableClassDescriptor. + * @return GridBinaryClassDescriptor. */ public BinaryClassDescriptor registerPredefinedType(Class> cls, int id) { String typeName = typeName(cls.getName()); @@ -1047,7 +1047,7 @@ private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer } /** - * Override portable class descriptor. + * Override binary class descriptor. * * @param other Other descriptor. * @throws BinaryObjectException If failed. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java index 33211704cb35f..b2ee16fbf670b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java @@ -219,7 +219,7 @@ public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsN /** {@inheritDoc} */ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException { - this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext(); + this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java index 8cf1a117f1c3b..8050edde87b84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java @@ -103,8 +103,8 @@ public static BinaryFieldAccessor create(Field field, int id) { case TIMESTAMP_ARR: case ENUM_ARR: case OBJECT_ARR: - case PORTABLE_OBJ: - case PORTABLE: + case BINARY_OBJ: + case BINARY: case EXTERNALIZABLE: return new DefaultFinalClassAccessor(field, id, mode, false); @@ -608,8 +608,8 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE_OBJ: - writer.writePortableObjectField((BinaryObjectImpl)val); + case BINARY_OBJ: + writer.writeBinaryObjectField((BinaryObjectImpl)val); break; @@ -623,7 +623,7 @@ private static class DefaultFinalClassAccessor extends BinaryFieldAccessor { break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: writer.writeObjectField(val); @@ -809,8 +809,8 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE_OBJ: - val = reader.readPortableObject(id); + case BINARY_OBJ: + val = reader.readBinaryObject(id); break; @@ -824,7 +824,7 @@ protected Object readFixedType(BinaryReaderExImpl reader) throws BinaryObjectExc break; - case PORTABLE: + case BINARY: case EXTERNALIZABLE: case OBJECT: val = reader.readObject(id); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java index 7f516319dce2e..78ed17a5054c7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java @@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryField; /** - * Implementation of portable field descriptor. + * Implementation of binary field descriptor. */ public class BinaryFieldImpl implements BinaryField { /** Type ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java index 03bf9f9d69aaf..5480967562395 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java @@ -81,10 +81,10 @@ public MarshallerContext getContext() { /** * Sets {@link BinaryContext}. *
* We rely on the fact that usually object has only few different schemas. For this reason we inline several * of them with optional fallback to normal hash map lookup. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java index 23aacb2cd50ee..d4fd625a188c6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java @@ -25,7 +25,7 @@ * Binary type implementation. */ public class BinaryTypeImpl implements BinaryType { - /** Portable context. */ + /** Binary context. */ private final BinaryContext ctx; /** Type metadata. */ @@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType { /** * Constructor. * - * @param ctx Portable context. + * @param ctx Binary context. * @param meta Type metadata. */ public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java index d285df5a02b03..8b5ec68f68df9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable utils. + * Binary utils. */ public class BinaryUtils { /** */ @@ -70,8 +70,8 @@ public class BinaryUtils { /** {@code true} if serialized value of this type cannot contain references to objects. */ private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102]; - /** Portable classes. */ - private static final Collection> PORTABLE_CLS = new HashSet<>(); + /** Binary classes. */ + private static final Collection> BINARY_CLS = new HashSet<>(); /** Flag: user type. */ public static final short FLAG_USR_TYP = 0x0001; @@ -166,32 +166,32 @@ public class BinaryUtils { PLAIN_TYPE_FLAG[b] = true; } - PORTABLE_CLS.add(Byte.class); - PORTABLE_CLS.add(Short.class); - PORTABLE_CLS.add(Integer.class); - PORTABLE_CLS.add(Long.class); - PORTABLE_CLS.add(Float.class); - PORTABLE_CLS.add(Double.class); - PORTABLE_CLS.add(Character.class); - PORTABLE_CLS.add(Boolean.class); - PORTABLE_CLS.add(String.class); - PORTABLE_CLS.add(UUID.class); - PORTABLE_CLS.add(Date.class); - PORTABLE_CLS.add(Timestamp.class); - PORTABLE_CLS.add(BigDecimal.class); - PORTABLE_CLS.add(byte[].class); - PORTABLE_CLS.add(short[].class); - PORTABLE_CLS.add(int[].class); - PORTABLE_CLS.add(long[].class); - PORTABLE_CLS.add(float[].class); - PORTABLE_CLS.add(double[].class); - PORTABLE_CLS.add(char[].class); - PORTABLE_CLS.add(boolean[].class); - PORTABLE_CLS.add(String[].class); - PORTABLE_CLS.add(UUID[].class); - PORTABLE_CLS.add(Date[].class); - PORTABLE_CLS.add(Timestamp[].class); - PORTABLE_CLS.add(BigDecimal[].class); + BINARY_CLS.add(Byte.class); + BINARY_CLS.add(Short.class); + BINARY_CLS.add(Integer.class); + BINARY_CLS.add(Long.class); + BINARY_CLS.add(Float.class); + BINARY_CLS.add(Double.class); + BINARY_CLS.add(Character.class); + BINARY_CLS.add(Boolean.class); + BINARY_CLS.add(String.class); + BINARY_CLS.add(UUID.class); + BINARY_CLS.add(Date.class); + BINARY_CLS.add(Timestamp.class); + BINARY_CLS.add(BigDecimal.class); + BINARY_CLS.add(byte[].class); + BINARY_CLS.add(short[].class); + BINARY_CLS.add(int[].class); + BINARY_CLS.add(long[].class); + BINARY_CLS.add(float[].class); + BINARY_CLS.add(double[].class); + BINARY_CLS.add(char[].class); + BINARY_CLS.add(boolean[].class); + BINARY_CLS.add(String[].class); + BINARY_CLS.add(UUID[].class); + BINARY_CLS.add(Date[].class); + BINARY_CLS.add(Timestamp[].class); + BINARY_CLS.add(BigDecimal[].class); FIELD_TYPE_NAMES = new String[104]; @@ -210,7 +210,7 @@ public class BinaryUtils { FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp"; FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum"; FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object"; - FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object"; + FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object"; FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection"; FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map"; FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class"; @@ -547,7 +547,7 @@ public static boolean isPlainArrayType(int type) { /** * @param cls Class. - * @return Portable field type. + * @return Binary field type. */ public static byte typeByClass(Class> cls) { Byte type = PLAIN_CLASS_TO_FLAG.get(cls); @@ -571,16 +571,16 @@ public static byte typeByClass(Class> cls) { } /** - * Tells whether provided type is portable. + * Tells whether provided type is binary. * * @param cls Class to check. - * @return Whether type is portable. + * @return Whether type is binary. */ - public static boolean isPortableType(Class> cls) { + public static boolean isBinaryType(Class> cls) { assert cls != null; return BinaryObject.class.isAssignableFrom(cls) || - PORTABLE_CLS.contains(cls) || + BINARY_CLS.contains(cls) || cls.isEnum() || (cls.isArray() && cls.getComponentType().isEnum()); } @@ -632,7 +632,7 @@ public static void checkProtocolVersion(byte protoVer) { } /** - * Get portable object length. + * Get binary object length. * * @param in Input stream. * @param start Start position. @@ -801,7 +801,7 @@ public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, Bin // Check type name. if (!F.eq(oldMeta.typeName(), newMeta.typeName())) { throw new BinaryObjectException( - "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + + "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() + ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']' ); } @@ -944,9 +944,9 @@ else if (cls == Timestamp[].class) else if (cls.isArray()) return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR; else if (cls == BinaryObjectImpl.class) - return BinaryWriteMode.PORTABLE_OBJ; + return BinaryWriteMode.BINARY_OBJ; else if (Binarylizable.class.isAssignableFrom(cls)) - return BinaryWriteMode.PORTABLE; + return BinaryWriteMode.BINARY; else if (Externalizable.class.isAssignableFrom(cls)) return BinaryWriteMode.EXTERNALIZABLE; else if (isSpecialCollection(cls)) @@ -1249,7 +1249,7 @@ public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws Bina /** * @return Value. */ - public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) { + public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) { if (in.offheapPointer() > 0) { int len = in.readInt(); @@ -1343,7 +1343,7 @@ public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLo /** * Resolve the class. * - * @param ctx Portable context. + * @param ctx Binary context. * @param typeId Type ID. * @param clsName Class name. * @param ldr Class loaded. @@ -1374,26 +1374,26 @@ public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String } /** - * Read portable enum. + * Read binary enum. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @param type Plain type. * @return Enum. */ - private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx, + private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx, EnumType type) { return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt()); } /** - * Read portable enum array. + * Read binary enum array. * * @param in Input stream. - * @param ctx Portable context. + * @param ctx Binary context. * @return Enum array. */ - private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) { + private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len); @@ -1404,7 +1404,7 @@ private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryCont if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else - arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in)); + arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in)); } return arr; @@ -1644,16 +1644,16 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N case GridBinaryMarshaller.MAP: return doReadMap(in, ctx, ldr, handles, false, null); - case GridBinaryMarshaller.PORTABLE_OBJ: - return doReadPortableObject(in, ctx); + case GridBinaryMarshaller.BINARY_OBJ: + return doReadBinaryObject(in, ctx); case GridBinaryMarshaller.ENUM: - return doReadPortableEnum(in, ctx, doReadEnumType(in)); + return doReadBinaryEnum(in, ctx, doReadEnumType(in)); case GridBinaryMarshaller.ENUM_ARR: doReadEnumType(in); // Simply skip this part as we do not need it. - return doReadPortableEnumArray(in, ctx); + return doReadBinaryEnumArray(in, ctx); case GridBinaryMarshaller.CLASS: return doReadClass(in, ctx, ldr); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java index 9a37bdb339b3b..90127f462754d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java @@ -133,13 +133,13 @@ public enum BinaryWriteMode { MAP(GridBinaryMarshaller.MAP), /** */ - PORTABLE_OBJ(GridBinaryMarshaller.OBJ), + BINARY_OBJ(GridBinaryMarshaller.OBJ), /** */ ENUM(GridBinaryMarshaller.ENUM), - /** Portable enum. */ - PORTABLE_ENUM(GridBinaryMarshaller.ENUM), + /** Binary enum. */ + BINARY_ENUM(GridBinaryMarshaller.ENUM), /** */ ENUM_ARR(GridBinaryMarshaller.ENUM_ARR), @@ -148,7 +148,7 @@ public enum BinaryWriteMode { CLASS(GridBinaryMarshaller.CLASS), /** */ - PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ), + BINARY(GridBinaryMarshaller.BINARY_OBJ), /** */ EXTERNALIZABLE(GridBinaryMarshaller.OBJ), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java index f073dd0d933ff..6e05b40df1ec0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java @@ -41,7 +41,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** - * Portable writer implementation. + * Binary writer implementation. */ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput { /** Length: integer. */ @@ -145,7 +145,7 @@ void marshal(Object obj, boolean enableReplace) throws BinaryObjectException { BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false); if (desc == null) - throw new BinaryObjectException("Object is not portable: [class=" + cls + ']'); + throw new BinaryObjectException("Object is not binary: [class=" + cls + ']'); if (desc.excluded()) { out.writeByte(GridBinaryMarshaller.NULL); @@ -748,7 +748,7 @@ void doWriteEnum(@Nullable Enum> val) { /** * @param val Value. */ - void doWritePortableEnum(BinaryEnumObjectImpl val) { + void doWriteBinaryEnum(BinaryEnumObjectImpl val) { assert val != null; int typeId = val.typeId(); @@ -819,9 +819,9 @@ void doWriteClass(@Nullable Class val) { } /** - * @param po Portable object. + * @param po Binary object. */ - public void doWritePortableObject(@Nullable BinaryObjectImpl po) { + public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { @@ -829,7 +829,7 @@ public void doWritePortableObject(@Nullable BinaryObjectImpl po) { out.unsafeEnsure(1 + 4 + poArr.length + 4); - out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ); + out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); @@ -1176,11 +1176,11 @@ void writeEnumArrayField(@Nullable Object[] val) { } /** - * @param po Portable object. + * @param po Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { - doWritePortableObject(po); + void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException { + doWriteBinaryObject(po); } /** {@inheritDoc} */ @@ -1760,7 +1760,7 @@ public BinaryWriterExImpl newWriter(int typeId) { } /** - * @return Portable context. + * @return Binary context. */ public BinaryContext context() { return ctx; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java index 277abd0f43cf8..b21c679aad20d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java @@ -24,11 +24,11 @@ import org.jetbrains.annotations.Nullable; /** - * Portable objects marshaller. + * Binary objects marshaller. */ public class GridBinaryMarshaller { /** */ - public static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + public static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return true; } @@ -119,7 +119,7 @@ public class GridBinaryMarshaller { public static final byte MAP = 25; /** */ - public static final byte PORTABLE_OBJ = 27; + public static final byte BINARY_OBJ = 27; /** */ public static final byte ENUM = 28; @@ -230,7 +230,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param bytes Bytes array. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @@ -242,7 +242,7 @@ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { /** * @param in Input stream. - * @return Portable object. + * @return Binary object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java index d8dd00b647586..bc5eb9e030b35 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java @@ -46,7 +46,7 @@ public BinaryBuilderEnum(int typeId, Enum anEnum) { } /** - * @param reader PortableBuilderReader. + * @param reader BinaryBuilderReader. */ public BinaryBuilderEnum(BinaryBuilderReader reader) { int typeId = reader.readInt(); @@ -57,13 +57,13 @@ public BinaryBuilderEnum(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId(); + this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId(); } else { this.typeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java index 9b9e8b871cb57..662ad1dc800b6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java @@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable { /* * Constructor. * - * @param objImpl Portable object + * @param objImpl Binary object */ BinaryBuilderReader(BinaryObjectImpl objImpl) { ctx = objImpl.context(); @@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { + public BinaryContext binaryContext() { return ctx; } /** - * @param obj Mutable portable object. + * @param obj Mutable binary object. */ public void registerObject(BinaryObjectBuilderImpl obj) { objMap.put(obj.start(), obj); @@ -343,7 +343,7 @@ public void skipValue() { return; } - case GridBinaryMarshaller.PORTABLE_OBJ: + case GridBinaryMarshaller.BINARY_OBJ: len = readInt() + 4; break; @@ -460,14 +460,14 @@ public Object getValueQuickly(int pos, int len) { return builderEnum; } - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readIntPositioned(pos + 1); int start = readIntPositioned(pos + 4 + size); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: @@ -739,17 +739,17 @@ else if (flag == GridBinaryMarshaller.DECIMAL) { case GridBinaryMarshaller.ENUM_ARR: return new BinaryEnumArrayLazyValue(this); - case GridBinaryMarshaller.PORTABLE_OBJ: { + case GridBinaryMarshaller.BINARY_OBJ: { int size = readInt(); pos += size; int start = readInt(); - BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, + BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos - 4 - size + start); - return new BinaryPlainBinaryObject(portableObj); + return new BinaryPlainBinaryObject(binaryObj); } default: diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java index 458602d158948..a095242ebe460 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java @@ -37,7 +37,7 @@ class BinaryBuilderSerializer { private final Map objToPos = new IdentityHashMap<>(); /** */ - private Map portableObjToWrapper; + private Map binaryObjToWrapper; /** * @param obj Mutable object. @@ -65,15 +65,15 @@ public void writeValue(BinaryWriterExImpl writer, Object val) { } if (val instanceof BinaryObjectExImpl) { - if (portableObjToWrapper == null) - portableObjToWrapper = new IdentityHashMap<>(); + if (binaryObjToWrapper == null) + binaryObjToWrapper = new IdentityHashMap<>(); - BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val); + BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val); if (wrapper == null) { wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val); - portableObjToWrapper.put((BinaryObject)val, wrapper); + binaryObjToWrapper.put((BinaryObject)val, wrapper); } val = wrapper; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java index db55050bcfe07..787ff638b995e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java @@ -50,13 +50,13 @@ protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java index 3627b1de5264b..21d7dcb853db8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java @@ -160,7 +160,7 @@ private void ensureDelegateInit() { for (Object o : delegate) ctx.writeValue(writer, o); - // PortableBuilderImpl might have been written. It could override reader's position. + // BinaryBuilderImpl might have been written. It could override reader's position. reader.position(oldPos); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java index c82ff7d5f2999..6afe7981df249 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java @@ -52,7 +52,7 @@ private BinaryLazyMap(BinaryBuilderReader reader, int off) { /** * @param reader Reader. - * @return PortableLazyMap. + * @return BinaryLazyMap. */ @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) { int off = reader.position() - 1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java index 05713b4dea615..8962107c77ac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java @@ -49,13 +49,13 @@ protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) { Class cls; try { - cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader()); + cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader()); } catch (ClassNotFoundException e) { throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e); } - compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId(); + compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId(); } else { compTypeId = typeId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java index 5e60a202bacd8..8353cdb4ab5c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java @@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** */ private Map readCache; - /** Position of object in source array, or -1 if object is not created from PortableObject. */ + /** Position of object in source array, or -1 if object is not created from BinaryObject. */ private final int start; /** Flags. */ @@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** Total header length */ private final int hdrLen; - /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */ + /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */ private final BinaryBuilderReader reader; /** */ @@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { /** * @param clsName Class name. - * @param ctx Portable context. + * @param ctx Binary context. */ public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) { this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName)); @@ -134,7 +134,7 @@ public BinaryObjectBuilderImpl(BinaryObjectImpl obj) { BinaryUtils.checkProtocolVersion(ver); int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS); - ctx = reader.portableContext(); + ctx = reader.binaryContext(); hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS); if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) { @@ -525,7 +525,7 @@ private void ensureReadCacheInit() { } /** - * Removes field from portable object. + * Removes field from binary object. * * @param name Field name. * @return {@code this} instance for chaining. @@ -540,9 +540,9 @@ private void ensureReadCacheInit() { } /** - * Creates builder initialized by specified portable object. + * Creates builder initialized by specified binary object. * - * @param obj Portable object to initialize builder. + * @param obj Binary object to initialize builder. * @return New builder. */ public static BinaryObjectBuilderImpl wrap(BinaryObject obj) { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java index 5ac4e97777a8c..f6432c3511621 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java @@ -27,27 +27,27 @@ */ public class BinaryPlainBinaryObject implements BinaryLazyValue { /** */ - private final BinaryObject portableObj; + private final BinaryObject binaryObj; /** - * @param portableObj Portable object. + * @param binaryObj Binary object. */ - public BinaryPlainBinaryObject(BinaryObject portableObj) { - this.portableObj = portableObj; + public BinaryPlainBinaryObject(BinaryObject binaryObj) { + this.binaryObj = binaryObj; } /** {@inheritDoc} */ @Override public Object value() { - return portableObj; + return binaryObj; } /** {@inheritDoc} */ @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) { - BinaryObject val = portableObj; + BinaryObject val = binaryObj; if (val instanceof BinaryObjectOffheapImpl) val = ((BinaryObjectOffheapImpl)val).heapCopy(); - writer.doWritePortableObject((BinaryObjectImpl)val); + writer.doWriteBinaryObject((BinaryObjectImpl)val); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java index f2c4b5593d56c..15aa947b1f921 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains classes specific to portable builder API. + * Contains classes specific to binary builder API. */ package org.apache.ignite.internal.binary.builder; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java index 4bb0fb150b906..849ef5f87c972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs internal implementation. + * Contains binary APIs internal implementation. */ package org.apache.ignite.internal.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java index e3be794ab84ed..334f455847123 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.binary.BinaryObjectException; /** - * Portable abstract input stream. + * Binary abstract input stream. */ public abstract class BinaryAbstractInputStream extends BinaryAbstractStream implements BinaryInputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java index 199ee71539e61..4221cbe10990c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Base portable output stream. + * Base binary output stream. */ public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream implements BinaryOutputStream { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java index ce5763112b381..1e8ce0935932c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java @@ -22,7 +22,7 @@ import sun.misc.Unsafe; /** - * Portable abstract stream. + * Binary abstract stream. */ public abstract class BinaryAbstractStream implements BinaryStream { /** Byte: zero. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java index 502b9dc627d1b..732b8c7572ca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java @@ -20,7 +20,7 @@ import java.util.Arrays; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public final class BinaryHeapInputStream extends BinaryAbstractInputStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java index 02c3441aa90bf..7553f3ba6278a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable heap output stream. + * Binary heap output stream. */ public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream { /** Allocator. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java index 63457e40a15bc..176571518cbab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java @@ -20,7 +20,7 @@ import org.apache.ignite.internal.binary.BinaryPositionReadable; /** - * Portable input stream. + * Binary input stream. */ public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java index dc18c9e63185f..cff002f8724e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable off-heap input stream. + * Binary off-heap input stream. */ public class BinaryOffheapInputStream extends BinaryAbstractInputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java index 24b65b2ea304b..080a3574b0996 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable offheap output stream. + * Binary offheap output stream. */ public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream { /** Pointer. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java index 1c3f4bf2b96b8..84941203acd72 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable output stream. + * Binary output stream. */ public interface BinaryOutputStream extends BinaryStream, AutoCloseable { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java index 229e34c56ec18..b868199edd10b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.binary.streams; /** - * Portable stream. + * Binary stream. */ public interface BinaryStream { /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java index 2a6ad6281cb0c..8ce839c021c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java @@ -17,6 +17,6 @@ /** * - * Contains portable APIs implementation for streams. + * Contains binary APIs implementation for streams. */ package org.apache.ignite.internal.binary.streams; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java index 382141c8d53a9..2e4831e11e495 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java @@ -27,15 +27,15 @@ public enum GridClientCacheFlag { SKIP_STORE, /** - * Disable deserialization of portable objects on get operations. - * If set and portable marshaller is used, {@link GridClientData#get(Object)} + * Disable deserialization of binary objects on get operations. + * If set and binary marshaller is used, {@link GridClientData#get(Object)} * and {@link GridClientData#getAll(Collection)} methods will return - * instances of {@code PortableObject} class instead of user objects. + * instances of {@code BinaryObject} class instead of user objects. * Use this flag if you don't have corresponding class on your client of * if you want to get access to some individual fields, but do not want to * fully deserialize the object. */ - KEEP_PORTABLES; + KEEP_BINARIES; /** */ private static final GridClientCacheFlag[] VALS = values(); @@ -49,4 +49,4 @@ public enum GridClientCacheFlag { public static GridClientCacheFlag fromOrdinal(int ord) { return ord >= 0 && ord < VALS.length ? VALS[ord] : null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java index e7255f9383f65..c0e31c73d14dd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java @@ -416,5 +416,5 @@ public List refreshTopology(boolean includeAttrs, boolean includ /** * Sets keep binary flag for the next task execution in the current thread. */ - public GridClientCompute withKeepPortables(); -} \ No newline at end of file + public GridClientCompute withKeepBinaries(); +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java index 2015970774ec9..e9d2958541665 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java @@ -615,7 +615,7 @@ public void setExecutorService(ExecutorService executor) { * Options, that can be used out-of-the-box: * * {@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller. - * {@code GridClientPortableMarshaller} - Marshaller that supports portable objects. + * {@code GridClientBinaryMarshaller} - Marshaller that supports binary objects. * {@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended). * * @@ -850,4 +850,4 @@ public void setDaemon(boolean daemon) { public boolean isDaemon() { return daemon; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java index 0c3b1552adf88..463a07410a243 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java @@ -41,7 +41,7 @@ */ class GridClientComputeImpl extends GridClientAbstractProjection implements GridClientCompute { /** */ - private static final ThreadLocal KEEP_PORTABLES = new ThreadLocal() { + private static final ThreadLocal KEEP_BINARIES = new ThreadLocal() { @Override protected Boolean initialValue() { return false; } @@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFuture executeAsync(final String taskName, final Object taskArg) { A.notNull(taskName, "taskName"); - final boolean keepPortables = KEEP_PORTABLES.get(); + final boolean keepBinaries = KEEP_BINARIES.get(); - KEEP_PORTABLES.set(false); + KEEP_BINARIES.set(false); return withReconnectHandling(new ClientProjectionClosure() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }); } @@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection() { @Override public GridClientFuture apply(GridClientConnection conn, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException { - return conn.execute(taskName, taskArg, destNodeId, keepPortables); + return conn.execute(taskName, taskArg, destNodeId, keepBinaries); } }, cacheName, affKey); } @@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection GridClientFutureAdapter cachePrepend(String cach * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Task execution result. * @throws GridClientConnectionResetException In case of error. * @throws GridClientClosedException If client was manually closed before request was sent over network. */ public abstract GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException; + boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException; /** * Gets node by node ID. @@ -514,4 +514,4 @@ protected String getCloseReasonMessage(GridClientConnectionCloseReason reason, @ return null; } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java index dedee109c6b2d..1bea3cc064a26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java @@ -462,7 +462,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress if (cfg.getProtocol() == GridClientProtocol.TCP) { conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor, cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(), - cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal()); + cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal()); } else throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " + @@ -485,7 +485,7 @@ protected GridClientConnection connect(@Nullable UUID nodeId, InetSocketAddress /** * @return Get thread local used to enable keep binary mode. */ - protected ThreadLocal keepPortablesThreadLocal() { + protected ThreadLocal keepBinariesThreadLocal() { return null; } @@ -668,4 +668,4 @@ private void handleHandshakeResponse(GridClientFutureAdapter handshakeF ses.close(); } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java index 24c9c709c0bb9..576df3a5543af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java @@ -79,7 +79,7 @@ import org.jetbrains.annotations.Nullable; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES; +import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE; import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED; import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND; @@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { private final GridClientMarshaller marsh; /** */ - private final ThreadLocal keepPortablesMode; + private final ThreadLocal keepBinariesMode; /** * Creates a client facade, tries to connect to remote server, in case of success starts reader thread. @@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { Byte marshId, GridClientTopology top, Object cred, - ThreadLocal keepPortablesMode + ThreadLocal keepBinariesMode ) throws IOException, GridClientException { super(clientId, srvAddr, sslCtx, top, cred); @@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { this.marsh = marsh; this.pingInterval = pingInterval; this.pingTimeout = pingTimeout; - this.keepPortablesMode = keepPortablesMode; + this.keepBinariesMode = keepBinariesMode; SocketChannel ch = null; Socket sock = null; @@ -385,16 +385,16 @@ private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID d * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep binary flag. + * @param keepBinaries Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. */ - private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables) + private GridClientFutureAdapter makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { assert msg != null; - TcpClientFuture res = new TcpClientFuture<>(false, keepPortables); + TcpClientFuture res = new TcpClientFuture<>(false, keepBinaries); msg.destinationId(destId); @@ -667,7 +667,7 @@ private GridClientAuthenticationRequest buildAuthRequest() { req.keys((Iterable)keys); req.cacheFlagsOn(encodeCacheFlags(flags)); - return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES)); + return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES)); } /** {@inheritDoc} */ @@ -786,12 +786,12 @@ private GridClientAuthenticationRequest buildAuthRequest() { /** {@inheritDoc} */ @Override public GridClientFutureAdapter execute(String taskName, Object arg, UUID destNodeId, - final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException { + final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException { GridClientTaskRequest msg = new GridClientTaskRequest(); msg.taskName(taskName); msg.argument(arg); - msg.keepPortables(keepPortables); + msg.keepBinaries(keepBinaries); return this.makeRequest(msg, destNodeId).chain( new GridClientFutureCallback() { @@ -1038,7 +1038,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { private final boolean forward; /** Keep binary flag. */ - private final boolean keepPortables; + private final boolean keepBinaries; /** Pending message for this future. */ private GridClientMessage pendingMsg; @@ -1052,7 +1052,7 @@ private static class TcpClientFuture extends GridClientFutureAdapter { */ private TcpClientFuture() { forward = false; - keepPortables = false; + keepBinaries = false; } /** @@ -1060,9 +1060,9 @@ private TcpClientFuture() { * * @param forward Flag value. */ - private TcpClientFuture(boolean forward, boolean keepPortables) { + private TcpClientFuture(boolean forward, boolean keepBinaries) { this.forward = forward; - this.keepPortables = keepPortables; + this.keepBinaries = keepBinaries; } /** @@ -1103,8 +1103,8 @@ public boolean forward() { /** * @return Keep binary flag. */ - public boolean keepPortables() { - return keepPortables; + public boolean keepBinaries() { + return keepBinaries; } /** {@inheritDoc} */ @@ -1112,4 +1112,4 @@ public boolean keepPortables() { return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]"; } } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java index 4f9c188c7ddfe..9b3dd159d2494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit /** {@inheritDoc} */ @Override public Object affinityKey(Object key) { try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java index 2de26fc930314..2ecfdbfb52a69 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java @@ -50,9 +50,9 @@ public CacheInvokeEntry(GridCacheContext cctx, KeyCacheObject keyObj, @Nullable CacheObject valObj, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(cctx, keyObj, valObj, keepPortable); + super(cctx, keyObj, valObj, keepBinary); this.hadVal = valObj != null; this.ver = ver; @@ -72,9 +72,9 @@ public CacheInvokeEntry(GridCacheContext ctx, @Nullable CacheObject valObj, @Nullable V val, GridCacheVersion ver, - boolean keepPortable + boolean keepBinary ) { - super(ctx, keyObj, key, valObj, val, keepPortable); + super(ctx, keyObj, key, valObj, val, keepBinary); this.hadVal = valObj != null || val != null; this.ver = ver; @@ -152,4 +152,4 @@ private static enum Operation { /** */ REMOVE } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java index 713bb3f6fa34a..05a6fef8387c9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java @@ -43,19 +43,19 @@ public class CacheLazyEntry implements Cache.Entry { @GridToStringInclude protected V val; - /** Keep portable flag. */ - private boolean keepPortable; + /** Keep binary flag. */ + private boolean keepBinary; /** * @param cctx Cache context. * @param keyObj Key cache object. * @param valObj Cache object value. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.valObj = valObj; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -63,11 +63,11 @@ public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject * @param val Value. * @param cctx Cache context. */ - public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) { + public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) { this.cctx = cctx; this.keyObj = keyObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** @@ -82,38 +82,38 @@ public CacheLazyEntry(GridCacheContext ctx, K key, CacheObject valObj, V val, - boolean keepPortable + boolean keepBinary ) { this.cctx = ctx; this.keyObj = keyObj; this.key = key; this.valObj = valObj; this.val = val; - this.keepPortable = keepPortable; + this.keepBinary = keepBinary; } /** {@inheritDoc} */ @Override public K getKey() { if (key == null) - key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable); + key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary); return key; } /** {@inheritDoc} */ @Override public V getValue() { - return getValue(keepPortable); + return getValue(keepBinary); } /** * Returns the value stored in the cache when this entry was created. * - * @param keepPortable Flag to keep portable if needed. + * @param keepBinary Flag to keep binary if needed. * @return the value corresponding to this entry */ - public V getValue(boolean keepPortable) { + public V getValue(boolean keepBinary) { if (val == null) - val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false); + val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false); return val; } @@ -147,4 +147,4 @@ else if (cls.isAssignableFrom(getClass())) public String toString() { return S.toString(CacheLazyEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java index 88a802771a23c..740143405e798 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java @@ -125,69 +125,69 @@ public IgniteCacheObjectProcessor processor() { /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return unwrapPortableIfNeeded(o, keepPortable, true); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return unwrapBinaryIfNeeded(o, keepBinary, true); } /** * @param o Object to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { if (o == null) return null; - return unwrapPortable(o, keepPortable, cpy); + return unwrapBinary(o, keepBinary, cpy); } /** * @param col Collection of objects to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return unwrapPortablesIfNeeded(col, keepPortable, true); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return unwrapBinariesIfNeeded(col, keepBinary, true); } /** * @param col Collection to unwrap. - * @param keepPortable Keep binary flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable, boolean cpy) { + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary, boolean cpy) { if (col instanceof ArrayList) - return unwrapPortables((ArrayList)col, keepPortable, cpy); + return unwrapBinaries((ArrayList)col, keepBinary, cpy); if (col instanceof Set) - return unwrapPortables((Set)col, keepPortable, cpy); + return unwrapBinaries((Set)col, keepBinary, cpy); Collection col0 = new ArrayList<>(col.size()); for (Object obj : col) - col0.add(unwrapPortable(obj, keepPortable, cpy)); + col0.add(unwrapBinary(obj, keepBinary, cpy)); return col0; } /** - * Unwrap array of portables if needed. + * Unwrap array of binaries if needed. * * @param arr Array. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy. * @return Result. */ - public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) { + public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) { Object[] res = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - res[i] = unwrapPortable(arr[i], keepPortable, cpy); + res[i] = unwrapBinary(arr[i], keepBinary, cpy); return res; } @@ -196,17 +196,17 @@ public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortabl * Unwraps map. * * @param map Map to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - private Map unwrapPortablesIfNeeded(Map map, boolean keepPortable, boolean cpy) { - if (keepPortable) + private Map unwrapBinariesIfNeeded(Map map, boolean keepBinary, boolean cpy) { + if (keepBinary) return map; Map map0 = BinaryUtils.newMap(map); for (Map.Entry e : map.entrySet()) - map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy)); + map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy)); return map0; } @@ -217,7 +217,7 @@ private Map unwrapPortablesIfNeeded(Map map, boo * @param col List to unwrap. * @return Unwrapped list. */ - private Collection unwrapPortables(ArrayList col, boolean keepPortable, boolean cpy) { + private Collection unwrapBinaries(ArrayList col, boolean keepBinary, boolean cpy) { int size = col.size(); col = new ArrayList<>(col); @@ -225,7 +225,7 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo for (int i = 0; i < size; i++) { Object o = col.get(i); - Object unwrapped = unwrapPortable(o, keepPortable, cpy); + Object unwrapped = unwrapBinary(o, keepBinary, cpy); if (o != unwrapped) col.set(i, unwrapped); @@ -240,11 +240,11 @@ private Collection unwrapPortables(ArrayList col, boolean keepPo * @param set Set to unwrap. * @return Unwrapped set. */ - private Set unwrapPortables(Set set, boolean keepPortable, boolean cpy) { + private Set unwrapBinaries(Set set, boolean keepBinary, boolean cpy) { Set set0 = BinaryUtils.newSet(set); for (Object obj : set) - set0.add(unwrapPortable(obj, keepPortable, cpy)); + set0.add(unwrapBinary(obj, keepBinary, cpy)); return set0; } @@ -253,31 +253,31 @@ private Set unwrapPortables(Set set, boolean keepPortable, boole * @param o Object to unwrap. * @return Unwrapped object. */ - private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) { + private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) { if (o instanceof Map.Entry) { Map.Entry entry = (Map.Entry)o; Object key = entry.getKey(); - Object uKey = unwrapPortable(key, keepPortable, cpy); + Object uKey = unwrapBinary(key, keepBinary, cpy); Object val = entry.getValue(); - Object uVal = unwrapPortable(val, keepPortable, cpy); + Object uVal = unwrapBinary(val, keepBinary, cpy); return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o; } else if (o instanceof Collection) - return unwrapPortablesIfNeeded((Collection)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Collection)o, keepBinary, cpy); else if (o instanceof Map) - return unwrapPortablesIfNeeded((Map)o, keepPortable, cpy); + return unwrapBinariesIfNeeded((Map)o, keepBinary, cpy); else if (o instanceof Object[]) - return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy); + return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy); else if (o instanceof CacheObject) { CacheObject co = (CacheObject)o; - if (!keepPortable || co.isPlatformType()) - return unwrapPortable(co.value(this, cpy), keepPortable, cpy); + if (!keepBinary || co.isPlatformType()) + return unwrapBinary(co.value(this, cpy), keepBinary, cpy); } return o; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java index 3993146ccb747..21934d06cce46 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java @@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable { /** Client ID which operates over this projection. */ private final UUID subjId; - /** Keep portable flag. */ + /** Keep binary flag. */ private final boolean keepBinary; /** Expiry policy. */ @@ -66,7 +66,7 @@ public CacheOperationContext() { /** * @param skipStore Skip store flag. * @param subjId Subject ID. - * @param keepBinary Keep portable flag. + * @param keepBinary Keep binary flag. * @param expiryPlc Expiry policy. */ public CacheOperationContext( @@ -87,16 +87,16 @@ public CacheOperationContext( } /** - * @return Keep portable flag. + * @return Keep binary flag. */ public boolean isKeepBinary() { return keepBinary; } /** - * See {@link IgniteInternalCache#keepPortable()}. + * See {@link IgniteInternalCache#keepBinary()}. * - * @return New instance of CacheOperationContext with keep portable flag. + * @return New instance of CacheOperationContext with keep binary flag. */ public CacheOperationContext keepBinary() { return new CacheOperationContext( @@ -200,4 +200,4 @@ public boolean noRetries() { @Override public String toString() { return S.toString(CacheOperationContext.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 034640f7699f7..ea57cafc8283e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -468,7 +468,7 @@ public boolean isDht() { } /** {@inheritDoc} */ - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false); return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)this, opCtx); @@ -608,7 +608,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ); @@ -634,7 +634,7 @@ public void onKernalStop() { /*skip tx*/false, /*subj id*/null, /*task name*/null, - /*deserialize portable*/false, + /*deserialize binary*/false, /*skip values*/true, /*can remap*/true ).chain(new CX1>, Boolean>() { @@ -669,7 +669,7 @@ public void onKernalStop() { modes.backup = true; if (modes.heap) - its.add(iterator(map.entries0().iterator(), !ctx.keepPortable())); + its.add(iterator(map.entries0().iterator(), !ctx.keepBinary())); } else if (modes.heap) { if (modes.near && ctx.isNear()) @@ -799,7 +799,7 @@ public String toString() { else cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc); - Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false); + Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false); return (V)val; } @@ -1353,7 +1353,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { /*skip tx*/true, null, taskName, - !ctx.keepPortable(), + !ctx.keepBinary(), /*skip values*/false, /*can remap*/true); } @@ -1375,7 +1375,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - V val = get(key, !ctx.keepPortable()); + V val = get(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) val = (V)ctx.config().getInterceptor().onGet(key, val); @@ -1394,7 +1394,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture fut = getAsync(key, !ctx.keepPortable()); + IgniteInternalFuture fut = getAsync(key, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1, V>() { @@ -1417,7 +1417,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { long start = statsEnabled ? System.nanoTime() : 0L; - Map map = getAll(keys, !ctx.keepPortable()); + Map map = getAll(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) map = interceptGet(keys, map); @@ -1436,7 +1436,7 @@ public V getTopologySafe(K key) throws IgniteCheckedException { final long start = statsEnabled ? System.nanoTime() : 0L; - IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepPortable()); + IgniteInternalFuture> fut = getAllAsync(keys, !ctx.keepBinary()); if (ctx.config().getInterceptor() != null) return fut.chain(new CX1>, Map>() { @@ -1498,7 +1498,7 @@ private Map interceptGet(@Nullable Collection extends K> keys, Map * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1509,7 +1509,7 @@ protected IgniteInternalFuture getAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, final boolean skipVals, boolean canRemap ) { @@ -1518,7 +1518,7 @@ protected IgniteInternalFuture getAsync( skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, skipVals, canRemap).chain( new CX1>, V>() { @@ -1544,7 +1544,7 @@ protected IgniteInternalFuture getAsync( * @param skipTx Skip tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param skipVals Skip values. * @param canRemap Can remap flag. * @return Future for the get operation. @@ -1556,7 +1556,7 @@ protected IgniteInternalFuture> getAllAsync( boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -1569,7 +1569,7 @@ protected IgniteInternalFuture> getAllAsync( !skipTx, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null), skipVals, @@ -1582,7 +1582,7 @@ protected IgniteInternalFuture> getAllAsync( * @param checkTx Check tx. * @param subjId Subj Id. * @param taskName Task name. - * @param deserializePortable Deserialize portable. + * @param deserializeBinary Deserialize binary. * @param forcePrimary Froce primary. * @param expiry Expiry policy. * @param skipVals Skip values. @@ -1595,7 +1595,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean forcePrimary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, @@ -1611,7 +1611,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect checkTx, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, false, @@ -1625,7 +1625,7 @@ public final IgniteInternalFuture> getAllAsync(@Nullable final Collect * @param checkTx Check local transaction flag. * @param subjId Subject ID. * @param taskName Task name/ - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiry Expiry policy. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects. @@ -1638,7 +1638,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f boolean checkTx, @Nullable final UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiry, final boolean skipVals, final boolean keepCacheObjects, @@ -1696,7 +1696,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f null, taskName, expiry, - !deserializePortable); + !deserializeBinary); if (res == null) { if (storeEnabled) { @@ -1722,7 +1722,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f res.get1(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); } @@ -1797,7 +1797,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f cacheVal, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } @@ -1896,7 +1896,7 @@ public final IgniteInternalFuture> getAllAsync0(@Nullable f return asyncOp(tx, new AsyncOp>(keys) { @Override public IgniteInternalFuture> op(IgniteTxLocalAdapter tx) { - return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough); + return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough); } }, ctx.operationContextPerCall()); } @@ -3815,7 +3815,7 @@ public Iterator> igniteIterator() { if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) return localIteratorHonorExpirePolicy(opCtx); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable()) + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary()) .keepAll(false) .execute(); @@ -3842,12 +3842,12 @@ public Iterator> igniteIterator() { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Value. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("IfMayBeConditional") - @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException { + @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) @@ -3877,7 +3877,7 @@ public Iterator> igniteIterator() { Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null; - return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable); + return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary); } /** {@inheritDoc} */ @@ -4513,21 +4513,21 @@ public Set primaryKeySet(@Nullable CacheEntryPredicate... filter) { /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Cached value. * @throws IgniteCheckedException If failed. */ - @Nullable public V get(K key, boolean deserializePortable) + @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException { - return getAsync(key, deserializePortable).get(); + return getAsync(key, deserializeBinary).get(); } /** * @param key Key. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read operation future. */ - public final IgniteInternalFuture getAsync(final K key, boolean deserializePortable) { + public final IgniteInternalFuture getAsync(final K key, boolean deserializeBinary) { try { checkJta(); } @@ -4542,30 +4542,30 @@ public final IgniteInternalFuture getAsync(final K key, boolean deserializePo /*skip tx*/false, null, taskName, - deserializePortable, + deserializeBinary, false, /*can remap*/true); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Map of cached values. * @throws IgniteCheckedException If read failed. */ - public Map getAll(Collection extends K> keys, boolean deserializePortable) throws IgniteCheckedException { + public Map getAll(Collection extends K> keys, boolean deserializeBinary) throws IgniteCheckedException { checkJta(); - return getAllAsync(keys, deserializePortable).get(); + return getAllAsync(keys, deserializeBinary).get(); } /** * @param keys Keys. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Read future. */ public IgniteInternalFuture> getAllAsync(@Nullable Collection extends K> keys, - boolean deserializePortable) { + boolean deserializeBinary) { String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(keys, @@ -4573,7 +4573,7 @@ public IgniteInternalFuture> getAllAsync(@Nullable Collection extend /*skip tx*/false, /*subject id*/null, taskName, - deserializePortable, + deserializeBinary, /*skip vals*/false, /*can remap*/true); } @@ -4662,11 +4662,11 @@ protected void validateCacheKeys(Iterable> keys) { /** * @param it Internal entry iterator. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API iterator. */ protected Iterator> iterator(final Iterator it, - final boolean deserializePortable) { + final boolean deserializeBinary) { return new Iterator>() { { advance(); @@ -4704,7 +4704,7 @@ private void advance() { GridCacheEntryEx entry = it.next(); try { - next = toCacheEntry(entry, deserializePortable); + next = toCacheEntry(entry, deserializeBinary); if (next == null) continue; @@ -4724,13 +4724,13 @@ private void advance() { /** * @param entry Internal entry. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @return Public API entry. * @throws IgniteCheckedException If failed. * @throws GridCacheEntryRemovedException If entry removed. */ @Nullable private Cache.Entry toCacheEntry(GridCacheEntryEx entry, - boolean deserializePortable) + boolean deserializeBinary) throws IgniteCheckedException, GridCacheEntryRemovedException { CacheObject val = entry.innerGet( @@ -4746,7 +4746,7 @@ private void advance() { null, null, null, - !deserializePortable); + !deserializeBinary); if (val == null) return null; @@ -4756,9 +4756,9 @@ private void advance() { Object key0 = key.value(ctx.cacheObjectContext(), true); Object val0 = val.value(ctx.cacheObjectContext(), true); - if (deserializePortable) { - key0 = ctx.unwrapPortableIfNeeded(key0, true); - val0 = ctx.unwrapPortableIfNeeded(val0, true); + if (deserializeBinary) { + key0 = ctx.unwrapBinaryIfNeeded(key0, true); + val0 = ctx.unwrapBinaryIfNeeded(val0, true); } return new CacheEntryImpl<>((K)key0, (V)val0, entry.version()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java index f78a606b2a844..05ff71a216c99 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java @@ -1781,7 +1781,7 @@ private KeyIterator(GridCacheConcurrentMap map, boolean keepBinary, CacheEntryPr /** {@inheritDoc} */ @Override public K next() { - return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true); + return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 6645d8ad81799..c10ebf3b399cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -320,7 +320,7 @@ public GridCacheContext( this.cacheType = cacheType; this.affNode = affNode; this.updatesAllowed = updatesAllowed; - this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg); + this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg); /* * Managers in starting order! @@ -1677,7 +1677,7 @@ public boolean cancelRemove(@Nullable IgniteBiTuple interceptorRes) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor cacheObjects() { return kernalContext().cacheObjects(); @@ -1691,9 +1691,9 @@ public boolean binaryMarshaller() { } /** - * @return Keep portable flag. + * @return Keep binary flag. */ - public boolean keepPortable() { + public boolean keepBinary() { CacheOperationContext opCtx = operationContextPerCall(); return opCtx != null && opCtx.isKeepBinary(); @@ -1730,34 +1730,34 @@ public boolean useOffheapEntry() { * Unwraps collection. * * @param col Collection to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped collection. */ - public Collection unwrapPortablesIfNeeded(Collection col, boolean keepPortable) { - return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable); + public Collection unwrapBinariesIfNeeded(Collection col, boolean keepBinary) { + return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary); } /** * Unwraps object for binary. * * @param o Object to unwrap. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. * @param cpy Copy value flag. * @return Unwrapped object. */ - public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) { - return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy); + public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) { + return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy); } /** @@ -1772,7 +1772,7 @@ public Map unwrapInvokeResult(@Nullable Map resMap CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1872,7 +1872,7 @@ public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedExc * @param val Value. * @param skipVals Skip values flag. * @param keepCacheObjects Keep cache objects flag. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param cpy Copy flag. */ @SuppressWarnings("unchecked") @@ -1881,15 +1881,15 @@ public void addResult(Map map, CacheObject val, boolean skipVals, boolean keepCacheObjects, - boolean deserializePortable, + boolean deserializeBinary, boolean cpy) { assert key != null; assert val != null || skipVals; if (!keepCacheObjects) { - Object key0 = unwrapPortableIfNeeded(key, !deserializePortable); + Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary); - Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable); + Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary); assert key0 != null : key; assert val0 != null : val; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index a0c9c3caf9259..ccbaf38ad332e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -378,7 +378,7 @@ public GridCacheUpdateTxResult innerSet( long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -416,7 +416,7 @@ public GridCacheUpdateTxResult innerRemove( boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -472,7 +472,7 @@ public GridCacheUpdateAtomicResult innerUpdate( boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -521,7 +521,7 @@ public GridTuple3> innerUpdateLoca boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable ExpiryPolicy expiryPlc, boolean evt, boolean metrics, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java index 98579c27e5ac3..ec8b8cc453e7b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java @@ -154,7 +154,7 @@ public void addEvent(int part, UUID subjId, String cloClsName, String taskName, - boolean keepPortable) + boolean keepBinary) { addEvent(part, key, @@ -168,7 +168,7 @@ public void addEvent(int part, subjId, cloClsName, taskName, - keepPortable); + keepBinary); } /** @@ -246,7 +246,7 @@ public void addEvent( UUID subjId, @Nullable String cloClsName, @Nullable String taskName, - boolean keepPortable + boolean keepBinary ) { assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED; @@ -265,19 +265,19 @@ public void addEvent( "(try to increase topology history size configuration property of configured " + "discovery SPI): " + evtNodeId); - keepPortable = keepPortable || forceKeepBinary; + keepBinary = keepBinary || forceKeepBinary; Object key0; Object val0; Object oldVal0; try { - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false); } catch (Exception e) { - if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config())) + if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config())) throw e; if (log.isDebugEnabled()) @@ -289,9 +289,9 @@ public void addEvent( forceKeepBinary = true; - key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false); - val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false); - oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false); + key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false); + val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false); + oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false); } cctx.gridEvents().record(new CacheEvent(cctx.name(), @@ -387,4 +387,4 @@ public boolean isRecordable(int type) { X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ", stats=" + "N/A" + ']'); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index ae0b4123709de..c896a82e229fb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -1069,7 +1069,7 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { long ttl, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1127,10 +1127,10 @@ protected void recordNodeId(UUID nodeId, AffinityTopologyVersion topVer) { if (intercept) { val0 = CU.value(val, cctx, false); - CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable); + CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary); Object interceptorVal = cctx.config().getInterceptor().onBeforePut( - new CacheLazyEntry(cctx, key, old, keepPortable), + new CacheLazyEntry(cctx, key, old, keepBinary), val0); key0 = e.key(); @@ -1203,7 +1203,7 @@ else if (interceptorVal != val0) evtOld, evtOld != null || hasValueUnlocked(), subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1211,7 +1211,7 @@ else if (interceptorVal != val0) cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(), partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, false, keepPortable); + cctx.dataStructures().onEntryUpdated(key, false, keepBinary); } if (log.isDebugEnabled()) @@ -1223,7 +1223,7 @@ else if (interceptorVal != val0) cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer); if (intercept) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary)); return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) : new GridCacheUpdateTxResult(false, null); @@ -1245,7 +1245,7 @@ protected Object keyValue(boolean cpy) { boolean retval, boolean evt, boolean metrics, - boolean keepPortable, + boolean keepBinary, AffinityTopologyVersion topVer, CacheEntryPredicate[] filter, GridDrType drType, @@ -1307,7 +1307,7 @@ protected Object keyValue(boolean cpy) { old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val; if (intercept) { - entry0 = new CacheLazyEntry(cctx, key, old, keepPortable); + entry0 = new CacheLazyEntry(cctx, key, old, keepBinary); interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0); @@ -1385,7 +1385,7 @@ else if (log.isDebugEnabled()) subjId, null, taskName, - keepPortable); + keepBinary); } if (cctx.isLocal() || cctx.isReplicated() || @@ -1393,7 +1393,7 @@ else if (log.isDebugEnabled()) cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal() || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer); - cctx.dataStructures().onEntryUpdated(key, true, keepPortable); + cctx.dataStructures().onEntryUpdated(key, true, keepBinary); deferred = cctx.deferredDelete() && !detached() && !isInternal(); @@ -1534,7 +1534,7 @@ else if (ttl == CU.TTL_NOT_CHANGED) updateTtl(expiryPlc); Object val = retval ? - cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false) + cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false) : null; return new T3<>(false, val, null); @@ -1751,7 +1751,7 @@ else if (ttl != CU.TTL_ZERO) return new GridTuple3<>(res, cctx.unwrapTemporary(interceptorRes != null ? interceptorRes.get2() : - cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)), + cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)), invokeRes); } @@ -1767,7 +1767,7 @@ else if (ttl != CU.TTL_ZERO) boolean writeThrough, boolean readThrough, boolean retval, - boolean keepPortable, + boolean keepBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean evt, boolean metrics, @@ -1839,7 +1839,7 @@ else if (ttl != CU.TTL_ZERO) oldVal = rawGetOrUnmarshalUnlocked(true); - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -1977,7 +1977,7 @@ else if (ttl != CU.TTL_ZERO) (EntryProcessor)writeObj; CacheInvokeEntry entry = - new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable); + new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary); try { entryProcessor.process(entry, invokeArgs); @@ -2099,7 +2099,7 @@ assert isNew() || ATOMIC_VER_COMPARATOR.compare(ver, newVer, ignoreTime) <= 0 : EntryProcessor entryProcessor = (EntryProcessor)writeObj; - CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable); + CacheInvokeEntry entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary); try { Object computed = entryProcessor.process(entry, invokeArgs); @@ -2224,7 +2224,7 @@ else if (newSysTtl == CU.TTL_ZERO) { updated0 = value(updated0, updated, false); Object interceptorVal = cctx.config().getInterceptor() - .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0); + .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0); if (interceptorVal == null) return new GridCacheUpdateAtomicResult(false, @@ -2291,7 +2291,7 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) { @@ -2300,14 +2300,14 @@ assert deletedUnlocked() || new0 || isInternal(): "Invalid entry [entry=" + this cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld, - evtOld != null || hadVal, subjId, null, taskName, keepPortable); + evtOld != null || hadVal, subjId, null, taskName, keepBinary); } } } else { if (intercept) { interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0, - oldVal, old0, keepPortable)); + oldVal, old0, keepBinary)); if (cctx.cancelRemove(interceptRes)) return new GridCacheUpdateAtomicResult(false, @@ -2387,7 +2387,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld, evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName, - keepPortable); + keepBinary); } if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) { @@ -2396,7 +2396,7 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi cctx.events().addEvent(partition(), key, evtNodeId, null, newVer, EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal, - subjId, null, taskName, keepPortable); + subjId, null, taskName, keepBinary); } } @@ -2406,13 +2406,13 @@ assert deletedUnlocked() || new0 || isInternal() : "Invalid entry [entry=" + thi if (res) updateMetrics(op, metrics); - cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable); + cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary); if (intercept) { if (op == GridCacheOperation.UPDATE) - cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable)); + cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary)); else - cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable)); + cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary)); if (interceptRes != null) oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2())); @@ -4330,13 +4330,13 @@ private LazyValueEntry(KeyCacheObject key, boolean keepBinary) { /** {@inheritDoc} */ @Override public K getKey() { - return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary); + return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public V getValue() { - return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary); + return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java index f4ddf89797a3a..ea036af531569 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java @@ -34,7 +34,7 @@ * Expire time * GridCacheVersion or GridCacheVersionEx * Value is byte array flag - * Value byte array (marshalled with portable or grid marshaller) + * Value byte array (marshalled with binary or grid marshaller) * Value classloader UUID * Key classloader UUID * @@ -192,4 +192,4 @@ public static GridCacheVersion version(long ptr) { @Override public String toString() { return S.toString(GridCacheOffheapSwapEntry.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index 68e70c337ca3b..d1d93d8244879 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -229,7 +229,7 @@ public IgniteInternalCache delegate() { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheProxyImpl keepPortable() { + @Override public GridCacheProxyImpl keepBinary() { if (opCtx != null && opCtx.isKeepBinary()) return (GridCacheProxyImpl)this; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index 2d179fa9a0d88..21154c9058d6d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -190,7 +190,7 @@ public GridCacheReturn set( */ private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) { if (loc) - v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true); + v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true); else { assert cacheId == 0 || cacheId == cctx.cacheId(); @@ -318,7 +318,7 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite if (cacheObj != null) { cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr); - v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false); + v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false); } if (invokeRes && invokeResCol != null) { @@ -329,10 +329,10 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite for (CacheInvokeDirectResult res : invokeResCol) { CacheInvokeResult> res0 = res.error() == null ? - CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) : + CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) : CacheInvokeResult.fromError(res.error()); - map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0); + map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0); } v = map0; @@ -464,4 +464,4 @@ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws Ignite @Override public String toString() { return S.toString(GridCacheReturn.class, this); } -} \ No newline at end of file +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 8fd43237fb377..1768ecff2d351 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -322,7 +322,7 @@ public GridCacheGateway gate() { /** {@inheritDoc} */ @Override public IgniteCache withKeepBinary() { - return keepPortable(); + return keepBinary(); } /** {@inheritDoc} */ @@ -455,13 +455,13 @@ private QueryCursor> query(final Query filter, @Nullable Cluste final CacheQuery> qry; final CacheQueryFuture> fut; - boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary(); + boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary(); if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(), - isKeepPortable); + isKeepBinary); if (grp != null) qry.projection(grp); @@ -476,7 +476,7 @@ private QueryCursor> query(final Query filter, @Nullable Cluste else if (filter instanceof TextQuery) { TextQuery p = (TextQuery)filter; - qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable); + qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary); if (grp != null) qry.projection(grp); @@ -489,7 +489,7 @@ else if (filter instanceof TextQuery) { }, false); } else if (filter instanceof SpiQuery) { - qry = ctx.queries().createSpiQuery(isKeepPortable); + qry = ctx.queries().createSpiQuery(isKeepBinary); if (grp != null) qry.projection(grp); @@ -1718,30 +1718,30 @@ else if (clazz.isAssignableFrom(IgniteEx.class)) } /** - * Creates projection that will operate with portable objects. Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types: {@code PortableObject} - * for portable classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) + * Creates projection that will operate with binary objects. Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types: {@code BinaryObject} + * for binary classes All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) {@link String} and array of {@link String}s * {@link UUID} and array of {@link UUID}s {@link Date} and array of {@link Date}s {@link * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s Enums and array of enums Maps, - * collections and array of objects (but objects inside them will still be converted if they are portable) + * collections and array of objects (but objects inside them will still be converted if they are binary) * For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + * Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
Projection returned by this method will force - * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without - * changes. Therefore, signature of the projection can contain only following types:
Projection returned by this method will force + * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without + * changes. Therefore, signature of the projection can contain only following types:
For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be - * stored in portable format), you should acquire following projection to avoid deserialization: + * stored in binary format), you should acquire following projection to avoid deserialization: *
- * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); *
Note that this method makes sense only if cache is working in portable mode ({@code - * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return + *
Note that this method makes sense only if cache is working in binary mode ({@code + * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return * current projection. * - * @return Projection for portable objects. + * @return Projection for binary objects. */ @SuppressWarnings("unchecked") - public IgniteCache keepPortable() { + public IgniteCache keepBinary() { GridCacheGateway gate = this.gate; CacheOperationContext prev = onEnter(gate, opCtx); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index 3150ea99ffd54..186de6870c887 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -169,31 +169,31 @@ * to any participating grid nodes. However, in case of redeployment, caches will be cleared and * all entries will be removed. This behavior is useful during development, but should not be * used in production. - * Portable Objects - * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary) - * format. User can choose to work either with the portable format or with the deserialized form (assuming + * Binary Objects + * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary) + * format. User can choose to work either with the binary format or with the deserialized form (assuming * that class definitions are present in the classpath). By default, cache works with deserialized form - * (example shows the case when {@link Integer} is used as a key for a portable object): + * (example shows the case when {@link Integer} is used as a key for a binary object): * * IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); * * You won't be able to work with deserialized form if class definition for the {@code Value} is not on * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not - * needed for performance reasons. To work with portable format directly you should create special projection - * using {@link #keepPortable()} method: + * needed for performance reasons. To work with binary format directly you should create special projection + * using {@link #keepBinary()} method: * - * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * - * See {@link #keepPortable()} method JavaDoc for more details. + * See {@link #keepBinary()} method JavaDoc for more details. */ public interface IgniteInternalCache extends Iterable> { /** @@ -225,13 +225,13 @@ public interface IgniteInternalCache extends Iterable> { public IgniteInternalCache setSkipStore(boolean skipStore); /** - * Creates projection that will operate with portable objects. + * Creates projection that will operate with binary objects. * - * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * - * org.gridgain.grid.binary.PortableObject for portable classes + * org.gridgain.grid.binary.BinaryObject for binary classes * All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...) * Arrays of primitives (byte[], int[], ...) * {@link String} and array of {@link String}s @@ -241,27 +241,27 @@ public interface IgniteInternalCache extends Iterable> { * Enums and array of enums * * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) + * them will still be converted if they are binary) * * * * For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: * - * IgniteInternalCache prj = cache.keepBinary(); + * IgniteInternalCache prj = cache.keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); * * - * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
* IgniteInternalCache prj = Ignition.grid().cache(null); * - * // Value will be serialized and stored in cache in portable format. + * // Value will be serialized and stored in cache in binary format. * prj.put(1, new Value()); * - * // Value will be deserialized since it's stored in portable format. + * // Value will be deserialized since it's stored in binary format. * Value val = prj.get(1); *
- * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); + * IgniteInternalCache prj = Ignition.grid().cache(null).keepBinary(); * - * // Value is not deserialized and returned in portable format. - * GridPortableObject po = prj.get(1); + * // Value is not deserialized and returned in binary format. + * GridBinaryObject po = prj.get(1); *
- * Projection returned by this method will force cache not to deserialize portable objects, + * Projection returned by this method will force cache not to deserialize binary objects, * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: *
org.gridgain.grid.binary.PortableObject
org.gridgain.grid.binary.BinaryObject
* For example, if you use {@link Integer} as a key and {@code Value} class as a value - * (which will be stored in portable format), you should acquire following projection + * (which will be stored in binary format), you should acquire following projection * to avoid deserialization: *
- * Note that this method makes sense only if cache is working in portable mode - * (org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled() returns {@code true}. If not, + * Note that this method makes sense only if cache is working in binary mode + * (org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled() returns {@code true}. If not, * this method is no-op and will return current projection. * - * @return New internal cache instance for portable objects. + * @return New internal cache instance for binary objects. */ - public IgniteInternalCache keepPortable(); + public IgniteInternalCache keepBinary(); /** * Returns {@code true} if this map contains no key-value mappings. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java index f6204fbc670dc..1f2678b1e85bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java @@ -25,7 +25,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; /** - * Key for portable meta data. + * Key for binary meta data. */ class BinaryMetadataKey extends GridCacheUtilityKey implements Externalizable { /** */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java index c0a461280e35d..0ca06e3b2bc84 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java @@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects(); try { - key = proc.toPortable(key); + key = proc.toBinary(key); } catch (IgniteException e) { - U.error(log, "Failed to marshal key to portable: " + key, e); + U.error(log, "Failed to marshal key to binary: " + key, e); } if (key instanceof BinaryObject) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java index 039f5ce33f280..ec01f48a8bf38 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java @@ -27,11 +27,11 @@ */ public class CacheObjectBinaryContext extends CacheObjectContext { /** */ - private boolean portableEnabled; + private boolean binaryEnabled; /** * @param kernalCtx Kernal context. - * @param portableEnabled Portable enabled flag. + * @param binaryEnabled Binary enabled flag. * @param cpyOnGet Copy on get flag. * @param storeVal {@code True} if should store unmarshalled value in cache. * @param depEnabled {@code true} if deployment is enabled for the given cache. @@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext { public CacheObjectBinaryContext(GridKernalContext kernalCtx, boolean cpyOnGet, boolean storeVal, - boolean portableEnabled, + boolean binaryEnabled, boolean depEnabled) { - super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : + super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() : new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled); - this.portableEnabled = portableEnabled; + this.binaryEnabled = binaryEnabled; } /** - * @return Portable enabled flag. + * @return Binary enabled flag. */ - public boolean portableEnabled() { - return portableEnabled; + public boolean binaryEnabled() { + return binaryEnabled; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java index d5638a5f753fb..3578f7a1010da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java @@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor { public BinaryObjectBuilder builder(String clsName); /** - * Creates builder initialized by existing portable object. + * Creates builder initialized by existing binary object. * - * @param portableObj Portable object to edit. - * @return Portable builder. + * @param binaryObj Binary object to edit. + * @return Binary builder. */ - public BinaryObjectBuilder builder(BinaryObject portableObj); + public BinaryObjectBuilder builder(BinaryObject binaryObj); /** * @param typeId Type ID. @@ -92,15 +92,15 @@ public void updateMetadata(int typeId, String typeName, @Nullable String affKeyF public BinaryObject buildEnum(String typeName, int ord) throws IgniteException; /** - * @return Portables interface. + * @return Binaries interface. * @throws IgniteException If failed. */ public IgniteBinary binary() throws IgniteException; /** * @param obj Original object. - * @return Portable object (in case portable marshaller is used). + * @return Binary object (in case binary marshaller is used). * @throws IgniteException If failed. */ - public Object marshalToPortable(Object obj) throws IgniteException; + public Object marshalToBinary(Object obj) throws IgniteException; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java index a9f0d74ec8697..e77b85a9fd4aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java @@ -98,7 +98,7 @@ import sun.misc.Unsafe; /** - * Portable processor implementation. + * Binary processor implementation. */ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements CacheObjectBinaryProcessor { @@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private final ConcurrentHashMap8 clientMetaDataCache; - /** Predicate to filter portable meta data in utility cache. */ + /** Predicate to filter binary meta data in utility cache. */ private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() { private static final long serialVersionUID = 0L; @@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }; /** */ - private BinaryContext portableCtx; + private BinaryContext binaryCtx; /** */ private Marshaller marsh; /** */ - private GridBinaryMarshaller portableMarsh; + private GridBinaryMarshaller binaryMarsh; /** */ @GridToStringExclude - private IgniteBinary portables; + private IgniteBinary binaries; /** Metadata updates collected before metadata cache is initialized. */ private final Map metaBuf = new ConcurrentHashMap<>(); @@ -193,7 +193,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { assert metaDataCache != null; - CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx)); + CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx)); } @Override public BinaryType metadata(int typeId) throws BinaryObjectException { @@ -206,14 +206,14 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh; - portableCtx = new BinaryContext(metaHnd, ctx.config()); + binaryCtx = new BinaryContext(metaHnd, ctx.config()); - IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx, + IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx, ctx.config()); - portableMarsh = new GridBinaryMarshaller(portableCtx); + binaryMarsh = new GridBinaryMarshaller(binaryCtx); - portables = new IgniteBinaryImpl(ctx, this); + binaries = new IgniteBinaryImpl(ctx, this); } } @@ -286,7 +286,7 @@ public CacheObjectBinaryProcessorImpl(GridKernalContext ctx) { } for (Map.Entry e : metaBuf.entrySet()) - addMeta(e.getKey(), e.getValue().wrap(portableCtx)); + addMeta(e.getKey(), e.getValue().wrap(binaryCtx)); metaBuf.clear(); @@ -321,17 +321,17 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata res = oldMeta0; } - return res != null ? res.wrap(portableCtx) : null; + return res != null ? res.wrap(binaryCtx) : null; } }); } /** {@inheritDoc} */ @Override public int typeId(String typeName) { - if (portableCtx == null) + if (binaryCtx == null) return super.typeId(typeName); - return portableCtx.typeId(typeName); + return binaryCtx.typeId(typeName); } /** @@ -340,7 +340,7 @@ private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; @@ -367,7 +367,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap); - return portableMarsh.unmarshal(in); + return binaryMarsh.unmarshal(in); } else return U.copyMemory(ptr, size); @@ -375,11 +375,11 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException { + @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return null; - if (BinaryUtils.isPortableType(obj.getClass())) + if (BinaryUtils.isBinaryType(obj.getClass())) return obj; if (obj instanceof Object[]) { @@ -388,7 +388,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Object[] pArr = new Object[arr.length]; for (int i = 0; i < arr.length; i++) - pArr[i] = marshalToPortable(arr[i]); + pArr[i] = marshalToBinary(arr[i]); return pArr; } @@ -397,9 +397,9 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio IgniteBiTuple tup = (IgniteBiTuple)obj; if (obj instanceof T2) - return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); - return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2())); + return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2())); } if (obj instanceof Collection) { @@ -413,7 +413,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio pCol = new ArrayList<>(col.size()); for (Object item : col) - pCol.add(marshalToPortable(item)); + pCol.add(marshalToBinary(item)); return pCol; } @@ -424,7 +424,7 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio Map pMap = BinaryUtils.newMap((Map)obj); for (Map.Entry, ?> e : map.entrySet()) - pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); return pMap; } @@ -432,14 +432,14 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio if (obj instanceof Map.Entry) { Map.Entry, ?> e = (Map.Entry, ?>)obj; - return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue())); + return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue())); } - byte[] arr = portableMarsh.marshal(obj); + byte[] arr = binaryMarsh.marshal(obj); assert arr.length > 0; - Object obj0 = portableMarsh.unmarshal(arr, null); + Object obj0 = binaryMarsh.unmarshal(arr, null); // Possible if a class has writeObject method. if (obj0 instanceof BinaryObject) @@ -452,17 +452,17 @@ public Object unmarshal(long ptr, boolean forceHeap) throws BinaryObjectExceptio * @return Marshaller. */ public GridBinaryMarshaller marshaller() { - return portableMarsh; + return binaryMarsh; } /** {@inheritDoc} */ @Override public BinaryObjectBuilder builder(String clsName) { - return new BinaryObjectBuilderImpl(portableCtx, clsName); + return new BinaryObjectBuilderImpl(binaryCtx, clsName); } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { - return BinaryObjectBuilderImpl.wrap(portableObj); + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { + return BinaryObjectBuilderImpl.wrap(binaryObj); } /** {@inheritDoc} */ @@ -470,7 +470,7 @@ public GridBinaryMarshaller marshaller() { Map fieldTypeIds, boolean isEnum) throws BinaryObjectException { BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum); - portableCtx.updateMetadata(typeId, meta); + binaryCtx.updateMetadata(typeId, meta); } /** {@inheritDoc} */ @@ -507,7 +507,7 @@ public GridBinaryMarshaller marshaller() { BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId)); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } else { BinaryMetadataKey key = new BinaryMetadataKey(typeId); @@ -517,7 +517,7 @@ public GridBinaryMarshaller marshaller() { if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone()) meta = metaDataCache.getTopologySafe(key); - return meta != null ? meta.wrap(portableCtx) : null; + return meta != null ? meta.wrap(binaryCtx) : null; } } catch (CacheException e) { @@ -539,7 +539,7 @@ public GridBinaryMarshaller marshaller() { Map res = U.newHashMap(meta.size()); for (Map.Entry e : meta.entrySet()) - res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); + res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx)); return res; } @@ -563,7 +563,7 @@ public GridBinaryMarshaller marshaller() { private static final long serialVersionUID = 0L; @Override public BinaryType apply(Cache.Entry e) { - return e.getValue().wrap(portableCtx); + return e.getValue().wrap(binaryCtx); } }); } @@ -573,30 +573,30 @@ public GridBinaryMarshaller marshaller() { @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException { typeName = BinaryContext.typeName(typeName); - int typeId = portableCtx.typeId(typeName); + int typeId = binaryCtx.typeId(typeName); updateMetadata(typeId, typeName, null, null, true); - return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord); + return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord); } /** {@inheritDoc} */ @Override public IgniteBinary binary() throws IgniteException { - return portables; + return binaries; } /** {@inheritDoc} */ - @Override public boolean isPortableObject(Object obj) { + @Override public boolean isBinaryObject(Object obj) { return obj instanceof BinaryObject; } /** {@inheritDoc} */ - @Override public boolean isPortableEnabled(CacheConfiguration, ?> ccfg) { + @Override public boolean isBinaryEnabled(CacheConfiguration, ?> ccfg) { return marsh instanceof BinaryMarshaller; } /** - * @param po Portable object. + * @param po Binary object. * @return Affinity key. */ public Object affinityKey(BinaryObject po) { @@ -612,14 +612,14 @@ public Object affinityKey(BinaryObject po) { else if (po instanceof BinaryObjectEx) { int id = ((BinaryObjectEx)po).typeId(); - String affKeyFieldName = portableCtx.affinityKeyFieldName(id); + String affKeyFieldName = binaryCtx.affinityKeyFieldName(id); if (affKeyFieldName != null) return po.field(affKeyFieldName); } } catch (BinaryObjectException e) { - U.error(log, "Failed to get affinity field from portable object: " + po, e); + U.error(log, "Failed to get affinity field from binary object: " + po, e); } return po; @@ -630,7 +630,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return 0; - return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); + return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName()); } /** {@inheritDoc} */ @@ -638,7 +638,7 @@ else if (po instanceof BinaryObjectEx) { if (obj == null) return null; - return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); + return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName); } /** {@inheritDoc} */ @@ -647,17 +647,17 @@ else if (po instanceof BinaryObjectEx) { } /** - * @return Portable context. + * @return Binary context. */ - public BinaryContext portableContext() { - return portableCtx; + public BinaryContext binaryContext() { + return binaryCtx; } /** {@inheritDoc} */ @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException { assert cfg != null; - boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && + boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) && !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName()); CacheObjectContext ctx0 = super.contextForCache(cfg); @@ -665,7 +665,7 @@ public BinaryContext portableContext() { CacheObjectContext res = new CacheObjectBinaryContext(ctx, ctx0.copyOnGet(), ctx0.storeValue(), - portableEnabled, + binaryEnabled, ctx0.addDeploymentInfo()); ctx.resource().injectGeneric(res.defaultAffMapper()); @@ -675,10 +675,10 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.marshal(ctx, val); - byte[] arr = portableMarsh.marshal(val); + byte[] arr = binaryMarsh.marshal(val); assert arr.length > 0; @@ -688,22 +688,22 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null) return super.unmarshal(ctx, bytes, clsLdr); - return portableMarsh.unmarshal(bytes, clsLdr); + return binaryMarsh.unmarshal(bytes, clsLdr); } /** {@inheritDoc} */ @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheKeyObject(ctx, obj, userObj); if (obj instanceof KeyCacheObject) return (KeyCacheObject)obj; - if (((CacheObjectBinaryContext)ctx).portableEnabled()) { - obj = toPortable(obj); + if (((CacheObjectBinaryContext)ctx).binaryEnabled()) { + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -715,13 +715,13 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj, boolean userObj) { - if (!((CacheObjectBinaryContext)ctx).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx).binaryEnabled()) return super.toCacheObject(ctx, obj, userObj); if (obj == null || obj instanceof CacheObject) return (CacheObject)obj; - obj = toPortable(obj); + obj = toBinary(obj); if (obj instanceof BinaryObject) return (BinaryObjectImpl)obj; @@ -732,7 +732,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) { if (type == BinaryObjectImpl.TYPE_BINARY) - return new BinaryObjectImpl(portableContext(), bytes, 0); + return new BinaryObjectImpl(binaryContext(), bytes, 0); return super.toCacheObject(ctx, type, bytes); } @@ -740,7 +740,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp) throws IgniteCheckedException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return super.toCacheObject(ctx, valPtr, tmp); Object val = unmarshal(valPtr, !tmp); @@ -753,7 +753,7 @@ public BinaryContext portableContext() { /** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { - if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled()) + if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) @@ -764,17 +764,17 @@ public BinaryContext portableContext() { /** * @param obj Object. - * @return Portable object. + * @return Binary object. * @throws IgniteException In case of error. */ - @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException { + @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException { if (obj == null) return null; - if (isPortableObject(obj)) + if (isBinaryObject(obj)) return obj; - return marshalToPortable(obj); + return marshalToBinary(obj); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java index 4a225a59edb5f..1a2d0a929dafd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java @@ -64,7 +64,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) guard(); try { - return (T)proc.marshalToPortable(obj); + return (T)proc.marshalToBinary(obj); } finally { unguard(); @@ -84,11 +84,11 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** {@inheritDoc} */ - @Override public BinaryObjectBuilder builder(BinaryObject portableObj) { + @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) { guard(); try { - return proc.builder(portableObj); + return proc.builder(binaryObj); } finally { unguard(); @@ -156,7 +156,7 @@ public IgniteBinaryImpl(GridKernalContext ctx, CacheObjectBinaryProcessor proc) } /** - * @return Portable processor. + * @return Binary processor. */ public IgniteCacheObjectProcessor processor() { return proc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java index b0e5c2f0c9f44..4e65d9c4795b2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java @@ -17,6 +17,6 @@ /** * - * Implementation of portable processor. + * Implementation of binary processor. */ package org.apache.ignite.internal.processors.cache.binary; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 6447194a3bea4..f56cbf8a8adf5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -311,15 +311,15 @@ private void waitInitialization() throws IgniteCheckedException { * * @param key Key. * @param rmv {@code True} if entry was removed. - * @param keepPortable Keep portable flag. + * @param keepBinary Keep binary flag. */ - public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) { + public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) { // No need to notify data structures manager for a user cache since all DS objects are stored // in system caches. if (cctx.userCache()) return; - Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false); + Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false); if (key0 instanceof SetItemKey) onSetItemUpdated((SetItemKey)key0, rmv); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java index 360eb0f125c37..5d07b6faad974 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java @@ -251,7 +251,7 @@ public void keepBinary(boolean keepBinary) { } /** - * @return Keep portable. + * @return Keep binary. */ public boolean keepBinary() { return (flags & KEEP_BINARY_FLAG_MASK) != 0; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java index 245ffc6f595fe..320c3c2b91eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java @@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun /** Task name. */ protected String taskName; - /** Whether to deserialize portable objects. */ - protected boolean deserializePortable; + /** Whether to deserialize binary objects. */ + protected boolean deserializeBinary; /** Skip values flag. */ protected boolean skipVals; @@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter extends GridCompoun * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -117,7 +117,7 @@ protected CacheDistributedGetFutureAdapter( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -134,7 +134,7 @@ protected CacheDistributedGetFutureAdapter( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index ff8d315dbef29..9199e7060aac8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -625,7 +625,7 @@ else if (log.isDebugEnabled()) boolean skipTx, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, boolean skipVals, boolean canRemap ) { @@ -636,7 +636,7 @@ else if (log.isDebugEnabled()) /*don't check local tx. */false, subjId, taskName, - deserializePortable, + deserializeBinary, forcePrimary, null, skipVals, @@ -1164,7 +1164,7 @@ public Iterator> localEntriesIterator(final boolean primary, f assert primary || backup; if (primary && backup) - return iterator(map.entries0().iterator(), !ctx.keepPortable()); + return iterator(map.entries0().iterator(), !ctx.keepBinary()); else { final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); @@ -1228,7 +1228,7 @@ private void advance() { } }; - return iterator(it, !ctx.keepPortable()); + return iterator(it, !ctx.keepBinary()); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 626713a9762bd..e4102289d1fd8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -380,7 +380,7 @@ private IgniteInternalFuture> getAsync( else { fut = tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); @@ -410,7 +410,7 @@ private IgniteInternalFuture> getAsync( else { return tx.getAllAsync(cctx, keys.keySet(), - /*deserialize portable*/false, + /*deserialize binary*/false, skipVals, /*keep cache objects*/true, /*skip store*/!readThrough); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 90a9da8655b99..6867e21e319e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -88,7 +88,7 @@ public class GridPartitionedGetFuture extends CacheDistributedGetFutureAda * if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -103,7 +103,7 @@ public GridPartitionedGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -116,7 +116,7 @@ public GridPartitionedGetFuture( forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, canRemap, @@ -400,7 +400,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); if (res != null) { v = res.get1(); @@ -420,7 +420,7 @@ private boolean map( null, taskName, expiryPlc, - !deserializePortable); + !deserializeBinary); } colocated.context().evicts().touch(entry, topVer); @@ -439,7 +439,7 @@ private boolean map( v, skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, true); return false; @@ -524,7 +524,7 @@ private Map createResultMap(Collection infos) { info.value(), skipVals, keepCacheObjects, - deserializePortable, + deserializeBinary, false); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java index 99cf21097335e..f955bb6f686e8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java @@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im /** Task name. */ private final String taskName; - /** Whether to deserialize portable objects. */ - private boolean deserializePortable; + /** Whether to deserialize binary objects. */ + private boolean deserializeBinary; /** Skip values flag. */ private boolean skipVals; @@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter im * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param canRemap Flag indicating whether future can be remapped on a newer topology version. @@ -145,7 +145,7 @@ public GridPartitionedSingleGetFuture( boolean forcePrimary, @Nullable UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, @@ -160,7 +160,7 @@ public GridPartitionedSingleGetFuture( this.forcePrimary = forcePrimary; this.subjId = subjId; this.taskName = taskName; - this.deserializePortable = deserializePortable; + this.deserializeBinary = deserializeBinary; this.expiryPlc = expiryPlc; this.skipVals = skipVals; this.canRemap = canRemap; @@ -580,7 +580,7 @@ private void setResult(@Nullable CacheObject val, @Nullable GridCacheVersion ver } else { if (!keepCacheObjects) { - Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals); + Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals); onDone(res); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index d5e849e3e5e84..481317aaed9c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -321,7 +321,7 @@ public void near(GridNearAtomicCache near) { final boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap) { ctx.checkSecurity(SecurityPermission.CACHE_READ); @@ -345,7 +345,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -361,7 +361,7 @@ public void near(GridNearAtomicCache near) { boolean skipTx, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable, + final boolean deserializeBinary, final boolean skipVals, final boolean canRemap ) { @@ -389,7 +389,7 @@ public void near(GridNearAtomicCache near) { forcePrimary, subjId0, taskName, - deserializePortable, + deserializeBinary, expiryPlc, skipVals, skipStore, @@ -779,7 +779,7 @@ protected IgniteInternalFuture asyncOp(final CO> CacheInvokeResult invokeRes = (CacheInvokeResult)res; if (invokeRes.result() != null) - res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(), + res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(), keepBinary, false)); } @@ -1004,7 +1004,7 @@ private IgniteInternalFuture removeAllAsync0( * @param forcePrimary Force primary flag. * @param subjId Subject ID. * @param taskName Task name. - * @param deserializePortable Deserialize portable flag. + * @param deserializeBinary Deserialize binary flag. * @param expiryPlc Expiry policy. * @param skipVals Skip values flag. * @param skipStore Skip store flag. @@ -1015,7 +1015,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, boolean forcePrimary, UUID subjId, String taskName, - boolean deserializePortable, + boolean deserializeBinary, @Nullable ExpiryPolicy expiryPlc, boolean skipVals, boolean skipStore, @@ -1033,7 +1033,7 @@ private IgniteInternalFuture getAsync0(KeyCacheObject key, forcePrimary, subjId, taskName, - deserializePortable, + deserializeBinary, expiry, skipVals, canRemap, @@ -1052,7 +1052,7 @@ private IgniteInternalFuture
org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled()
org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled()