IGNITE-1847: GIT failed to change class name casing (1/2).
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a0efe760 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a0efe760 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a0efe760 Branch: refs/heads/ignite-1753-1282 Commit: a0efe76068eb6c802e5c228d9b5734722b82f5ad Parents: 63d5506 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Wed Nov 18 10:30:11 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Wed Nov 18 10:30:11 2015 +0300 ---------------------------------------------------------------------- .../portable/BinaryMetaDataCollector.java | 254 ------------------- .../portable/BinaryMetadataCollector2.java | 254 +++++++++++++++++++ .../portable/PortableClassDescriptor.java | 2 +- .../CacheObjectBinaryProcessorImpl.java | 44 ++-- .../cache/portable/PortableMetaDataKey.java | 82 ------ .../cache/portable/PortableMetadataKey2.java | 82 ++++++ 6 files changed, 359 insertions(+), 359 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/a0efe760/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataCollector.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataCollector.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataCollector.java deleted file mode 100644 index 67e1a0d..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetaDataCollector.java +++ /dev/null @@ -1,254 +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.internal.portable; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryRawWriter; -import org.apache.ignite.binary.BinaryWriter; -import org.jetbrains.annotations.Nullable; - -/** - * Writer for meta data collection. - */ -class BinaryMetadataCollector implements BinaryWriter { - /** */ - private final Map<String, Integer> meta = new HashMap<>(); - - /** */ - private final String typeName; - - /** - * @param typeName Type name. - */ - BinaryMetadataCollector(String typeName) { - this.typeName = typeName; - } - - /** - * @return Field meta data. - */ - Map<String, Integer> meta() { - return meta; - } - - /** {@inheritDoc} */ - @Override public void writeByte(String fieldName, byte val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.BYTE); - } - - /** {@inheritDoc} */ - @Override public void writeShort(String fieldName, short val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.SHORT); - } - - /** {@inheritDoc} */ - @Override public void writeInt(String fieldName, int val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.INT); - } - - /** {@inheritDoc} */ - @Override public void writeLong(String fieldName, long val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.LONG); - } - - /** {@inheritDoc} */ - @Override public void writeFloat(String fieldName, float val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.FLOAT); - } - - /** {@inheritDoc} */ - @Override public void writeDouble(String fieldName, double val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.DOUBLE); - } - - /** {@inheritDoc} */ - @Override public void writeChar(String fieldName, char val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.CHAR); - } - - /** {@inheritDoc} */ - @Override public void writeBoolean(String fieldName, boolean val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.BOOLEAN); - } - - /** {@inheritDoc} */ - @Override public void writeDecimal(String fieldName, @Nullable BigDecimal val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.DECIMAL); - } - - /** {@inheritDoc} */ - @Override public void writeString(String fieldName, @Nullable String val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.STRING); - } - - /** {@inheritDoc} */ - @Override public void writeUuid(String fieldName, @Nullable UUID val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.UUID); - } - - /** {@inheritDoc} */ - @Override public void writeDate(String fieldName, @Nullable Date val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.DATE); - } - - /** {@inheritDoc} */ - @Override public void writeTimestamp(String fieldName, @Nullable Timestamp val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.TIMESTAMP); - } - - /** {@inheritDoc} */ - @Override public <T extends Enum<?>> void writeEnum(String fieldName, T val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.ENUM); - } - - /** {@inheritDoc} */ - @Override public <T extends Enum<?>> void writeEnumArray(String fieldName, T[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.ENUM_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeObject(String fieldName, @Nullable Object obj) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.OBJECT); - } - - /** {@inheritDoc} */ - @Override public void writeByteArray(String fieldName, @Nullable byte[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.BYTE_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeShortArray(String fieldName, @Nullable short[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.SHORT_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeIntArray(String fieldName, @Nullable int[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.INT_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeLongArray(String fieldName, @Nullable long[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.LONG_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeFloatArray(String fieldName, @Nullable float[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.FLOAT_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeDoubleArray(String fieldName, @Nullable double[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.DOUBLE_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeCharArray(String fieldName, @Nullable char[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.CHAR_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeBooleanArray(String fieldName, @Nullable boolean[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.BOOLEAN_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeDecimalArray(String fieldName, @Nullable BigDecimal[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.DECIMAL_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeStringArray(String fieldName, @Nullable String[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.STRING_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeUuidArray(String fieldName, @Nullable UUID[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.UUID_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeDateArray(String fieldName, @Nullable Date[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.DATE_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeTimestampArray(String fieldName, @Nullable Timestamp[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.TIMESTAMP_ARR); - } - - /** {@inheritDoc} */ - @Override public void writeObjectArray(String fieldName, @Nullable Object[] val) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.OBJECT_ARR); - } - - /** {@inheritDoc} */ - @Override public <T> void writeCollection(String fieldName, @Nullable Collection<T> col) - throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.COL); - } - - /** {@inheritDoc} */ - @Override public <K, V> void writeMap(String fieldName, @Nullable Map<K, V> map) throws BinaryObjectException { - add(fieldName, PortableClassDescriptor.Mode.MAP); - } - - /** {@inheritDoc} */ - @Override public BinaryRawWriter rawWriter() { - return (BinaryRawWriter)Proxy.newProxyInstance(getClass().getClassLoader(), - new Class<?>[] { BinaryRawWriterEx.class }, - new InvocationHandler() { - @Override public Object invoke(Object proxy, Method mtd, Object[] args) throws Throwable { - return null; - } - }); - } - - /** - * @param name Field name. - * @param mode Field mode. - * @throws BinaryObjectException In case of error. - */ - private void add(String name, PortableClassDescriptor.Mode mode) throws BinaryObjectException { - assert name != null; - - int fieldTypeId = mode.typeId(); - - Integer oldFieldTypeId = meta.put(name, fieldTypeId); - - if (oldFieldTypeId != null && !oldFieldTypeId.equals(fieldTypeId)) { - throw new BinaryObjectException( - "Field is written twice with different types [" + - "typeName=" + typeName + - ", fieldName=" + name + - ", fieldTypeName1=" + PortableUtils.fieldTypeName(oldFieldTypeId) + - ", fieldTypeName2=" + PortableUtils.fieldTypeName(fieldTypeId) + - ']' - ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/a0efe760/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetadataCollector2.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetadataCollector2.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetadataCollector2.java new file mode 100644 index 0000000..701c619 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetadataCollector2.java @@ -0,0 +1,254 @@ +/* + * 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.internal.portable; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.apache.ignite.binary.BinaryObjectException; +import org.apache.ignite.binary.BinaryRawWriter; +import org.apache.ignite.binary.BinaryWriter; +import org.jetbrains.annotations.Nullable; + +/** + * Writer for meta data collection. + */ +class BinaryMetadataCollector2 implements BinaryWriter { + /** */ + private final Map<String, Integer> meta = new HashMap<>(); + + /** */ + private final String typeName; + + /** + * @param typeName Type name. + */ + BinaryMetadataCollector2(String typeName) { + this.typeName = typeName; + } + + /** + * @return Field meta data. + */ + Map<String, Integer> meta() { + return meta; + } + + /** {@inheritDoc} */ + @Override public void writeByte(String fieldName, byte val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.BYTE); + } + + /** {@inheritDoc} */ + @Override public void writeShort(String fieldName, short val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.SHORT); + } + + /** {@inheritDoc} */ + @Override public void writeInt(String fieldName, int val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.INT); + } + + /** {@inheritDoc} */ + @Override public void writeLong(String fieldName, long val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.LONG); + } + + /** {@inheritDoc} */ + @Override public void writeFloat(String fieldName, float val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.FLOAT); + } + + /** {@inheritDoc} */ + @Override public void writeDouble(String fieldName, double val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.DOUBLE); + } + + /** {@inheritDoc} */ + @Override public void writeChar(String fieldName, char val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.CHAR); + } + + /** {@inheritDoc} */ + @Override public void writeBoolean(String fieldName, boolean val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.BOOLEAN); + } + + /** {@inheritDoc} */ + @Override public void writeDecimal(String fieldName, @Nullable BigDecimal val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.DECIMAL); + } + + /** {@inheritDoc} */ + @Override public void writeString(String fieldName, @Nullable String val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.STRING); + } + + /** {@inheritDoc} */ + @Override public void writeUuid(String fieldName, @Nullable UUID val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.UUID); + } + + /** {@inheritDoc} */ + @Override public void writeDate(String fieldName, @Nullable Date val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.DATE); + } + + /** {@inheritDoc} */ + @Override public void writeTimestamp(String fieldName, @Nullable Timestamp val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.TIMESTAMP); + } + + /** {@inheritDoc} */ + @Override public <T extends Enum<?>> void writeEnum(String fieldName, T val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.ENUM); + } + + /** {@inheritDoc} */ + @Override public <T extends Enum<?>> void writeEnumArray(String fieldName, T[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.ENUM_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeObject(String fieldName, @Nullable Object obj) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.OBJECT); + } + + /** {@inheritDoc} */ + @Override public void writeByteArray(String fieldName, @Nullable byte[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.BYTE_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeShortArray(String fieldName, @Nullable short[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.SHORT_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeIntArray(String fieldName, @Nullable int[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.INT_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeLongArray(String fieldName, @Nullable long[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.LONG_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeFloatArray(String fieldName, @Nullable float[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.FLOAT_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeDoubleArray(String fieldName, @Nullable double[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.DOUBLE_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeCharArray(String fieldName, @Nullable char[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.CHAR_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeBooleanArray(String fieldName, @Nullable boolean[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.BOOLEAN_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeDecimalArray(String fieldName, @Nullable BigDecimal[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.DECIMAL_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeStringArray(String fieldName, @Nullable String[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.STRING_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeUuidArray(String fieldName, @Nullable UUID[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.UUID_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeDateArray(String fieldName, @Nullable Date[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.DATE_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeTimestampArray(String fieldName, @Nullable Timestamp[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.TIMESTAMP_ARR); + } + + /** {@inheritDoc} */ + @Override public void writeObjectArray(String fieldName, @Nullable Object[] val) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.OBJECT_ARR); + } + + /** {@inheritDoc} */ + @Override public <T> void writeCollection(String fieldName, @Nullable Collection<T> col) + throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.COL); + } + + /** {@inheritDoc} */ + @Override public <K, V> void writeMap(String fieldName, @Nullable Map<K, V> map) throws BinaryObjectException { + add(fieldName, PortableClassDescriptor.Mode.MAP); + } + + /** {@inheritDoc} */ + @Override public BinaryRawWriter rawWriter() { + return (BinaryRawWriter)Proxy.newProxyInstance(getClass().getClassLoader(), + new Class<?>[] { BinaryRawWriterEx.class }, + new InvocationHandler() { + @Override public Object invoke(Object proxy, Method mtd, Object[] args) throws Throwable { + return null; + } + }); + } + + /** + * @param name Field name. + * @param mode Field mode. + * @throws BinaryObjectException In case of error. + */ + private void add(String name, PortableClassDescriptor.Mode mode) throws BinaryObjectException { + assert name != null; + + int fieldTypeId = mode.typeId(); + + Integer oldFieldTypeId = meta.put(name, fieldTypeId); + + if (oldFieldTypeId != null && !oldFieldTypeId.equals(fieldTypeId)) { + throw new BinaryObjectException( + "Field is written twice with different types [" + + "typeName=" + typeName + + ", fieldName=" + name + + ", fieldTypeName1=" + PortableUtils.fieldTypeName(oldFieldTypeId) + + ", fieldTypeName2=" + PortableUtils.fieldTypeName(fieldTypeId) + + ']' + ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/a0efe760/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 225e0ba..7fa6bc3 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 @@ -546,7 +546,7 @@ public class PortableClassDescriptor { if (obj.getClass() != BinaryMetadata.class && ctx.isMetaDataChanged(typeId, writer.metaDataHashSum())) { - BinaryMetadataCollector metaCollector = new BinaryMetadataCollector(typeName); + BinaryMetadataCollector2 metaCollector = new BinaryMetadataCollector2(typeName); if (serializer != null) serializer.writeBinary(obj, metaCollector); http://git-wip-us.apache.org/repos/asf/ignite/blob/a0efe760/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java index 117eece..e6eb494 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectBinaryProcessorImpl.java @@ -110,7 +110,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm private final boolean clientNode; /** */ - private volatile IgniteCacheProxy<PortableMetadataKey, BinaryMetadata> metaDataCache; + private volatile IgniteCacheProxy<PortableMetadataKey2, BinaryMetadata> metaDataCache; /** */ private final ConcurrentHashMap8<Integer, BinaryTypeImpl> clientMetaDataCache; @@ -120,7 +120,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm private static final long serialVersionUID = 0L; @Override public boolean apply(GridCacheEntryEx e) { - return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey; + return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey2; } }; @@ -238,7 +238,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm GridCacheQueryManager qryMgr = metaDataCache.context().queries(); - CacheQuery<Map.Entry<PortableMetadataKey, BinaryMetadata>> qry = + CacheQuery<Map.Entry<PortableMetadataKey2, BinaryMetadata>> qry = qryMgr.createScanQuery(new MetaDataPredicate(), null, false); qry.keepAll(false); @@ -246,9 +246,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm qry.projection(ctx.cluster().get().forNode(oldestSrvNode)); try { - CacheQueryFuture<Map.Entry<PortableMetadataKey, BinaryMetadata>> fut = qry.execute(); + CacheQueryFuture<Map.Entry<PortableMetadataKey2, BinaryMetadata>> fut = qry.execute(); - Map.Entry<PortableMetadataKey, BinaryMetadata> next; + Map.Entry<PortableMetadataKey2, BinaryMetadata> next; while ((next = fut.next()) != null) { assert next.getKey() != null : next; @@ -294,7 +294,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm * @param key Metadata key. * @param newMeta Metadata. */ - private void addClientCacheMetaData(PortableMetadataKey key, final BinaryMetadata newMeta) { + private void addClientCacheMetaData(PortableMetadataKey2 key, final BinaryMetadata newMeta) { int key0 = key.typeId(); clientMetaDataCache.compute(key0, @@ -460,7 +460,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm BinaryMetadata newMeta0 = ((BinaryTypeImpl)newMeta).metadata(); - final PortableMetadataKey key = new PortableMetadataKey(typeId); + final PortableMetadataKey2 key = new PortableMetadataKey2(typeId); try { BinaryMetadata oldMeta = metaDataCache.localPeek(key); @@ -483,7 +483,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm if (clientNode) return clientMetaDataCache.get(typeId); else { - BinaryMetadata meta = metaDataCache.localPeek(new PortableMetadataKey(typeId)); + BinaryMetadata meta = metaDataCache.localPeek(new PortableMetadataKey2(typeId)); return meta != null ? meta.wrap(portableCtx) : null; } @@ -497,16 +497,16 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm @Override public Map<Integer, BinaryType> metadata(Collection<Integer> typeIds) throws BinaryObjectException { try { - Collection<PortableMetadataKey> keys = new ArrayList<>(typeIds.size()); + Collection<PortableMetadataKey2> keys = new ArrayList<>(typeIds.size()); for (Integer typeId : typeIds) - keys.add(new PortableMetadataKey(typeId)); + keys.add(new PortableMetadataKey2(typeId)); - Map<PortableMetadataKey, BinaryMetadata> meta = metaDataCache.getAll(keys); + Map<PortableMetadataKey2, BinaryMetadata> meta = metaDataCache.getAll(keys); Map<Integer, BinaryType> res = U.newHashMap(meta.size()); - for (Map.Entry<PortableMetadataKey, BinaryMetadata> e : meta.entrySet()) + for (Map.Entry<PortableMetadataKey2, BinaryMetadata> e : meta.entrySet()) res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx)); return res; @@ -527,10 +527,10 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm }); else { return F.viewReadOnly(metaDataCache.entrySetx(metaPred), - new C1<Cache.Entry<PortableMetadataKey, BinaryMetadata>, BinaryType>() { + new C1<Cache.Entry<PortableMetadataKey2, BinaryMetadata>, BinaryType>() { private static final long serialVersionUID = 0L; - @Override public BinaryType apply(Cache.Entry<PortableMetadataKey, BinaryMetadata> e) { + @Override public BinaryType apply(Cache.Entry<PortableMetadataKey2, BinaryMetadata> e) { return e.getValue().wrap(portableCtx); } }); @@ -799,7 +799,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** */ private static class MetaDataProcessor implements - EntryProcessor<PortableMetadataKey, BinaryMetadata, BinaryObjectException>, Externalizable { + EntryProcessor<PortableMetadataKey2, BinaryMetadata, BinaryObjectException>, Externalizable { /** */ private static final long serialVersionUID = 0L; @@ -829,7 +829,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** {@inheritDoc} */ @Override public BinaryObjectException process( - MutableEntry<PortableMetadataKey, BinaryMetadata> entry, + MutableEntry<PortableMetadataKey2, BinaryMetadata> entry, Object... args) { try { BinaryMetadata oldMeta = entry.getValue(); @@ -873,15 +873,15 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** * */ - class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey, BinaryMetadata> { + class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey2, BinaryMetadata> { /** {@inheritDoc} */ @Override public void onUpdated( - Iterable<CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata>> evts) + Iterable<CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata>> evts) throws CacheEntryListenerException { - for (CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata> evt : evts) { + for (CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata> evt : evts) { assert evt.getEventType() == EventType.CREATED || evt.getEventType() == EventType.UPDATED : evt; - PortableMetadataKey key = evt.getKey(); + PortableMetadataKey2 key = evt.getKey(); final BinaryMetadata newMeta = evt.getValue(); @@ -906,7 +906,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** {@inheritDoc} */ @Override public boolean evaluate(CacheEntryEvent<?, ?> evt) throws CacheEntryListenerException { - return evt.getKey() instanceof PortableMetadataKey; + return evt.getKey() instanceof PortableMetadataKey2; } /** {@inheritDoc} */ @@ -924,7 +924,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm /** {@inheritDoc} */ @Override public boolean apply(Object key, Object val) { - return key instanceof PortableMetadataKey; + return key instanceof PortableMetadataKey2; } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/a0efe760/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java deleted file mode 100644 index f838c82..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetaDataKey.java +++ /dev/null @@ -1,82 +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.internal.processors.cache.portable; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey; -import org.apache.ignite.internal.util.typedef.internal.S; - -/** - * Key for portable meta data. - */ -class PortableMetadataKey extends GridCacheUtilityKey<PortableMetadataKey> implements Externalizable { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private int typeId; - - /** - * For {@link Externalizable}. - */ - public PortableMetadataKey() { - // No-op. - } - - /** - * @param typeId Type ID. - */ - PortableMetadataKey(int typeId) { - this.typeId = typeId; - } - - /** - * @return Type id. - */ - public int typeId() { - return typeId; - } - - /** {@inheritDoc} */ - @Override public void writeExternal(ObjectOutput out) throws IOException { - out.writeInt(typeId); - } - - /** {@inheritDoc} */ - @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - typeId = in.readInt(); - } - - /** {@inheritDoc} */ - @Override protected boolean equalsx(PortableMetadataKey key) { - return typeId == key.typeId; - } - - /** {@inheritDoc} */ - @Override public int hashCode() { - return typeId; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(PortableMetadataKey.class, this); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/a0efe760/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java new file mode 100644 index 0000000..4c99b70 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.java @@ -0,0 +1,82 @@ +/* + * 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.internal.processors.cache.portable; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey; +import org.apache.ignite.internal.util.typedef.internal.S; + +/** + * Key for portable meta data. + */ +class PortableMetadataKey2 extends GridCacheUtilityKey<PortableMetadataKey2> implements Externalizable { + /** */ + private static final long serialVersionUID = 0L; + + /** */ + private int typeId; + + /** + * For {@link Externalizable}. + */ + public PortableMetadataKey2() { + // No-op. + } + + /** + * @param typeId Type ID. + */ + PortableMetadataKey2(int typeId) { + this.typeId = typeId; + } + + /** + * @return Type id. + */ + public int typeId() { + return typeId; + } + + /** {@inheritDoc} */ + @Override public void writeExternal(ObjectOutput out) throws IOException { + out.writeInt(typeId); + } + + /** {@inheritDoc} */ + @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + typeId = in.readInt(); + } + + /** {@inheritDoc} */ + @Override protected boolean equalsx(PortableMetadataKey2 key) { + return typeId == key.typeId; + } + + /** {@inheritDoc} */ + @Override public int hashCode() { + return typeId; + } + + /** {@inheritDoc} */ + @Override public String toString() { + return S.toString(PortableMetadataKey2.class, this); + } +} \ No newline at end of file