ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [37/44] incubator-ignite git commit: ignite-1258: altered portable metadata handler interface
Date Fri, 21 Aug 2015 06:38:09 GMT
ignite-1258: altered portable metadata handler interface


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7a25e9ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7a25e9ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7a25e9ed

Branch: refs/heads/ignite-1258
Commit: 7a25e9ed088ef077dbc81496a69d1a11f87957b5
Parents: 4662fec
Author: Denis Magda <dmagda@gridgain.com>
Authored: Thu Aug 20 12:19:43 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Thu Aug 20 12:19:43 2015 +0300

----------------------------------------------------------------------
 .../portable/PortableMetaDataHandler.java       |  2 +-
 .../CacheObjectPortableProcessorImpl.java       | 55 +++++++++++---------
 ...idPortableMarshallerCtxDisabledSelfTest.java |  2 +-
 .../GridPortableMarshallerSelfTest.java         |  2 +-
 .../portable/GridPortableWildcardsSelfTest.java |  2 +-
 ...ridPortableCacheEntryMemorySizeSelfTest.java |  2 +-
 6 files changed, 34 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a25e9ed/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java
index 88c4ca1..e8154ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableMetaDataHandler.java
@@ -30,7 +30,7 @@ public interface PortableMetaDataHandler {
      * @param meta Meta data.
      * @throws PortableException In case of error.
      */
-    public void addMeta(int typeId, PortableMetaDataImpl meta) throws PortableException;
+    public void addMeta(int typeId, PortableMetadata meta) throws PortableException;
 
     /**
      * Gets meta data for provided type ID.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a25e9ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
index cf5106a..72514d3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/CacheObjectPortableProcessorImpl.java
@@ -98,7 +98,7 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
     private IgnitePortables portables;
 
     /** Metadata updates collected before metadata cache is initialized. */
-    private final Map<Integer, PortableMetaDataImpl> metaBuf = new ConcurrentHashMap<>();
+    private final Map<Integer, PortableMetadata> metaBuf = new ConcurrentHashMap<>();
 
     /** */
     private UUID metaCacheQryId;
@@ -148,7 +148,7 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
      */
     @SuppressWarnings("StringEquality")
     public static int fieldTypeId(String typeName) {
-        for (int i = 0; i < FIELD_TYPE_NAMES.length ; i++) {
+        for (int i = 0; i < FIELD_TYPE_NAMES.length; i++) {
             String typeName0 = FIELD_TYPE_NAMES[i];
 
             if (typeName.equals(typeName0))
@@ -202,10 +202,10 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
     @Override public void start() throws IgniteCheckedException {
         if (marsh instanceof PortableMarshaller) {
             PortableMetaDataHandler metaHnd = new PortableMetaDataHandler() {
-                @Override public void addMeta(int typeId, PortableMetaDataImpl newMeta)
+                @Override public void addMeta(int typeId, PortableMetadata newMeta)
                     throws PortableException {
                     if (metaDataCache == null) {
-                        PortableMetaDataImpl oldMeta = metaBuf.get(typeId);
+                        PortableMetadata oldMeta = metaBuf.get(typeId);
 
                         if (oldMeta == null || checkMeta(typeId, oldMeta, newMeta, null))
{
                             synchronized (this) {
@@ -213,11 +213,12 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
 
                                 if (checkMeta(typeId, oldMeta, newMeta, fields)) {
                                     newMeta = new PortableMetaDataImpl(newMeta.typeName(),
-                                                                           fields,
-                                                                           newMeta.affinityKeyFieldName());
+                                        fields,
+                                        newMeta.affinityKeyFieldName());
 
                                     metaBuf.put(typeId, newMeta);
-                                } else
+                                }
+                                else
                                     return;
                             }
 
@@ -225,7 +226,8 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
                                 return;
                             else
                                 metaBuf.remove(typeId);
-                        } else
+                        }
+                        else
                             return;
                     }
 
@@ -307,7 +309,7 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
 
         startLatch.countDown();
 
-        for (Map.Entry<Integer, PortableMetaDataImpl> e : metaBuf.entrySet())
+        for (Map.Entry<Integer, PortableMetadata> e : metaBuf.entrySet())
             addMeta(e.getKey(), e.getValue());
 
         metaBuf.clear();
@@ -649,8 +651,7 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
 
     /** {@inheritDoc} */
     @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr)
-        throws IgniteCheckedException
-    {
+        throws IgniteCheckedException {
         if (!((CacheObjectPortableContext)ctx).portableEnabled() || portableMarsh == null)
             return super.unmarshal(ctx, bytes, clsLdr);
 
@@ -676,7 +677,8 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable
Object obj, boolean userObj) {
+    @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable
Object obj,
+        boolean userObj) {
         if (!((CacheObjectPortableContext)ctx).portableEnabled())
             return super.toCacheObject(ctx, obj, userObj);
 
@@ -760,20 +762,20 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
             if (!oldMeta.typeName().equals(newMeta.typeName())) {
                 throw new PortableException(
                     "Two portable types have duplicate type ID [" +
-                    "typeId=" + typeId +
-                    ", typeName1=" + oldMeta.typeName() +
-                    ", typeName2=" + newMeta.typeName() +
-                    ']'
+                        "typeId=" + typeId +
+                        ", typeName1=" + oldMeta.typeName() +
+                        ", typeName2=" + newMeta.typeName() +
+                        ']'
                 );
             }
 
             if (!F.eq(oldMeta.affinityKeyFieldName(), newMeta.affinityKeyFieldName())) {
                 throw new PortableException(
                     "Portable type has different affinity key fields on different clients
[" +
-                    "typeName=" + newMeta.typeName() +
-                    ", affKeyFieldName1=" + oldMeta.affinityKeyFieldName() +
-                    ", affKeyFieldName2=" + newMeta.affinityKeyFieldName() +
-                    ']'
+                        "typeName=" + newMeta.typeName() +
+                        ", affKeyFieldName1=" + oldMeta.affinityKeyFieldName() +
+                        ", affKeyFieldName2=" + newMeta.affinityKeyFieldName() +
+                        ']'
                 );
             }
 
@@ -790,11 +792,11 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
                 if (!typeName.equals(e.getValue())) {
                     throw new PortableException(
                         "Portable field has different types on different clients [" +
-                        "typeName=" + newMeta.typeName() +
-                        ", fieldName=" + e.getKey() +
-                        ", fieldTypeName1=" + typeName +
-                        ", fieldTypeName2=" + e.getValue() +
-                        ']'
+                            "typeName=" + newMeta.typeName() +
+                            ", fieldName=" + e.getKey() +
+                            ", fieldTypeName1=" + typeName +
+                            ", fieldTypeName2=" + e.getValue() +
+                            ']'
                     );
                 }
             }
@@ -889,7 +891,8 @@ public class CacheObjectPortableProcessorImpl extends IgniteCacheObjectProcessor
      */
     class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetaDataKey,
PortableMetadata> {
         /** {@inheritDoc} */
-        @Override public void onUpdated(Iterable<CacheEntryEvent<? extends PortableMetaDataKey,
? extends PortableMetadata>> evts)
+        @Override public void onUpdated(
+            Iterable<CacheEntryEvent<? extends PortableMetaDataKey, ? extends PortableMetadata>>
evts)
             throws CacheEntryListenerException {
             for (CacheEntryEvent<? extends PortableMetaDataKey, ? extends PortableMetadata>
evt : evts) {
                 assert evt.getEventType() == EventType.CREATED || evt.getEventType() == EventType.UPDATED
: evt;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a25e9ed/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerCtxDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerCtxDisabledSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerCtxDisabledSelfTest.java
index b79c701..0cb6197 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerCtxDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMarshallerCtxDisabledSelfTest.java
@@ -30,7 +30,7 @@ import org.apache.ignite.testframework.junits.common.*;
 public class GridPortableMarshallerCtxDisabledSelfTest extends GridCommonAbstractTest {
     /** */
     protected static final PortableMetaDataHandler META_HND = new PortableMetaDataHandler()
{
-        @Override public void addMeta(int typeId, PortableMetaDataImpl meta) {
+        @Override public void addMeta(int typeId, PortableMetadata meta) {
             // No-op.
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a25e9ed/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 68f80b5..f3b4e68 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
@@ -54,7 +54,7 @@ public class GridPortableMarshallerSelfTest extends GridCommonAbstractTest
{
 
     /** */
     protected static final PortableMetaDataHandler META_HND = new PortableMetaDataHandler()
{
-        @Override public void addMeta(int typeId, PortableMetaDataImpl meta) {
+        @Override public void addMeta(int typeId, PortableMetadata meta) {
             // No-op.
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a25e9ed/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 71af9ed..7e873f3 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
@@ -31,7 +31,7 @@ import java.util.*;
 public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
     /** */
     private static final PortableMetaDataHandler META_HND = new PortableMetaDataHandler()
{
-        @Override public void addMeta(int typeId, PortableMetaDataImpl meta) {
+        @Override public void addMeta(int typeId, PortableMetadata meta) {
             // No-op.
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7a25e9ed/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridPortableCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridPortableCacheEntryMemorySizeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridPortableCacheEntryMemorySizeSelfTest.java
index 95c0f10..b78cb50 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridPortableCacheEntryMemorySizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridPortableCacheEntryMemorySizeSelfTest.java
@@ -28,7 +28,7 @@ public class GridPortableCacheEntryMemorySizeSelfTest extends GridCacheEntryMemo
         marsh.setContext(new MarshallerContextTestImpl(null));
 
         PortableContext pCtx = new PortableContext(new PortableMetaDataHandler() {
-            @Override public void addMeta(int typeId, PortableMetaDataImpl meta) throws PortableException
{
+            @Override public void addMeta(int typeId, PortableMetadata meta) throws PortableException
{
                 // No-op
             }
 


Mime
View raw message