Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59EAB18962 for ; Wed, 11 Nov 2015 07:44:48 +0000 (UTC) Received: (qmail 28605 invoked by uid 500); 11 Nov 2015 07:44:48 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 28560 invoked by uid 500); 11 Nov 2015 07:44:48 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 28437 invoked by uid 99); 11 Nov 2015 07:44:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 07:44:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C9084E0615; Wed, 11 Nov 2015 07:44:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Wed, 11 Nov 2015 07:44:51 -0000 Message-Id: In-Reply-To: <8e2d4e321e914f3fbbf769db3517d9a2@git.apache.org> References: <8e2d4e321e914f3fbbf769db3517d9a2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [5/7] ignite git commit: IGNITE-1882: Renamed BinaryTypeIdMapper to BinaryIdMapper. IGNITE-1882: Renamed BinaryTypeIdMapper to BinaryIdMapper. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0dc8902c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0dc8902c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0dc8902c Branch: refs/heads/ignite-1847 Commit: 0dc8902ce80f9e27072898aa08a0d00d2f1ae7fd Parents: e7b7829 Author: vozerov-gridgain Authored: Tue Nov 10 16:31:14 2015 +0300 Committer: vozerov-gridgain Committed: Tue Nov 10 16:31:14 2015 +0300 ---------------------------------------------------------------------- .../java/org/apache/ignite/IgniteBinary.java | 2 +- .../apache/ignite/binary/BinaryIdMapper.java | 56 ++++++++++++++++++++ .../org/apache/ignite/binary/BinaryReader.java | 2 +- .../ignite/binary/BinaryTypeConfiguration.java | 6 +-- .../ignite/binary/BinaryTypeIdMapper.java | 56 -------------------- .../org/apache/ignite/binary/BinaryWriter.java | 2 +- .../internal/portable/BinaryReaderExImpl.java | 4 +- .../internal/portable/BinaryWriterExImpl.java | 4 +- .../portable/PortableClassDescriptor.java | 8 +-- .../internal/portable/PortableContext.java | 42 +++++++-------- .../marshaller/portable/PortableMarshaller.java | 8 +-- .../GridBinaryObjectBuilderSelfTest.java | 4 +- .../GridPortableMarshallerSelfTest.java | 26 ++++----- .../portable/GridPortableWildcardsSelfTest.java | 34 ++++++------ 14 files changed, 127 insertions(+), 127 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java index 9c96d3d..364bf4b 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java @@ -254,7 +254,7 @@ import org.jetbrains.annotations.Nullable; *

Custom ID Mappers

* 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. + * you can provide your own {@link org.apache.ignite.binary.BinaryIdMapper} implementation. *

* ID-mapper may be provided either globally in {@link PortableMarshaller}, * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance. http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java new file mode 100644 index 0000000..363b34d --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryIdMapper.java @@ -0,0 +1,56 @@ +/* + * 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 org.apache.ignite.marshaller.portable.PortableMarshaller; + +/** + * Type and field ID mapper for binary objects. Ignite never writes full + * strings for field or type names. Instead, for performance reasons, Ignite + * writes integer hash codes for type and field names. It has been tested that + * hash code conflicts for the type names or the field names + * within the same type are virtually non-existent and, to gain performance, it is safe + * to work with hash codes. For the cases when hash codes for different types or fields + * actually do collide {@code BinaryIdMapper} allows to override the automatically + * generated hash code IDs for the type and field names. + *

+ * Binary ID mapper can be configured for all binary objects via {@link PortableMarshaller#getIdMapper()} method, + * or for a specific binary type via {@link BinaryTypeConfiguration#getIdMapper()} method. + */ +public interface BinaryIdMapper { + /** + * Gets type ID for provided class name. + *

+ * If {@code 0} is returned, hash code of class simple name will be used. + * + * @param clsName Class name. + * @return Type ID. + */ + public int typeId(String clsName); + + /** + * Gets ID for provided field. + *

+ * If {@code 0} is returned, hash code of field name will be used. + * + * @param typeId Type ID. + * @param fieldName Field name. + * @return Field ID. + */ + public int fieldId(int typeId, String fieldName); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/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 8a89a87..b8183a2 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 @@ -33,7 +33,7 @@ import java.util.UUID; * It has been tested that hash code conflicts for the type names or the field names * within the same type are virtually non-existent and, to gain performance, it is safe * to work with hash codes. For the cases when hash codes for different types or fields - * actually do collide, Ignite provides {@link BinaryTypeIdMapper} which + * actually do collide, Ignite provides {@link BinaryIdMapper} which * allows to override the automatically generated hash code IDs for the type and field names. */ public interface BinaryReader { http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/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 ab68efa..c737ee2 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 @@ -35,7 +35,7 @@ public class BinaryTypeConfiguration { private String clsName; /** ID mapper. */ - private BinaryTypeIdMapper idMapper; + private BinaryIdMapper idMapper; /** Serializer. */ private BinarySerializer serializer; @@ -79,7 +79,7 @@ public class BinaryTypeConfiguration { * * @return ID mapper. */ - public BinaryTypeIdMapper getIdMapper() { + public BinaryIdMapper getIdMapper() { return idMapper; } @@ -88,7 +88,7 @@ public class BinaryTypeConfiguration { * * @param idMapper ID mapper. */ - public void setIdMapper(BinaryTypeIdMapper idMapper) { + public void setIdMapper(BinaryIdMapper idMapper) { this.idMapper = idMapper; } http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeIdMapper.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeIdMapper.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeIdMapper.java deleted file mode 100644 index 4825f8c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeIdMapper.java +++ /dev/null @@ -1,56 +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 org.apache.ignite.marshaller.portable.PortableMarshaller; - -/** - * Type and field ID mapper for binary objects. Ignite never writes full - * strings for field or type names. Instead, for performance reasons, Ignite - * writes integer hash codes for type and field names. It has been tested that - * hash code conflicts for the type names or the field names - * within the same type are virtually non-existent and, to gain performance, it is safe - * to work with hash codes. For the cases when hash codes for different types or fields - * actually do collide {@code BinaryTypeIdMapper} allows to override the automatically - * generated hash code IDs for the type and field names. - *

- * Binary ID mapper can be configured for all binary objects via {@link PortableMarshaller#getIdMapper()} method, - * or for a specific binary type via {@link BinaryTypeConfiguration#getIdMapper()} method. - */ -public interface BinaryTypeIdMapper { - /** - * Gets type ID for provided class name. - *

- * If {@code 0} is returned, hash code of class simple name will be used. - * - * @param clsName Class name. - * @return Type ID. - */ - public int typeId(String clsName); - - /** - * Gets ID for provided field. - *

- * If {@code 0} is returned, hash code of field name will be used. - * - * @param typeId Type ID. - * @param fieldName Field name. - * @return Field ID. - */ - public int fieldId(int typeId, String fieldName); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/binary/BinaryWriter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryWriter.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryWriter.java index 0ea4416..b24b206 100644 --- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryWriter.java +++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryWriter.java @@ -34,7 +34,7 @@ import org.jetbrains.annotations.Nullable; * It has been tested that hash code conflicts for the type names or the field names * within the same type are virtually non-existent and, to gain performance, it is safe * to work with hash codes. For the cases when hash codes for different types or fields - * actually do collide, Ignite provides {@link BinaryTypeIdMapper} which + * actually do collide, Ignite provides {@link BinaryIdMapper} which * allows to override the automatically generated hash code IDs for the type and field names. */ public interface BinaryWriter { http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java index 00eb3e1..669ba01 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java @@ -42,7 +42,7 @@ import java.util.concurrent.ConcurrentSkipListSet; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinaryInvalidTypeException; import org.apache.ignite.binary.BinaryRawReader; import org.apache.ignite.binary.BinaryReader; @@ -157,7 +157,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Obje private int footerLen; /** ID mapper. */ - private BinaryTypeIdMapper idMapper; + private BinaryIdMapper idMapper; /** Schema Id. */ private int schemaId; http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java index 6b4d0b5..cedf1c8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryWriterExImpl.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.portable; import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.internal.portable.streams.PortableHeapOutputStream; import org.apache.ignite.internal.portable.streams.PortableOutputStream; import org.apache.ignite.internal.util.typedef.internal.A; @@ -145,7 +145,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje private int fieldCnt; /** ID mapper. */ - private BinaryTypeIdMapper idMapper; + private BinaryIdMapper idMapper; /** * @param ctx Context. http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java index dd04828..c9870b4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableClassDescriptor.java @@ -44,7 +44,7 @@ import java.util.HashSet; import java.util.Map; import java.util.UUID; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.Binarylizable; import org.apache.ignite.binary.BinarySerializer; @@ -65,7 +65,7 @@ public class PortableClassDescriptor { private final BinarySerializer serializer; /** ID mapper. */ - private final BinaryTypeIdMapper idMapper; + private final BinaryIdMapper idMapper; /** */ private final Mode mode; @@ -126,7 +126,7 @@ public class PortableClassDescriptor { boolean userType, int typeId, String typeName, - @Nullable BinaryTypeIdMapper idMapper, + @Nullable BinaryIdMapper idMapper, @Nullable BinarySerializer serializer, boolean metaDataEnabled, boolean keepDeserialized, @@ -323,7 +323,7 @@ public class PortableClassDescriptor { * * @return ID mapper. */ - public BinaryTypeIdMapper idMapper() { + public BinaryIdMapper idMapper() { return idMapper; } http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/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 54a180b..f779706 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 @@ -54,7 +54,7 @@ import org.apache.ignite.cache.CacheKeyConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.binary.BinaryTypeConfiguration; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinaryInvalidTypeException; import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinarySerializer; @@ -85,10 +85,10 @@ public class PortableContext implements Externalizable { private static final ClassLoader dfltLdr = U.gridClassLoader(); /** */ - static final BinaryTypeIdMapper DFLT_ID_MAPPER = new IdMapperWrapper(null); + static final BinaryIdMapper DFLT_ID_MAPPER = new IdMapperWrapper(null); /** */ - static final BinaryTypeIdMapper BASIC_CLS_ID_MAPPER = new BasicClassIdMapper(); + static final BinaryIdMapper BASIC_CLS_ID_MAPPER = new BasicClassIdMapper(); /** */ static final char[] LOWER_CASE_CHARS; @@ -128,10 +128,10 @@ public class PortableContext implements Externalizable { private final Map, Byte> mapTypes = new HashMap<>(); /** */ - private final ConcurrentMap mappers = new ConcurrentHashMap8<>(0); + private final ConcurrentMap mappers = new ConcurrentHashMap8<>(0); /** */ - private final Map typeMappers = new ConcurrentHashMap8<>(0); + private final Map typeMappers = new ConcurrentHashMap8<>(0); /** */ private PortableMetaDataHandler metaHnd; @@ -276,7 +276,7 @@ public class PortableContext implements Externalizable { * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ private void configure( - BinaryTypeIdMapper globalIdMapper, + BinaryIdMapper globalIdMapper, BinarySerializer globalSerializer, boolean globalKeepDeserialized, Collection clsNames, @@ -285,7 +285,7 @@ public class PortableContext implements Externalizable { TypeDescriptors descs = new TypeDescriptors(); if (clsNames != null) { - BinaryTypeIdMapper idMapper = new IdMapperWrapper(globalIdMapper); + BinaryIdMapper idMapper = new IdMapperWrapper(globalIdMapper); for (String clsName : clsNames) { if (clsName.endsWith(".*")) { // Package wildcard @@ -313,7 +313,7 @@ public class PortableContext implements Externalizable { if (clsName == null) throw new BinaryObjectException("Class name is required for portable type configuration."); - BinaryTypeIdMapper idMapper = globalIdMapper; + BinaryIdMapper idMapper = globalIdMapper; if (typeCfg.getIdMapper() != null) idMapper = typeCfg.getIdMapper(); @@ -537,7 +537,7 @@ public class PortableContext implements Externalizable { String typeName = typeName(cls.getName()); - BinaryTypeIdMapper idMapper = userTypeIdMapper(typeName); + BinaryIdMapper idMapper = userTypeIdMapper(typeName); int typeId = idMapper.typeId(typeName); @@ -635,8 +635,8 @@ public class PortableContext implements Externalizable { * @param typeId Type ID. * @return Instance of ID mapper. */ - public BinaryTypeIdMapper userTypeIdMapper(int typeId) { - BinaryTypeIdMapper idMapper = mappers.get(typeId); + public BinaryIdMapper userTypeIdMapper(int typeId) { + BinaryIdMapper idMapper = mappers.get(typeId); if (idMapper != null) return idMapper; @@ -651,8 +651,8 @@ public class PortableContext implements Externalizable { * @param typeName Type name. * @return Instance of ID mapper. */ - private BinaryTypeIdMapper userTypeIdMapper(String typeName) { - BinaryTypeIdMapper idMapper = typeMappers.get(typeName); + private BinaryIdMapper userTypeIdMapper(String typeName) { + BinaryIdMapper idMapper = typeMappers.get(typeName); return idMapper != null ? idMapper : DFLT_ID_MAPPER; } @@ -725,7 +725,7 @@ public class PortableContext implements Externalizable { */ @SuppressWarnings("ErrorNotRethrown") public void registerUserType(String clsName, - BinaryTypeIdMapper idMapper, + BinaryIdMapper idMapper, @Nullable BinarySerializer serializer, @Nullable String affKeyFieldName, boolean keepDeserialized) @@ -958,14 +958,14 @@ public class PortableContext implements Externalizable { /** */ - private static class IdMapperWrapper implements BinaryTypeIdMapper { + private static class IdMapperWrapper implements BinaryIdMapper { /** */ - private final BinaryTypeIdMapper mapper; + private final BinaryIdMapper mapper; /** * @param mapper Custom ID mapper. */ - private IdMapperWrapper(@Nullable BinaryTypeIdMapper mapper) { + private IdMapperWrapper(@Nullable BinaryIdMapper mapper) { this.mapper = mapper; } @@ -993,7 +993,7 @@ public class PortableContext implements Externalizable { /** * Basic class ID mapper. */ - private static class BasicClassIdMapper implements BinaryTypeIdMapper { + private static class BasicClassIdMapper implements BinaryIdMapper { /** {@inheritDoc} */ @Override public int typeId(String clsName) { return clsName.hashCode(); @@ -1024,7 +1024,7 @@ public class PortableContext implements Externalizable { * @throws org.apache.ignite.binary.BinaryObjectException If failed. */ private void add(String clsName, - BinaryTypeIdMapper idMapper, + BinaryIdMapper idMapper, BinarySerializer serializer, String affKeyFieldName, boolean keepDeserialized, @@ -1063,7 +1063,7 @@ public class PortableContext implements Externalizable { private final String clsName; /** ID mapper. */ - private BinaryTypeIdMapper idMapper; + private BinaryIdMapper idMapper; /** Serializer. */ private BinarySerializer serializer; @@ -1087,7 +1087,7 @@ public class PortableContext implements Externalizable { * @param keepDeserialized Keep deserialized flag. * @param canOverride Whether this descriptor can be override. */ - private TypeDescriptor(String clsName, BinaryTypeIdMapper idMapper, BinarySerializer serializer, + private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer serializer, String affKeyFieldName, boolean keepDeserialized, boolean canOverride) { this.clsName = clsName; this.idMapper = idMapper; http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java index 2bbf9f8..409a893 100644 --- a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java +++ b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java @@ -30,7 +30,7 @@ import org.apache.ignite.marshaller.AbstractMarshaller; import org.apache.ignite.marshaller.MarshallerContext; import org.apache.ignite.binary.BinaryTypeConfiguration; import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinarySerializer; import org.jetbrains.annotations.Nullable; @@ -79,7 +79,7 @@ public class PortableMarshaller extends AbstractMarshaller { private Collection clsNames; /** ID mapper. */ - private BinaryTypeIdMapper idMapper; + private BinaryIdMapper idMapper; /** Serializer. */ private BinarySerializer serializer; @@ -119,7 +119,7 @@ public class PortableMarshaller extends AbstractMarshaller { * * @return ID mapper. */ - public BinaryTypeIdMapper getIdMapper() { + public BinaryIdMapper getIdMapper() { return idMapper; } @@ -128,7 +128,7 @@ public class PortableMarshaller extends AbstractMarshaller { * * @param idMapper ID mapper. */ - public void setIdMapper(BinaryTypeIdMapper idMapper) { + public void setIdMapper(BinaryIdMapper idMapper) { this.idMapper = idMapper; } http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/test/java/org/apache/ignite/internal/portable/GridBinaryObjectBuilderSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridBinaryObjectBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridBinaryObjectBuilderSelfTest.java index c697510..ccebd73 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridBinaryObjectBuilderSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridBinaryObjectBuilderSelfTest.java @@ -41,7 +41,7 @@ import org.apache.ignite.internal.util.GridUnsafe; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.marshaller.portable.PortableMarshaller; import org.apache.ignite.binary.BinaryObjectBuilder; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryTypeConfiguration; @@ -71,7 +71,7 @@ public class GridBinaryObjectBuilderSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customIdMapper = new BinaryTypeConfiguration(); customIdMapper.setClassName(CustomIdMapper.class.getName()); - customIdMapper.setIdMapper(new BinaryTypeIdMapper() { + customIdMapper.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return ~PortableContext.DFLT_ID_MAPPER.typeId(clsName); } http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java index ea96842..b5a24b1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerSelfTest.java @@ -50,7 +50,7 @@ import org.apache.ignite.binary.BinaryReader; import org.apache.ignite.binary.BinarySerializer; import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryTypeConfiguration; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinaryWriter; import org.apache.ignite.binary.Binarylizable; import org.apache.ignite.configuration.IgniteConfiguration; @@ -800,7 +800,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration type = new BinaryTypeConfiguration(CustomMappedObject1.class.getName()); - type.setIdMapper(new BinaryTypeIdMapper() { + type.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 11111; } @@ -839,7 +839,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { public void testCustomIdMapperWithGlobal() throws Exception { PortableMarshaller marsh = new PortableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 11111; } @@ -861,7 +861,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration type2 = new BinaryTypeConfiguration(CustomMappedObject2.class.getName()); - type2.setIdMapper(new BinaryTypeIdMapper() { + type2.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 44444; } @@ -1078,7 +1078,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customMappingType = new BinaryTypeConfiguration(TestBinary.class.getName()); - customMappingType.setIdMapper(new BinaryTypeIdMapper() { + customMappingType.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { String typeName; @@ -1132,7 +1132,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); - customType1.setIdMapper(new BinaryTypeIdMapper() { + customType1.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 300; } @@ -1144,7 +1144,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType2 = new BinaryTypeConfiguration("org.gridgain.NonExistentClass1"); - customType2.setIdMapper(new BinaryTypeIdMapper() { + customType2.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 400; } @@ -1156,7 +1156,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType3 = new BinaryTypeConfiguration("NonExistentClass2"); - customType3.setIdMapper(new BinaryTypeIdMapper() { + customType3.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 500; } @@ -1168,7 +1168,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType4 = new BinaryTypeConfiguration("NonExistentClass5"); - customType4.setIdMapper(new BinaryTypeIdMapper() { + customType4.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 0; } @@ -1208,7 +1208,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration(Value.class.getName()); - customType1.setIdMapper(new BinaryTypeIdMapper() { + customType1.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 300; } @@ -1229,7 +1229,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType2 = new BinaryTypeConfiguration("NonExistentClass1"); - customType2.setIdMapper(new BinaryTypeIdMapper() { + customType2.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 400; } @@ -1274,7 +1274,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType1 = new BinaryTypeConfiguration("org.gridgain.Class1"); - customType1.setIdMapper(new BinaryTypeIdMapper() { + customType1.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 100; } @@ -1286,7 +1286,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration customType2 = new BinaryTypeConfiguration("org.gridgain.Class2"); - customType2.setIdMapper(new BinaryTypeIdMapper() { + customType2.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 100; } http://git-wip-us.apache.org/repos/asf/ignite/blob/0dc8902c/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java index 22125af..7522bf9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableWildcardsSelfTest.java @@ -23,7 +23,7 @@ import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.marshaller.MarshallerContextTestImpl; import org.apache.ignite.marshaller.portable.PortableMarshaller; -import org.apache.ignite.binary.BinaryTypeIdMapper; +import org.apache.ignite.binary.BinaryIdMapper; import org.apache.ignite.binary.BinaryType; import org.apache.ignite.binary.BinaryTypeConfiguration; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; @@ -92,7 +92,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { PortableMarshaller marsh = portableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @SuppressWarnings("IfMayBeConditional") @Override public int typeId(String clsName) { if (clsName.endsWith("1")) @@ -117,7 +117,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { ctx.configure(marsh); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size()); @@ -158,7 +158,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { PortableMarshaller marsh = portableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @SuppressWarnings("IfMayBeConditional") @Override public int typeId(String clsName) { if (clsName.endsWith("1")) @@ -183,7 +183,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { ctx.configure(marsh); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size()); @@ -200,7 +200,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { PortableMarshaller marsh = portableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @SuppressWarnings("IfMayBeConditional") @Override public int typeId(String clsName) { if (clsName.endsWith("1")) @@ -225,7 +225,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { ctx.configure(marsh); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size()); @@ -249,7 +249,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration(); typeCfg.setClassName("org.apache.ignite.internal.portable.test.GridPortableTestClass2"); - typeCfg.setIdMapper(new BinaryTypeIdMapper() { + typeCfg.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 100; } @@ -271,7 +271,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { assertTrue(typeIds.containsKey("innerclass".hashCode())); assertFalse(typeIds.containsKey("gridportabletestclass2".hashCode())); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2")); } @@ -307,7 +307,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { PortableMarshaller marsh = portableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @SuppressWarnings("IfMayBeConditional") @Override public int typeId(String clsName) { if (clsName.endsWith("1")) @@ -330,7 +330,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { ctx.configure(marsh); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size()); @@ -369,7 +369,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { PortableMarshaller marsh = portableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @SuppressWarnings("IfMayBeConditional") @Override public int typeId(String clsName) { if (clsName.endsWith("1")) @@ -392,7 +392,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { ctx.configure(marsh); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size()); @@ -408,7 +408,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { PortableMarshaller marsh = portableMarshaller(); - marsh.setIdMapper(new BinaryTypeIdMapper() { + marsh.setIdMapper(new BinaryIdMapper() { @SuppressWarnings("IfMayBeConditional") @Override public int typeId(String clsName) { if (clsName.endsWith("1")) @@ -431,7 +431,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { ctx.configure(marsh); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size()); @@ -454,7 +454,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration( "org.apache.ignite.portable.testjar.GridPortableTestClass2"); - typeCfg.setIdMapper(new BinaryTypeIdMapper() { + typeCfg.setIdMapper(new BinaryIdMapper() { @Override public int typeId(String clsName) { return 100; } @@ -474,7 +474,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest { assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode())); - Map typeMappers = U.field(ctx, "typeMappers"); + Map typeMappers = U.field(ctx, "typeMappers"); assertEquals(3, typeMappers.size());