You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/11/18 11:39:31 UTC
[16/17] ignite git commit: IGNITE-1847: GIT failed to change class
name casing (2/2).
IGNITE-1847: GIT failed to change class name casing (2/2).
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/66c84ea3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/66c84ea3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/66c84ea3
Branch: refs/heads/ignite-1753-1282
Commit: 66c84ea32fec0a62b7a01f4094503e8ebc297fed
Parents: a0efe76
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Nov 18 10:30:46 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Nov 18 10:30:46 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/66c84ea3/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
new file mode 100644
index 0000000..67e1a0d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetadataCollector.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 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/66c84ea3/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
deleted file mode 100644
index 701c619..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryMetadataCollector2.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 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/66c84ea3/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 7fa6bc3..225e0ba 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())) {
- BinaryMetadataCollector2 metaCollector = new BinaryMetadataCollector2(typeName);
+ BinaryMetadataCollector metaCollector = new BinaryMetadataCollector(typeName);
if (serializer != null)
serializer.writeBinary(obj, metaCollector);
http://git-wip-us.apache.org/repos/asf/ignite/blob/66c84ea3/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 e6eb494..117eece 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<PortableMetadataKey2, BinaryMetadata> metaDataCache;
+ private volatile IgniteCacheProxy<PortableMetadataKey, 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 PortableMetadataKey2;
+ return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey;
}
};
@@ -238,7 +238,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
GridCacheQueryManager qryMgr = metaDataCache.context().queries();
- CacheQuery<Map.Entry<PortableMetadataKey2, BinaryMetadata>> qry =
+ CacheQuery<Map.Entry<PortableMetadataKey, 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<PortableMetadataKey2, BinaryMetadata>> fut = qry.execute();
+ CacheQueryFuture<Map.Entry<PortableMetadataKey, BinaryMetadata>> fut = qry.execute();
- Map.Entry<PortableMetadataKey2, BinaryMetadata> next;
+ Map.Entry<PortableMetadataKey, 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(PortableMetadataKey2 key, final BinaryMetadata newMeta) {
+ private void addClientCacheMetaData(PortableMetadataKey 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 PortableMetadataKey2 key = new PortableMetadataKey2(typeId);
+ final PortableMetadataKey key = new PortableMetadataKey(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 PortableMetadataKey2(typeId));
+ BinaryMetadata meta = metaDataCache.localPeek(new PortableMetadataKey(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<PortableMetadataKey2> keys = new ArrayList<>(typeIds.size());
+ Collection<PortableMetadataKey> keys = new ArrayList<>(typeIds.size());
for (Integer typeId : typeIds)
- keys.add(new PortableMetadataKey2(typeId));
+ keys.add(new PortableMetadataKey(typeId));
- Map<PortableMetadataKey2, BinaryMetadata> meta = metaDataCache.getAll(keys);
+ Map<PortableMetadataKey, BinaryMetadata> meta = metaDataCache.getAll(keys);
Map<Integer, BinaryType> res = U.newHashMap(meta.size());
- for (Map.Entry<PortableMetadataKey2, BinaryMetadata> e : meta.entrySet())
+ for (Map.Entry<PortableMetadataKey, 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<PortableMetadataKey2, BinaryMetadata>, BinaryType>() {
+ new C1<Cache.Entry<PortableMetadataKey, BinaryMetadata>, BinaryType>() {
private static final long serialVersionUID = 0L;
- @Override public BinaryType apply(Cache.Entry<PortableMetadataKey2, BinaryMetadata> e) {
+ @Override public BinaryType apply(Cache.Entry<PortableMetadataKey, BinaryMetadata> e) {
return e.getValue().wrap(portableCtx);
}
});
@@ -799,7 +799,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/**
*/
private static class MetaDataProcessor implements
- EntryProcessor<PortableMetadataKey2, BinaryMetadata, BinaryObjectException>, Externalizable {
+ EntryProcessor<PortableMetadataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
/** */
private static final long serialVersionUID = 0L;
@@ -829,7 +829,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public BinaryObjectException process(
- MutableEntry<PortableMetadataKey2, BinaryMetadata> entry,
+ MutableEntry<PortableMetadataKey, BinaryMetadata> entry,
Object... args) {
try {
BinaryMetadata oldMeta = entry.getValue();
@@ -873,15 +873,15 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/**
*
*/
- class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey2, BinaryMetadata> {
+ class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey, BinaryMetadata> {
/** {@inheritDoc} */
@Override public void onUpdated(
- Iterable<CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata>> evts)
+ Iterable<CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata>> evts)
throws CacheEntryListenerException {
- for (CacheEntryEvent<? extends PortableMetadataKey2, ? extends BinaryMetadata> evt : evts) {
+ for (CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata> evt : evts) {
assert evt.getEventType() == EventType.CREATED || evt.getEventType() == EventType.UPDATED : evt;
- PortableMetadataKey2 key = evt.getKey();
+ PortableMetadataKey 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 PortableMetadataKey2;
+ return evt.getKey() instanceof PortableMetadataKey;
}
/** {@inheritDoc} */
@@ -924,7 +924,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
/** {@inheritDoc} */
@Override public boolean apply(Object key, Object val) {
- return key instanceof PortableMetadataKey2;
+ return key instanceof PortableMetadataKey;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/66c84ea3/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
new file mode 100644
index 0000000..f838c82
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey.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 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/66c84ea3/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
deleted file mode 100644
index 4c99b70..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/PortableMetadataKey2.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 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