IGNITE-950 - Fixed tests, renaming.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2a1daa20 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2a1daa20 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2a1daa20 Branch: refs/heads/ignite-1753-1282 Commit: 2a1daa206bd3cf5a50d67a6150b0a9172a976fdf Parents: d1c7baa Author: Alexey Goncharuk <[email protected]> Authored: Tue Nov 3 12:44:47 2015 +0300 Committer: Alexey Goncharuk <[email protected]> Committed: Tue Nov 3 12:44:47 2015 +0300 ---------------------------------------------------------------------- ...mputeClientPortableTaskExecutionExample.java | 2 +- .../src/main/java/org/apache/ignite/Ignite.java | 6 +- .../java/org/apache/ignite/IgniteBinary.java | 366 +++++++++++++++++++ .../java/org/apache/ignite/IgniteObjects.java | 366 ------------------- .../org/apache/ignite/binary/BinaryObject.java | 18 +- .../ignite/binary/BinaryObjectBuilder.java | 12 +- .../org/apache/ignite/binary/BinaryReader.java | 53 ++- .../org/apache/ignite/binary/BinaryType.java | 59 +++ .../ignite/binary/BinaryTypeConfiguration.java | 1 + .../ignite/binary/BinaryTypeMetadata.java | 60 --- .../org/apache/ignite/binary/Binarylizable.java | 2 +- .../configuration/CacheConfiguration.java | 8 +- .../apache/ignite/internal/IgniteKernal.java | 4 +- .../internal/client/GridClientCompute.java | 2 +- .../impl/connection/GridClientConnection.java | 2 +- .../GridClientConnectionManagerAdapter.java | 2 +- .../connection/GridClientNioTcpConnection.java | 6 +- .../internal/portable/BinaryMetaDataImpl.java | 4 +- .../internal/portable/BinaryObjectEx.java | 6 +- .../internal/portable/BinaryObjectImpl.java | 4 +- .../portable/BinaryObjectOffheapImpl.java | 4 +- .../internal/portable/PortableContext.java | 4 +- .../portable/PortableMetaDataHandler.java | 6 +- .../builder/BinaryObjectBuilderImpl.java | 4 +- .../processors/cache/CacheObjectContext.java | 2 +- .../processors/cache/GridCacheContext.java | 2 +- .../processors/cache/IgniteInternalCache.java | 2 +- .../GridDistributedCacheAdapter.java | 2 + .../distributed/near/GridNearGetFuture.java | 27 +- .../portable/CacheObjectPortableProcessor.java | 16 +- .../CacheObjectPortableProcessorImpl.java | 90 ++--- .../cache/portable/IgniteBinaryImpl.java | 177 +++++++++ .../cache/portable/IgniteObjectsImpl.java | 177 --------- .../cache/query/GridCacheQueryRequest.java | 4 +- .../store/GridCacheStoreManagerAdapter.java | 2 +- .../transactions/IgniteTxLocalAdapter.java | 2 +- .../platform/PlatformContextImpl.java | 8 +- .../platform/compute/PlatformCompute.java | 2 +- .../PlatformDotNetConfigurationClosure.java | 6 +- .../client/message/GridClientTaskRequest.java | 6 +- ...idBinaryObjectBuilderAdditionalSelfTest.java | 20 +- .../GridBinaryObjectBuilderSelfTest.java | 14 +- ...idPortableMarshallerCtxDisabledSelfTest.java | 6 +- .../GridPortableMarshallerSelfTest.java | 6 +- .../GridPortableMetaDataDisabledSelfTest.java | 28 +- .../portable/GridPortableMetaDataSelfTest.java | 32 +- .../portable/GridPortableWildcardsSelfTest.java | 6 +- .../GridCacheBinaryObjectsAbstractSelfTest.java | 4 +- ...ntNodeBinaryObjectMetadataMultinodeTest.java | 28 +- ...CacheClientNodeBinaryObjectMetadataTest.java | 28 +- .../GridCachePortableStoreAbstractSelfTest.java | 4 +- .../GridCachePortableStoreObjectsSelfTest.java | 2 +- ...GridCachePortableStorePortablesSelfTest.java | 4 +- ...ridPortableCacheEntryMemorySizeSelfTest.java | 6 +- .../GridDataStreamerImplSelfTest.java | 2 +- ...acheOffHeapTieredAtomicPortableSelfTest.java | 2 +- ...eapTieredEvictionAtomicPortableSelfTest.java | 2 +- ...heOffHeapTieredEvictionPortableSelfTest.java | 2 +- .../GridCacheOffHeapTieredPortableSelfTest.java | 2 +- .../PlatformComputePortableArgTask.java | 4 +- .../ignite/testframework/junits/IgniteMock.java | 4 +- .../junits/multijvm/IgniteProcessProxy.java | 4 +- .../org/apache/ignite/IgniteSpringBean.java | 4 +- 63 files changed, 882 insertions(+), 858 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java b/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java index b281655..d6b8fd3 100644 --- a/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/portable/computegrid/ComputeClientPortableTaskExecutionExample.java @@ -74,7 +74,7 @@ public class ComputeClientPortableTaskExecutionExample { // Convert collection of employees to collection of portable objects. // This allows to send objects across nodes without requiring to have // Employee class on classpath of these nodes. - Collection<BinaryObject> portables = ignite.portables().toPortable(employees); + Collection<BinaryObject> portables = ignite.binary().toBinary(employees); // Execute task and get average salary. Long avgSalary = ignite.compute(ignite.cluster().forRemotes()).execute(new ComputeClientTask(), portables); http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/Ignite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java b/modules/core/src/main/java/org/apache/ignite/Ignite.java index 4125f8b..3fa35bb 100644 --- a/modules/core/src/main/java/org/apache/ignite/Ignite.java +++ b/modules/core/src/main/java/org/apache/ignite/Ignite.java @@ -459,11 +459,11 @@ public interface Ignite extends AutoCloseable { public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException; /** - * Gets an instance of {@link IgniteObjects} interface. + * Gets an instance of {@link IgniteBinary} interface. * - * @return Instance of {@link IgniteObjects} interface. + * @return Instance of {@link IgniteBinary} interface. */ - public IgniteObjects portables(); + public IgniteBinary binary(); /** * Closes {@code this} instance of grid. This method is identical to calling http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java new file mode 100644 index 0000000..ebbbd53 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java @@ -0,0 +1,366 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.TreeMap; +import java.util.UUID; +import org.apache.ignite.marshaller.portable.PortableMarshaller; +import org.apache.ignite.binary.BinaryObjectBuilder; +import org.apache.ignite.binary.BinaryObjectException; +import org.apache.ignite.binary.BinaryType; +import org.apache.ignite.binary.BinaryObject; +import org.jetbrains.annotations.Nullable; + +/** + * Defines portable objects functionality. With portable objects you are able to: + * <ul> + * <li>Seamlessly interoperate between Java, .NET, and C++.</li> + * <li>Make any object portable with zero code change to your existing code.</li> + * <li>Nest portable objects within each other.</li> + * <li>Automatically handle {@code circular} or {@code null} references.</li> + * <li>Automatically convert collections and maps between Java, .NET, and C++.</li> + * <li> + * Optionally avoid deserialization of objects on the server side + * (objects are stored in {@link org.apache.ignite.binary.BinaryObject} format). + * </li> + * <li>Avoid need to have concrete class definitions on the server side.</li> + * <li>Dynamically change structure of the classes without having to restart the cluster.</li> + * <li>Index into portable objects for querying purposes.</li> + * </ul> + * <h1 class="header">Working With Portables Directly</h1> + * Once an object is defined as portable, + * Ignite will always store it in memory in the portable (i.e. binary) format. + * User can choose to work either with the portable format or with the deserialized form + * (assuming that class definitions are present in the classpath). + * <p> + * To work with the portable format directly, user should create a special cache projection + * using IgniteCache.withKeepBinary() method and then retrieve individual fields as needed: + * <pre name=code class=java> + * IgniteCache<PortableObject, PortableObject> 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()); + * + * PortableObject val = prj.get(key); + * + * String field = val.field("myFieldName"); + * </pre> + * Alternatively, if we have class definitions in the classpath, we may choose to work with deserialized + * typed objects at all times. In this case we do incur the deserialization cost. However, if + * {@link PortableMarshaller#isKeepDeserialized()} is {@code true} then Ignite will only deserialize on the first access + * and will cache the deserialized object, so it does not have to be deserialized again: + * <pre name=code class=java> + * IgniteCache<MyKey.class, MyValue.class> cache = grid.cache(null); + * + * MyValue val = cache.get(new MyKey()); + * + * // Normal java getter. + * String fieldVal = val.getMyFieldName(); + * </pre> + * If we used, for example, one of the automatically handled portable types for a key, like integer, + * and still wanted to work with binary portable format for values, then we would declare cache projection + * as follows: + * <pre name=code class=java> + * IgniteCache<Integer.class, PortableObject> prj = cache.withKeepBinary(); + * </pre> + * <h1 class="header">Automatic Portable Types</h1> + * Note that only portable 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): + * <ul> + * <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li> + * <li>Arrays of primitives (byte[], int[], ...)</li> + * <li>{@link String} and array of {@link String}s</li> + * <li>{@link UUID} and array of {@link UUID}s</li> + * <li>{@link Date} and array of {@link Date}s</li> + * <li>{@link Timestamp} and array of {@link Timestamp}s</li> + * <li>Enums and array of enums</li> + * <li> + * Maps, collections and array of objects (but objects inside + * them will still be converted if they are portable) + * </li> + * </ul> + * <h1 class="header">Working With Maps and Collections</h1> + * All maps and collections in the portable objects are serialized automatically. When working + * with different platforms, e.g. C++ or .NET, Ignite will automatically pick the most + * adequate collection or map in either language. For example, {@link ArrayList} in Java will become + * {@code List} in C#, {@link LinkedList} in Java is {@link LinkedList} in C#, {@link HashMap} + * in Java is {@code Dictionary} in C#, and {@link TreeMap} in Java becomes {@code SortedDictionary} + * in C#, etc. + * <h1 class="header">Building Portable Objects</h1> + * Ignite comes with {@link org.apache.ignite.binary.BinaryObjectBuilder} which allows to build portable objects dynamically: + * <pre name=code class=java> + * PortableBuilder builder = Ignition.ignite().binary().builder(); + * + * builder.typeId("MyObject"); + * + * builder.stringField("fieldA", "A"); + * build.intField("fieldB", "B"); + * + * PortableObject portableObj = builder.build(); + * </pre> + * For the cases when class definition is present + * in the class path, it is also possible to populate a standard POJO and then + * convert it to portable format, like so: + * <pre name=code class=java> + * MyObject obj = new MyObject(); + * + * obj.setFieldA("A"); + * obj.setFieldB(123); + * + * PortableObject portableObj = Ignition.ignite().binary().toBinary(obj); + * </pre> + * NOTE: you don't need to convert typed objects to portable format before storing + * them in cache, Ignite will do that automatically. + * <h1 class="header">Portable Metadata</h1> + * Even though Ignite portable protocol only works with hash codes for type and field names + * to achieve better performance, Ignite provides metadata for all portable types which + * can be queried ar runtime via any of the {@link IgniteBinary#metadata(Class)} + * methods. Having metadata also allows for proper formatting of {@code PortableObject#toString()} method, + * even when portable objects are kept in binary format only, which may be necessary for audit reasons. + * <h1 class="header">Dynamic Structure Changes</h1> + * Since objects are always cached in the portable binary format, server does not need to + * be aware of the class definitions. Moreover, if class definitions are not present or not + * used on the server, then clients can continuously change the structure of the portable + * objects without having to restart the cluster. For example, if one client stores a + * certain class with fields A and B, and another client stores the same class with + * fields B and C, then the server-side portable object will have the fields A, B, and C. + * As the structure of a portable object changes, the new fields become available for SQL queries + * automatically. + * <h1 class="header">Configuration</h1> + * By default all your objects are considered as binary and no specific configuration is needed. + * However, in some cases, like when an object is used by both Java and .Net, you may need to specify portable objects + * explicitly by calling {@link PortableMarshaller#setClassNames(Collection)}. + * The only requirement Ignite imposes is that your object has an empty + * constructor. Note, that since server side does not have to know the class definition, + * you only need to list portable objects in configuration on the client side. However, if you + * list them on the server side as well, then you get the ability to deserialize portable objects + * into concrete types on the server as well as on the client. + * <p> + * Here is an example of portable configuration (note that star (*) notation is supported): + * <pre name=code class=xml> + * ... + * <!-- Explicit portable objects configuration. --> + * <property name="marshaller"> + * <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"> + * <property name="classNames"> + * <list> + * <value>my.package.for.portable.objects.*</value> + * <value>org.apache.ignite.examples.client.portable.Employee</value> + * </list> + * </property> + * </bean> + * </property> + * ... + * </pre> + * or from code: + * <pre name=code class=java> + * IgniteConfiguration cfg = new IgniteConfiguration(); + * + * PortableMarshaller marsh = new PortableMarshaller(); + * + * marsh.setClassNames(Arrays.asList( + * Employee.class.getName(), + * Address.class.getName()) + * ); + * + * cfg.setMarshaller(marsh); + * </pre> + * You can also specify class name for a portable object via {@link 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. + * <h1 class="header">Custom Affinity Keys</h1> + * Often you need to specify an alternate key (not the cache key) for affinity routing whenever + * storing objects in cache. For example, if you are caching {@code Employee} object with + * {@code Organization}, and want to colocate employees with organization they work for, + * so you can process them together, you need to specify an alternate affinity key. + * With portable objects you would have to do it as following: + * <pre name=code class=xml> + * <property name="marshaller"> + * <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller"> + * ... + * <property name="typeConfigurations"> + * <list> + * <bean class="org.apache.ignite.portable.PortableTypeConfiguration"> + * <property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/> + * <property name="affinityKeyFieldName" value="organizationId"/> + * </bean> + * </list> + * </property> + * ... + * </bean> + * </property> + * </pre> + * <h1 class="header">Serialization</h1> + * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom + * serialization logic by optionally implementing {@link org.apache.ignite.binary.Binarylizable} interface, like so: + * <pre name=code class=java> + * public class Address implements PortableMarshalAware { + * private String street; + * private int zip; + * + * // Empty constructor required for portable deserialization. + * public Address() {} + * + * @Override public void writeBinary(PortableWriter writer) throws PortableException { + * writer.writeString("street", street); + * writer.writeInt("zip", zip); + * } + * + * @Override public void readBinary(PortableReader reader) throws PortableException { + * street = reader.readString("street"); + * zip = reader.readInt("zip"); + * } + * } + * </pre> + * Alternatively, if you cannot change class definitions, you can provide custom serialization + * logic in {@link org.apache.ignite.binary.BinarySerializer} either globally in {@link PortableMarshaller} or + * for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. + * <p> + * Similar to java serialization you can use {@code writeReplace()} and {@code readResolve()} methods. + * <ul> + * <li> + * {@code readResolve} is defined as follows: {@code ANY-ACCESS-MODIFIER Object readResolve()}. + * It may be used to replace the de-serialized object by another one of your choice. + * </li> + * <li> + * {@code writeReplace} is defined as follows: {@code ANY-ACCESS-MODIFIER Object writeReplace()}. This method + * allows the developer to provide a replacement object that will be serialized instead of the original one. + * </li> + * </ul> + * + * <h1 class="header">Custom ID Mappers</h1> + * Ignite implementation uses name hash codes to generate IDs for class names or field names + * internally. However, in cases when you want to provide your own ID mapping schema, + * you can provide your own {@link org.apache.ignite.binary.BinaryTypeIdMapper} implementation. + * <p> + * ID-mapper may be provided either globally in {@link PortableMarshaller}, + * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. + * <h1 class="header">Query Indexing</h1> + * Portable objects can be indexed for querying by specifying index fields in + * {@link org.apache.ignite.cache.CacheTypeMetadata} inside of specific + * {@link org.apache.ignite.configuration.CacheConfiguration} instance, + * like so: + * <pre name=code class=xml> + * ... + * <bean class="org.apache.ignite.cache.CacheConfiguration"> + * ... + * <property name="typeMetadata"> + * <list> + * <bean class="CacheTypeMetadata"> + * <property name="type" value="Employee"/> + * + * <!-- Fields to index in ascending order. --> + * <property name="ascendingFields"> + * <map> + * <entry key="name" value="java.lang.String"/> + * + * <!-- Nested portable objects can also be indexed. --> + * <entry key="address.zip" value="java.lang.Integer"/> + * </map> + * </property> + * </bean> + * </list> + * </property> + * </bean> + * </pre> + */ +public interface IgniteBinary { + /** + * Gets type ID for given type name. + * + * @param typeName Type name. + * @return Type ID. + */ + public int typeId(String typeName); + + /** + * Converts provided object to instance of {@link org.apache.ignite.binary.BinaryObject}. + * + * @param obj Object to convert. + * @return Converted object. + * @throws org.apache.ignite.binary.BinaryObjectException In case of error. + */ + public <T> T toBinary(@Nullable Object obj) throws BinaryObjectException; + + /** + * Creates new portable builder. + * + * @param typeId ID of the type. + * @return Newly portable builder. + */ + public BinaryObjectBuilder builder(int typeId); + + /** + * Creates new portable builder. + * + * @param typeName Type name. + * @return Newly portable builder. + */ + public BinaryObjectBuilder builder(String typeName); + + /** + * Creates portable builder initialized by existing portable object. + * + * @param portableObj Portable object to initialize builder. + * @return Portable builder. + */ + public BinaryObjectBuilder builder(BinaryObject portableObj); + + /** + * Gets metadata for provided class. + * + * @param cls Class. + * @return Metadata. + * @throws org.apache.ignite.binary.BinaryObjectException In case of error. + */ + public BinaryType metadata(Class<?> cls) throws BinaryObjectException; + + /** + * Gets metadata for provided class name. + * + * @param typeName Type name. + * @return Metadata. + * @throws org.apache.ignite.binary.BinaryObjectException In case of error. + */ + public BinaryType metadata(String typeName) throws BinaryObjectException; + + /** + * Gets metadata for provided type ID. + * + * @param typeId Type ID. + * @return Metadata. + * @throws org.apache.ignite.binary.BinaryObjectException In case of error. + */ + public BinaryType metadata(int typeId) throws BinaryObjectException; + + /** + * Gets metadata for all known types. + * + * @return Metadata. + * @throws org.apache.ignite.binary.BinaryObjectException In case of error. + */ + public Collection<BinaryType> metadata() throws BinaryObjectException; +} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/IgniteObjects.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteObjects.java b/modules/core/src/main/java/org/apache/ignite/IgniteObjects.java deleted file mode 100644 index ace9865..0000000 --- a/modules/core/src/main/java/org/apache/ignite/IgniteObjects.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.TreeMap; -import java.util.UUID; -import org.apache.ignite.marshaller.portable.PortableMarshaller; -import org.apache.ignite.binary.BinaryObjectBuilder; -import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeMetadata; -import org.apache.ignite.binary.BinaryObject; -import org.jetbrains.annotations.Nullable; - -/** - * Defines portable objects functionality. With portable objects you are able to: - * <ul> - * <li>Seamlessly interoperate between Java, .NET, and C++.</li> - * <li>Make any object portable with zero code change to your existing code.</li> - * <li>Nest portable objects within each other.</li> - * <li>Automatically handle {@code circular} or {@code null} references.</li> - * <li>Automatically convert collections and maps between Java, .NET, and C++.</li> - * <li> - * Optionally avoid deserialization of objects on the server side - * (objects are stored in {@link org.apache.ignite.binary.BinaryObject} format). - * </li> - * <li>Avoid need to have concrete class definitions on the server side.</li> - * <li>Dynamically change structure of the classes without having to restart the cluster.</li> - * <li>Index into portable objects for querying purposes.</li> - * </ul> - * <h1 class="header">Working With Portables Directly</h1> - * Once an object is defined as portable, - * Ignite will always store it in memory in the portable (i.e. binary) format. - * User can choose to work either with the portable format or with the deserialized form - * (assuming that class definitions are present in the classpath). - * <p> - * To work with the portable format directly, user should create a special cache projection - * using IgniteCache.withKeepBinary() method and then retrieve individual fields as needed: - * <pre name=code class=java> - * IgniteCache<PortableObject, PortableObject> 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.portables().toPortable(new MyKey()); - * - * PortableObject val = prj.get(key); - * - * String field = val.field("myFieldName"); - * </pre> - * Alternatively, if we have class definitions in the classpath, we may choose to work with deserialized - * typed objects at all times. In this case we do incur the deserialization cost. However, if - * {@link PortableMarshaller#isKeepDeserialized()} is {@code true} then Ignite will only deserialize on the first access - * and will cache the deserialized object, so it does not have to be deserialized again: - * <pre name=code class=java> - * IgniteCache<MyKey.class, MyValue.class> cache = grid.cache(null); - * - * MyValue val = cache.get(new MyKey()); - * - * // Normal java getter. - * String fieldVal = val.getMyFieldName(); - * </pre> - * If we used, for example, one of the automatically handled portable types for a key, like integer, - * and still wanted to work with binary portable format for values, then we would declare cache projection - * as follows: - * <pre name=code class=java> - * IgniteCache<Integer.class, PortableObject> prj = cache.withKeepBinary(); - * </pre> - * <h1 class="header">Automatic Portable Types</h1> - * Note that only portable classes are converted to {@link org.apache.ignite.binary.BinaryObject} format. Following - * classes are never converted (e.g., {@link #toPortable(Object)} method will return original - * object, and instances of these classes will be stored in cache without changes): - * <ul> - * <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li> - * <li>Arrays of primitives (byte[], int[], ...)</li> - * <li>{@link String} and array of {@link String}s</li> - * <li>{@link UUID} and array of {@link UUID}s</li> - * <li>{@link Date} and array of {@link Date}s</li> - * <li>{@link Timestamp} and array of {@link Timestamp}s</li> - * <li>Enums and array of enums</li> - * <li> - * Maps, collections and array of objects (but objects inside - * them will still be converted if they are portable) - * </li> - * </ul> - * <h1 class="header">Working With Maps and Collections</h1> - * All maps and collections in the portable objects are serialized automatically. When working - * with different platforms, e.g. C++ or .NET, Ignite will automatically pick the most - * adequate collection or map in either language. For example, {@link ArrayList} in Java will become - * {@code List} in C#, {@link LinkedList} in Java is {@link LinkedList} in C#, {@link HashMap} - * in Java is {@code Dictionary} in C#, and {@link TreeMap} in Java becomes {@code SortedDictionary} - * in C#, etc. - * <h1 class="header">Building Portable Objects</h1> - * Ignite comes with {@link org.apache.ignite.binary.BinaryObjectBuilder} which allows to build portable objects dynamically: - * <pre name=code class=java> - * PortableBuilder builder = Ignition.ignite().portables().builder(); - * - * builder.typeId("MyObject"); - * - * builder.stringField("fieldA", "A"); - * build.intField("fieldB", "B"); - * - * PortableObject portableObj = builder.build(); - * </pre> - * For the cases when class definition is present - * in the class path, it is also possible to populate a standard POJO and then - * convert it to portable format, like so: - * <pre name=code class=java> - * MyObject obj = new MyObject(); - * - * obj.setFieldA("A"); - * obj.setFieldB(123); - * - * PortableObject portableObj = Ignition.ignite().portables().toPortable(obj); - * </pre> - * NOTE: you don't need to convert typed objects to portable format before storing - * them in cache, Ignite will do that automatically. - * <h1 class="header">Portable Metadata</h1> - * Even though Ignite portable protocol only works with hash codes for type and field names - * to achieve better performance, Ignite provides metadata for all portable types which - * can be queried ar runtime via any of the {@link IgniteObjects#metadata(Class)} - * methods. Having metadata also allows for proper formatting of {@code PortableObject#toString()} method, - * even when portable objects are kept in binary format only, which may be necessary for audit reasons. - * <h1 class="header">Dynamic Structure Changes</h1> - * Since objects are always cached in the portable binary format, server does not need to - * be aware of the class definitions. Moreover, if class definitions are not present or not - * used on the server, then clients can continuously change the structure of the portable - * objects without having to restart the cluster. For example, if one client stores a - * certain class with fields A and B, and another client stores the same class with - * fields B and C, then the server-side portable object will have the fields A, B, and C. - * As the structure of a portable object changes, the new fields become available for SQL queries - * automatically. - * <h1 class="header">Configuration</h1> - * By default all your objects are considered as portables and no specific configuration is needed. - * However, in some cases, like when an object is used by both Java and .Net, you may need to specify portable objects - * explicitly by calling {@link PortableMarshaller#setClassNames(Collection)}. - * The only requirement Ignite imposes is that your object has an empty - * constructor. Note, that since server side does not have to know the class definition, - * you only need to list portable objects in configuration on the client side. However, if you - * list them on the server side as well, then you get the ability to deserialize portable objects - * into concrete types on the server as well as on the client. - * <p> - * Here is an example of portable configuration (note that star (*) notation is supported): - * <pre name=code class=xml> - * ... - * <!-- Explicit portable objects configuration. --> - * <property name="marshaller"> - * <bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"> - * <property name="classNames"> - * <list> - * <value>my.package.for.portable.objects.*</value> - * <value>org.apache.ignite.examples.client.portable.Employee</value> - * </list> - * </property> - * </bean> - * </property> - * ... - * </pre> - * or from code: - * <pre name=code class=java> - * IgniteConfiguration cfg = new IgniteConfiguration(); - * - * PortableMarshaller marsh = new PortableMarshaller(); - * - * marsh.setClassNames(Arrays.asList( - * Employee.class.getName(), - * Address.class.getName()) - * ); - * - * cfg.setMarshaller(marsh); - * </pre> - * You can also specify class name for a portable object via {@link 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. - * <h1 class="header">Custom Affinity Keys</h1> - * Often you need to specify an alternate key (not the cache key) for affinity routing whenever - * storing objects in cache. For example, if you are caching {@code Employee} object with - * {@code Organization}, and want to colocate employees with organization they work for, - * so you can process them together, you need to specify an alternate affinity key. - * With portable objects you would have to do it as following: - * <pre name=code class=xml> - * <property name="marshaller"> - * <bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller"> - * ... - * <property name="typeConfigurations"> - * <list> - * <bean class="org.apache.ignite.portable.PortableTypeConfiguration"> - * <property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/> - * <property name="affinityKeyFieldName" value="organizationId"/> - * </bean> - * </list> - * </property> - * ... - * </bean> - * </property> - * </pre> - * <h1 class="header">Serialization</h1> - * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom - * serialization logic by optionally implementing {@link org.apache.ignite.binary.Binarylizable} interface, like so: - * <pre name=code class=java> - * public class Address implements PortableMarshalAware { - * private String street; - * private int zip; - * - * // Empty constructor required for portable deserialization. - * public Address() {} - * - * @Override public void writeBinary(PortableWriter writer) throws PortableException { - * writer.writeString("street", street); - * writer.writeInt("zip", zip); - * } - * - * @Override public void readBinary(PortableReader reader) throws PortableException { - * street = reader.readString("street"); - * zip = reader.readInt("zip"); - * } - * } - * </pre> - * Alternatively, if you cannot change class definitions, you can provide custom serialization - * logic in {@link org.apache.ignite.binary.BinarySerializer} either globally in {@link PortableMarshaller} or - * for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. - * <p> - * Similar to java serialization you can use {@code writeReplace()} and {@code readResolve()} methods. - * <ul> - * <li> - * {@code readResolve} is defined as follows: {@code ANY-ACCESS-MODIFIER Object readResolve()}. - * It may be used to replace the de-serialized object by another one of your choice. - * </li> - * <li> - * {@code writeReplace} is defined as follows: {@code ANY-ACCESS-MODIFIER Object writeReplace()}. This method - * allows the developer to provide a replacement object that will be serialized instead of the original one. - * </li> - * </ul> - * - * <h1 class="header">Custom ID Mappers</h1> - * Ignite implementation uses name hash codes to generate IDs for class names or field names - * internally. However, in cases when you want to provide your own ID mapping schema, - * you can provide your own {@link org.apache.ignite.binary.BinaryTypeIdMapper} implementation. - * <p> - * ID-mapper may be provided either globally in {@link PortableMarshaller}, - * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. - * <h1 class="header">Query Indexing</h1> - * Portable objects can be indexed for querying by specifying index fields in - * {@link org.apache.ignite.cache.CacheTypeMetadata} inside of specific - * {@link org.apache.ignite.configuration.CacheConfiguration} instance, - * like so: - * <pre name=code class=xml> - * ... - * <bean class="org.apache.ignite.cache.CacheConfiguration"> - * ... - * <property name="typeMetadata"> - * <list> - * <bean class="CacheTypeMetadata"> - * <property name="type" value="Employee"/> - * - * <!-- Fields to index in ascending order. --> - * <property name="ascendingFields"> - * <map> - * <entry key="name" value="java.lang.String"/> - * - * <!-- Nested portable objects can also be indexed. --> - * <entry key="address.zip" value="java.lang.Integer"/> - * </map> - * </property> - * </bean> - * </list> - * </property> - * </bean> - * </pre> - */ -public interface IgniteObjects { - /** - * Gets type ID for given type name. - * - * @param typeName Type name. - * @return Type ID. - */ - public int typeId(String typeName); - - /** - * Converts provided object to instance of {@link org.apache.ignite.binary.BinaryObject}. - * - * @param obj Object to convert. - * @return Converted object. - * @throws org.apache.ignite.binary.BinaryObjectException In case of error. - */ - public <T> T toPortable(@Nullable Object obj) throws BinaryObjectException; - - /** - * Creates new portable builder. - * - * @param typeId ID of the type. - * @return Newly portable builder. - */ - public BinaryObjectBuilder builder(int typeId); - - /** - * Creates new portable builder. - * - * @param typeName Type name. - * @return Newly portable builder. - */ - public BinaryObjectBuilder builder(String typeName); - - /** - * Creates portable builder initialized by existing portable object. - * - * @param portableObj Portable object to initialize builder. - * @return Portable builder. - */ - public BinaryObjectBuilder builder(BinaryObject portableObj); - - /** - * Gets metadata for provided class. - * - * @param cls Class. - * @return Metadata. - * @throws org.apache.ignite.binary.BinaryObjectException In case of error. - */ - @Nullable public BinaryTypeMetadata metadata(Class<?> cls) throws BinaryObjectException; - - /** - * Gets metadata for provided class name. - * - * @param typeName Type name. - * @return Metadata. - * @throws org.apache.ignite.binary.BinaryObjectException In case of error. - */ - @Nullable public BinaryTypeMetadata metadata(String typeName) throws BinaryObjectException; - - /** - * Gets metadata for provided type ID. - * - * @param typeId Type ID. - * @return Metadata. - * @throws org.apache.ignite.binary.BinaryObjectException In case of error. - */ - @Nullable public BinaryTypeMetadata metadata(int typeId) throws BinaryObjectException; - - /** - * Gets metadata for all known types. - * - * @return Metadata. - * @throws org.apache.ignite.binary.BinaryObjectException In case of error. - */ - public Collection<BinaryTypeMetadata> metadata() throws BinaryObjectException; -} http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java index 3a00a77..403871e 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java @@ -23,7 +23,6 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.TreeMap; import org.apache.ignite.marshaller.portable.PortableMarshaller; -import org.jetbrains.annotations.Nullable; /** * Wrapper for portable object in portable binary format. Once an object is defined as portable, @@ -40,7 +39,7 @@ import org.jetbrains.annotations.Nullable; * * // Convert instance of MyKey to portable format. * // We could also use GridPortableBuilder to create the key in portable format directly. - * PortableObject key = grid.portables().toPortable(new MyKey()); + * PortableObject key = grid.binary().toBinary(new MyKey()); * * PortableObject val = prj.get(key); * @@ -77,7 +76,7 @@ import org.jetbrains.annotations.Nullable; * <h1 class="header">Building Portable Objects</h1> * Ignite comes with {@link BinaryObjectBuilder} which allows to build portable objects dynamically: * <pre name=code class=java> - * PortableBuilder builder = Ignition.ignite().portables().builder("org.project.MyObject"); + * PortableBuilder builder = Ignition.ignite().binary().builder("org.project.MyObject"); * * builder.setField("fieldA", "A"); * builder.setField("fieldB", "B"); @@ -93,12 +92,12 @@ import org.jetbrains.annotations.Nullable; * obj.setFieldA("A"); * obj.setFieldB(123); * - * PortableObject portableObj = Ignition.ignite().portables().toPortable(obj); + * PortableObject portableObj = Ignition.ignite().binary().toBinary(obj); * </pre> * <h1 class="header">Portable Metadata</h1> * Even though Ignite portable protocol only works with hash codes for type and field names * to achieve better performance, Ignite provides metadata for all portable types which - * can be queried ar runtime via any of the {@link org.apache.ignite.IgniteObjects#metadata(Class)} + * can be queried ar runtime via any of the {@link org.apache.ignite.IgniteBinary#metadata(Class)} * methods. Having metadata also allows for proper formatting of {@code PortableObject.toString()} method, * even when portable objects are kept in binary format only, which may be necessary for audit reasons. */ @@ -115,8 +114,9 @@ public interface BinaryObject extends Serializable, Cloneable { * * @return Meta data. * @throws BinaryObjectException In case of error. + * TODO ignite-950 rename to type(). */ - @Nullable public BinaryTypeMetadata metaData() throws BinaryObjectException; + public BinaryType metaData() throws BinaryObjectException; /** * Gets field value. @@ -124,11 +124,13 @@ public interface BinaryObject extends Serializable, Cloneable { * @param fieldName Field name. * @return Field value. * @throws BinaryObjectException In case of any other error. + * TODO ignite-950 remove. */ - @Nullable public <F> F field(String fieldName) throws BinaryObjectException; + public <F> F field(String fieldName) throws BinaryObjectException; /** * Checks whether field is set. + ** TODO ignite-950 remove. * * @param fieldName Field name. * @return {@code true} if field is set. @@ -151,7 +153,7 @@ public interface BinaryObject extends Serializable, Cloneable { * @throws BinaryInvalidTypeException If class doesn't exist. * @throws BinaryObjectException In case of any other error. */ - @Nullable public <T> T deserialize() throws BinaryObjectException; + public <T> T deserialize() throws BinaryObjectException; /** * Copies this portable object. http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/BinaryObjectBuilder.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObjectBuilder.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObjectBuilder.java index 014f256..3d1f0af 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObjectBuilder.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObjectBuilder.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable; * <p> * Here is an example of how a portable object can be built dynamically: * <pre name=code class=java> - * PortableBuilder builder = Ignition.ignite().portables().builder("org.project.MyObject"); + * PortableBuilder builder = Ignition.ignite().binary().builder("org.project.MyObject"); * * builder.setField("fieldA", "A"); * builder.setField("fieldB", "B"); @@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable; * Also builder can be initialized by existing portable object. This allows changing some fields without affecting * other fields. * <pre name=code class=java> - * PortableBuilder builder = Ignition.ignite().portables().builder(person); + * PortableBuilder builder = Ignition.ignite().binary().builder(person); * * builder.setField("name", "John"); * @@ -49,7 +49,7 @@ import org.jetbrains.annotations.Nullable; * for example: * * <pre name=code class=java> - * PortableBuilder personBuilder = grid.portables().createBuilder(personPortableObj); + * PortableBuilder personBuilder = grid.binary().createBuilder(personPortableObj); * PortableBuilder addressBuilder = personBuilder.setField("address"); * * addressBuilder.setField("city", "New York"); @@ -60,9 +60,9 @@ import org.jetbrains.annotations.Nullable; * String city = personPortableObj.getField("address").getField("city"); * </pre> * - * @see org.apache.ignite.IgniteObjects#builder(int) - * @see org.apache.ignite.IgniteObjects#builder(String) - * @see org.apache.ignite.IgniteObjects#builder(BinaryObject) + * @see org.apache.ignite.IgniteBinary#builder(int) + * @see org.apache.ignite.IgniteBinary#builder(String) + * @see org.apache.ignite.IgniteBinary#builder(BinaryObject) */ public interface BinaryObjectBuilder { /** http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java ---------------------------------------------------------------------- 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 3881b49..d49330d 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 @@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Date; import java.util.Map; import java.util.UUID; -import org.jetbrains.annotations.Nullable; /** * Reader for portable objects used in {@link Binarylizable} implementations. @@ -99,147 +98,147 @@ public interface BinaryReader { * @return Decimal value. * @throws BinaryObjectException In case of error. */ - @Nullable public BigDecimal readDecimal(String fieldName) throws BinaryObjectException; + public BigDecimal readDecimal(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return String value. * @throws BinaryObjectException In case of error. */ - @Nullable public String readString(String fieldName) throws BinaryObjectException; + public String readString(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return UUID. * @throws BinaryObjectException In case of error. */ - @Nullable public UUID readUuid(String fieldName) throws BinaryObjectException; + public UUID readUuid(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Date. * @throws BinaryObjectException In case of error. */ - @Nullable public Date readDate(String fieldName) throws BinaryObjectException; + public Date readDate(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Timestamp. * @throws BinaryObjectException In case of error. */ - @Nullable public Timestamp readTimestamp(String fieldName) throws BinaryObjectException; + public Timestamp readTimestamp(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Object. * @throws BinaryObjectException In case of error. */ - @Nullable public <T> T readObject(String fieldName) throws BinaryObjectException; + public <T> T readObject(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Byte array. * @throws BinaryObjectException In case of error. */ - @Nullable public byte[] readByteArray(String fieldName) throws BinaryObjectException; + public byte[] readByteArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Short array. * @throws BinaryObjectException In case of error. */ - @Nullable public short[] readShortArray(String fieldName) throws BinaryObjectException; + public short[] readShortArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Integer array. * @throws BinaryObjectException In case of error. */ - @Nullable public int[] readIntArray(String fieldName) throws BinaryObjectException; + public int[] readIntArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Long array. * @throws BinaryObjectException In case of error. */ - @Nullable public long[] readLongArray(String fieldName) throws BinaryObjectException; + public long[] readLongArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Float array. * @throws BinaryObjectException In case of error. */ - @Nullable public float[] readFloatArray(String fieldName) throws BinaryObjectException; + public float[] readFloatArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Byte array. * @throws BinaryObjectException In case of error. */ - @Nullable public double[] readDoubleArray(String fieldName) throws BinaryObjectException; + public double[] readDoubleArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Char array. * @throws BinaryObjectException In case of error. */ - @Nullable public char[] readCharArray(String fieldName) throws BinaryObjectException; + public char[] readCharArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Boolean array. * @throws BinaryObjectException In case of error. */ - @Nullable public boolean[] readBooleanArray(String fieldName) throws BinaryObjectException; + public boolean[] readBooleanArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Decimal array. * @throws BinaryObjectException In case of error. */ - @Nullable public BigDecimal[] readDecimalArray(String fieldName) throws BinaryObjectException; + public BigDecimal[] readDecimalArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return String array. * @throws BinaryObjectException In case of error. */ - @Nullable public String[] readStringArray(String fieldName) throws BinaryObjectException; + public String[] readStringArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return UUID array. * @throws BinaryObjectException In case of error. */ - @Nullable public UUID[] readUuidArray(String fieldName) throws BinaryObjectException; + public UUID[] readUuidArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Date array. * @throws BinaryObjectException In case of error. */ - @Nullable public Date[] readDateArray(String fieldName) throws BinaryObjectException; + public Date[] readDateArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Timestamp array. * @throws BinaryObjectException In case of error. */ - @Nullable public Timestamp[] readTimestampArray(String fieldName) throws BinaryObjectException; + public Timestamp[] readTimestampArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Object array. * @throws BinaryObjectException In case of error. */ - @Nullable public Object[] readObjectArray(String fieldName) throws BinaryObjectException; + public Object[] readObjectArray(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Collection. * @throws BinaryObjectException In case of error. */ - @Nullable public <T> Collection<T> readCollection(String fieldName) throws BinaryObjectException; + public <T> Collection<T> readCollection(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. @@ -247,7 +246,7 @@ public interface BinaryReader { * @return Collection. * @throws BinaryObjectException In case of error. */ - @Nullable public <T> Collection<T> readCollection(String fieldName, Class<? extends Collection<T>> colCls) + public <T> Collection<T> readCollection(String fieldName, Class<? extends Collection<T>> colCls) throws BinaryObjectException; /** @@ -255,7 +254,7 @@ public interface BinaryReader { * @return Map. * @throws BinaryObjectException In case of error. */ - @Nullable public <K, V> Map<K, V> readMap(String fieldName) throws BinaryObjectException; + public <K, V> Map<K, V> readMap(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. @@ -263,7 +262,7 @@ public interface BinaryReader { * @return Map. * @throws BinaryObjectException In case of error. */ - @Nullable public <K, V> Map<K, V> readMap(String fieldName, Class<? extends Map<K, V>> mapCls) + public <K, V> Map<K, V> readMap(String fieldName, Class<? extends Map<K, V>> mapCls) throws BinaryObjectException; /** @@ -271,14 +270,14 @@ public interface BinaryReader { * @return Value. * @throws BinaryObjectException In case of error. */ - @Nullable public <T extends Enum<?>> T readEnum(String fieldName) throws BinaryObjectException; + public <T extends Enum<?>> T readEnum(String fieldName) throws BinaryObjectException; /** * @param fieldName Field name. * @return Value. * @throws BinaryObjectException In case of error. */ - @Nullable public <T extends Enum<?>> T[] readEnumArray(String fieldName) throws BinaryObjectException; + public <T extends Enum<?>> T[] readEnumArray(String fieldName) throws BinaryObjectException; /** * Gets raw reader. Raw reader does not use field name hash codes, therefore, http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java new file mode 100644 index 0000000..8988c9d --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.binary; + +import java.util.Collection; + +/** + * Portable type meta data. Metadata for portable types can be accessed from any of the + * {@link org.apache.ignite.IgniteBinary#metadata(String)} 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. + */ +public interface BinaryType { + /** + * Gets portable type name. + * + * @return Portable type name. + */ + public String typeName(); + + /** + * Gets collection of all field names for this portable type. + * + * @return Collection of all field names for this portable type. + */ + public Collection<String> fields(); + + /** + * Gets name of the field type for a given field. + * + * @param fieldName Field name. + * @return Field type name. + */ + public String fieldTypeName(String fieldName); + + /** + * Portable objects can optionally specify custom key-affinity mapping in the + * configuration. This method returns the name of the field which should be + * used for the key-affinity mapping. + * + * @return Affinity key field name. + */ + public String affinityKeyFieldName(); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java index 1df2c98..3a09a63 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java @@ -41,6 +41,7 @@ public class BinaryTypeConfiguration { private BinarySerializer serializer; /** Meta data enabled flag. */ + // TODO ignite-1282. private Boolean metaDataEnabled; /** Keep deserialized flag. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeMetadata.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeMetadata.java deleted file mode 100644 index 4a1749b..0000000 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeMetadata.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.binary; - -import java.util.Collection; -import org.jetbrains.annotations.Nullable; - -/** - * Portable type meta data. Metadata for portable types can be accessed from any of the - * {@link org.apache.ignite.IgniteObjects#metadata(String)} 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. - */ -public interface BinaryTypeMetadata { - /** - * Gets portable type name. - * - * @return Portable type name. - */ - public String typeName(); - - /** - * Gets collection of all field names for this portable type. - * - * @return Collection of all field names for this portable type. - */ - public Collection<String> fields(); - - /** - * Gets name of the field type for a given field. - * - * @param fieldName Field name. - * @return Field type name. - */ - @Nullable public String fieldTypeName(String fieldName); - - /** - * Portable objects can optionally specify custom key-affinity mapping in the - * configuration. This method returns the name of the field which should be - * used for the key-affinity mapping. - * - * @return Affinity key field name. - */ - @Nullable public String affinityKeyFieldName(); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/binary/Binarylizable.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/Binarylizable.java b/modules/core/src/main/java/org/apache/ignite/binary/Binarylizable.java index b1a511e..d360fb7 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/Binarylizable.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/Binarylizable.java @@ -27,7 +27,7 @@ package org.apache.ignite.binary; * interface, which allows users to override default serialization logic, * usually for performance reasons. The only difference here is that portable * serialization is already very fast and implementing custom serialization - * logic for portables does not provide significant performance gains. + * logic for binary does not provide significant performance gains. */ public interface Binarylizable { /** http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java index fa1aaab..af0122f 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java @@ -883,19 +883,19 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> { * store implementation in some cases, but it can cause performance * degradation due to additional serializations and deserializations * of portable objects. You will also need to have key and value - * classes on all nodes since portables will be deserialized when + * classes on all nodes since binary will be deserialized when * store is called. * - * @return Keep portables in store flag. + * @return Keep binary in store flag. */ public Boolean isKeepPortableInStore() { return keepPortableInStore; } /** - * Sets keep portables in store flag. + * Sets keep binary in store flag. * - * @param keepPortableInStore Keep portables in store flag. + * @param keepPortableInStore Keep binary in store flag. */ public void setKeepPortableInStore(boolean keepPortableInStore) { this.keepPortableInStore = keepPortableInStore; http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index d5a8cc1..ba57415 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -64,7 +64,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteFileSystem; import org.apache.ignite.IgniteLogger; import org.apache.ignite.IgniteMessaging; -import org.apache.ignite.IgniteObjects; +import org.apache.ignite.IgniteBinary; import org.apache.ignite.IgniteQueue; import org.apache.ignite.IgniteScheduler; import org.apache.ignite.IgniteServices; @@ -2769,7 +2769,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { } /** {@inheritDoc} */ - @Override public IgniteObjects portables() { + @Override public IgniteBinary binary() { return ((CacheObjectPortableProcessor)ctx.cacheObjects()).portables(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java ---------------------------------------------------------------------- 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 c907779..e7255f9 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 @@ -414,7 +414,7 @@ public interface GridClientCompute { public GridClientFuture<List<GridClientNode>> refreshTopologyAsync(boolean includeAttrs, boolean includeMetrics); /** - * Sets keep portables flag for the next task execution in the current thread. + * Sets keep binary flag for the next task execution in the current thread. */ public GridClientCompute withKeepPortables(); } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java index fedd15a..8bdb1d0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java @@ -313,7 +313,7 @@ public abstract class GridClientConnection { * @param taskName Task name. * @param arg Task argument. * @param destNodeId Destination node ID. - * @param keepPortables Keep portables flag. + * @param keepPortables 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. http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java ---------------------------------------------------------------------- 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 f1a9af1..dedee10 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 @@ -483,7 +483,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo } /** - * @return Get thread local used to enable keep portables mode. + * @return Get thread local used to enable keep binary mode. */ protected ThreadLocal<Boolean> keepPortablesThreadLocal() { return null; http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java ---------------------------------------------------------------------- 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 eee2858..24c9c70 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 @@ -385,7 +385,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { * * @param msg Message to request, * @param destId Destination node identifier. - * @param keepPortables Keep portables flag. + * @param keepPortables Keep binary flag. * @return Response object. * @throws GridClientConnectionResetException If request failed. * @throws GridClientClosedException If client was closed. @@ -1037,7 +1037,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { /** Flag indicating if connected message is a forwarded. */ private final boolean forward; - /** Keep portables flag. */ + /** Keep binary flag. */ private final boolean keepPortables; /** Pending message for this future. */ @@ -1101,7 +1101,7 @@ public class GridClientNioTcpConnection extends GridClientConnection { } /** - * @return Keep portables flag. + * @return Keep binary flag. */ public boolean keepPortables() { return keepPortables; http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataImpl.java index 30d9d9d..18f538b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataImpl.java @@ -29,7 +29,7 @@ import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.binary.BinaryObjectException; import org.apache.ignite.binary.Binarylizable; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryRawReader; import org.apache.ignite.binary.BinaryRawWriter; import org.apache.ignite.binary.BinaryReader; @@ -39,7 +39,7 @@ import org.jetbrains.annotations.Nullable; /** * Portable meta data implementation. */ -public class BinaryMetaDataImpl implements BinaryTypeMetadata, Binarylizable, Externalizable { +public class BinaryMetaDataImpl implements BinaryType, Binarylizable, Externalizable { /** */ private static final long serialVersionUID = 0L; http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectEx.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectEx.java index 09bc17a..aadaca8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectEx.java @@ -24,7 +24,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory; import org.apache.ignite.internal.util.typedef.internal.SB; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryObject; import org.jetbrains.annotations.Nullable; @@ -160,7 +160,7 @@ public abstract class BinaryObjectEx implements BinaryObject { private String toString(PortableReaderContext ctx, IdentityHashMap<BinaryObject, Integer> handles) { int idHash = System.identityHashCode(this); - BinaryTypeMetadata meta; + BinaryType meta; try { meta = metaData(); @@ -209,7 +209,7 @@ public abstract class BinaryObjectEx implements BinaryObject { Integer idHash0 = handles.get(val); if (idHash0 != null) { // Circular reference. - BinaryTypeMetadata meta0 = po.metaData(); + BinaryType meta0 = po.metaData(); assert meta0 != null; http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java index dc395d5..d533c22 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectImpl.java @@ -30,7 +30,7 @@ import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.plugin.extensions.communication.MessageReader; import org.apache.ignite.plugin.extensions.communication.MessageWriter; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryField; import org.jetbrains.annotations.Nullable; @@ -241,7 +241,7 @@ public final class BinaryObjectImpl extends BinaryObjectEx implements Externaliz } /** {@inheritDoc} */ - @Nullable @Override public BinaryTypeMetadata metaData() throws BinaryObjectException { + @Nullable @Override public BinaryType metaData() throws BinaryObjectException { if (ctx == null) throw new BinaryObjectException("PortableContext is not set for the object."); http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectOffheapImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectOffheapImpl.java index e3f8590..e588a95 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectOffheapImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryObjectOffheapImpl.java @@ -31,7 +31,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.plugin.extensions.communication.MessageReader; import org.apache.ignite.plugin.extensions.communication.MessageWriter; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryField; import org.jetbrains.annotations.Nullable; @@ -148,7 +148,7 @@ public class BinaryObjectOffheapImpl extends BinaryObjectEx implements Externali } /** {@inheritDoc} */ - @Nullable @Override public BinaryTypeMetadata metaData() throws BinaryObjectException { + @Nullable @Override public BinaryType metaData() throws BinaryObjectException { if (ctx == null) throw new BinaryObjectException("PortableContext is not set for the object."); http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java index 7632e2a..dd185ff 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java @@ -56,7 +56,7 @@ import org.apache.ignite.binary.BinaryTypeConfiguration; import org.apache.ignite.binary.BinaryObjectException; import org.apache.ignite.binary.BinaryTypeIdMapper; import org.apache.ignite.binary.BinaryInvalidTypeException; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinarySerializer; import org.apache.ignite.internal.IgniteKernal; import org.apache.ignite.internal.IgnitionEx; @@ -813,7 +813,7 @@ public class PortableContext implements Externalizable { * @return Meta data. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - @Nullable public BinaryTypeMetadata metaData(int typeId) throws BinaryObjectException { + @Nullable public BinaryType metaData(int typeId) throws BinaryObjectException { return metaHnd != null ? metaHnd.metadata(typeId) : null; } http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java index f9f72d2..8b2eef2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.portable; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; /** * Portable meta data handler. @@ -31,7 +31,7 @@ public interface PortableMetaDataHandler { * @param meta Meta data. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - public void addMeta(int typeId, BinaryTypeMetadata meta) throws BinaryObjectException; + public void addMeta(int typeId, BinaryType meta) throws BinaryObjectException; /** * Gets meta data for provided type ID. @@ -40,5 +40,5 @@ public interface PortableMetaDataHandler { * @return Meta data. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ - public BinaryTypeMetadata metadata(int typeId) throws BinaryObjectException; + public BinaryType metadata(int typeId) throws BinaryObjectException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java index 721134e..e6a68c1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java @@ -26,7 +26,7 @@ import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryObjectBuilder; import org.apache.ignite.binary.BinaryObjectException; import org.apache.ignite.binary.BinaryInvalidTypeException; -import org.apache.ignite.binary.BinaryTypeMetadata; +import org.apache.ignite.binary.BinaryType; import org.apache.ignite.internal.portable.BinaryObjectImpl; import org.apache.ignite.internal.portable.BinaryObjectOffheapImpl; import org.apache.ignite.internal.portable.BinaryWriterExImpl; @@ -289,7 +289,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder { if (assignedVals != null && (remainsFlds == null || !remainsFlds.isEmpty())) { boolean metadataEnabled = ctx.isMetaDataEnabled(typeId); - BinaryTypeMetadata metadata = null; + BinaryType metadata = null; if (metadataEnabled) metadata = ctx.metaData(typeId); http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java ---------------------------------------------------------------------- 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 a35b3e1..d49a029 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 @@ -198,7 +198,7 @@ import org.apache.ignite.internal.util.typedef.F; } /** - * Unwraps set with portables. + * Unwraps set with binary. * * @param set Set to unwrap. * @return Unwrapped set. http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index ac67075..e244aa5 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 @@ -1752,7 +1752,7 @@ public class GridCacheContext<K, V> implements Externalizable { } /** - * Unwraps object for portables. + * Unwraps object for binary. * * @param o Object to unwrap. * @param keepPortable Keep portable flag. http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java ---------------------------------------------------------------------- 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 2c9ff14..4155706 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 @@ -231,7 +231,7 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> { * so keys and values will be returned from cache API methods without changes. Therefore, * signature of the projection can contain only following types: * <ul> - * <li><code>org.gridgain.grid.portables.PortableObject</code> for portable classes</li> + * <li><code>org.gridgain.grid.binary.PortableObject</code> for portable classes</li> * <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li> * <li>Arrays of primitives (byte[], int[], ...)</li> * <li>{@link String} and array of {@link String}s</li> http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1daa20/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java index 637e51b..5aace6e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java @@ -353,6 +353,8 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter if (cache == null) return true; + U.debug(">>>> Running global remove all job: " + cache.name()); + final GridCacheContext<K, V> ctx = cache.context(); ctx.gate().enter();
