ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [29/38] ignite git commit: IGNITE-2007: IgniteBinary: metadata -> type.
Date Thu, 26 Nov 2015 10:51:26 GMT
IGNITE-2007: IgniteBinary: metadata -> type.


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

Branch: refs/heads/ignite-1537
Commit: 0a97c1c10ed950ff8a6ef88c909e6f5ba84280d9
Parents: 5cf8dae
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Nov 26 12:41:52 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Nov 26 12:41:52 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/IgniteBinary.java     | 10 +++++-----
 .../main/java/org/apache/ignite/binary/BinaryObject.java  |  2 +-
 .../main/java/org/apache/ignite/binary/BinaryType.java    |  2 +-
 .../processors/cache/portable/IgniteBinaryImpl.java       |  9 +++++----
 .../internal/processors/cacheobject/NoOpBinary.java       |  8 ++++----
 .../portable/BinaryObjectBuilderAdditionalSelfTest.java   |  6 +++---
 .../internal/portable/GridPortableMetaDataSelfTest.java   | 10 +++++-----
 ...dCacheClientNodeBinaryObjectMetadataMultinodeTest.java |  8 ++++----
 .../GridCacheClientNodeBinaryObjectMetadataTest.java      |  4 ++--
 .../platform/PlatformComputeBinarizableArgTask.java       |  2 +-
 10 files changed, 31 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/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 8802c10..1c63303 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
@@ -134,7 +134,7 @@ import org.jetbrains.annotations.Nullable;
  * <h1 class="header">Portable Metadata</h1>
  * Even though Ignite portable protocol only works with hash codes for type and field names
  * to achieve better performance, Ignite provides metadata for all portable types which
- * can be queried ar runtime via any of the {@link IgniteBinary#metadata(Class)}
+ * can be queried ar runtime via any of the {@link IgniteBinary#type(Class)}
  * methods. Having metadata also allows for proper formatting of {@code PortableObject#toString()}
method,
  * even when portable objects are kept in binary format only, which may be necessary for
audit reasons.
  * <h1 class="header">Dynamic Structure Changes</h1>
@@ -323,7 +323,7 @@ public interface IgniteBinary {
      * @return Metadata.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
-    public BinaryType metadata(Class<?> cls) throws BinaryObjectException;
+    public BinaryType type(Class<?> cls) throws BinaryObjectException;
 
     /**
      * Gets metadata for provided class name.
@@ -332,7 +332,7 @@ public interface IgniteBinary {
      * @return Metadata.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
-    public BinaryType metadata(String typeName) throws BinaryObjectException;
+    public BinaryType type(String typeName) throws BinaryObjectException;
 
     /**
      * Gets metadata for provided type ID.
@@ -341,7 +341,7 @@ public interface IgniteBinary {
      * @return Metadata.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
-    public BinaryType metadata(int typeId) throws BinaryObjectException;
+    public BinaryType type(int typeId) throws BinaryObjectException;
 
     /**
      * Gets metadata for all known types.
@@ -349,5 +349,5 @@ public interface IgniteBinary {
      * @return Metadata.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
-    public Collection<BinaryType> metadata() throws BinaryObjectException;
+    public Collection<BinaryType> types() throws BinaryObjectException;
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
index 432ace2..249daab 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
@@ -94,7 +94,7 @@ import java.util.TreeMap;
  * <h1 class="header">Binary Type Metadata</h1>
  * Even though Ignite binary protocol only works with hash codes for type and field names
  * to achieve better performance, Ignite provides metadata for all binary types which
- * can be queried ar runtime via any of the {@link org.apache.ignite.IgniteBinary#metadata(Class)}
+ * can be queried ar runtime via any of the {@link org.apache.ignite.IgniteBinary#type(Class)}
  * methods. Having metadata also allows for proper formatting of {@code BinaryObject.toString()}
method,
  * even when binary objects are kept in binary format only, which may be necessary for audit
reasons.
  */

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java
index 710bf55..debd7e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryType.java
@@ -21,7 +21,7 @@ import java.util.Collection;
 
 /**
  * Binary type meta data. Metadata for binary types can be accessed from any of the
- * {@link org.apache.ignite.IgniteBinary#metadata(String)} methods.
+ * {@link org.apache.ignite.IgniteBinary#type(String)} methods.
  * Having metadata also allows for proper formatting of {@code BinaryObject#toString()} method,
  * even when binary objects are kept in binary format only, which may be necessary for audit
reasons.
  */

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/IgniteBinaryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/IgniteBinaryImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/IgniteBinaryImpl.java
index 72f4d24..41aa68c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/IgniteBinaryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/portable/IgniteBinaryImpl.java
@@ -59,6 +59,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override public <T> T toBinary(@Nullable Object obj) throws BinaryObjectException
{
         guard();
 
@@ -95,7 +96,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public BinaryType metadata(Class<?> cls) throws BinaryObjectException
{
+    @Nullable @Override public BinaryType type(Class<?> cls) throws BinaryObjectException
{
         guard();
 
         try {
@@ -107,7 +108,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public BinaryType metadata(String typeName) throws BinaryObjectException
{
+    @Nullable @Override public BinaryType type(String typeName) throws BinaryObjectException
{
         guard();
 
         try {
@@ -119,7 +120,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public BinaryType metadata(int typeId) throws BinaryObjectException
{
+    @Nullable @Override public BinaryType type(int typeId) throws BinaryObjectException {
         guard();
 
         try {
@@ -131,7 +132,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Override public Collection<BinaryType> metadata() throws BinaryObjectException
{
+    @Override public Collection<BinaryType> types() throws BinaryObjectException {
         guard();
 
         try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
index 5bbc194..252baed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
@@ -49,22 +49,22 @@ public class NoOpBinary implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Override public BinaryType metadata(Class<?> cls) throws BinaryObjectException
{
+    @Override public BinaryType type(Class<?> cls) throws BinaryObjectException {
         throw unsupported();
     }
 
     /** {@inheritDoc} */
-    @Override public BinaryType metadata(String typeName) throws BinaryObjectException {
+    @Override public BinaryType type(String typeName) throws BinaryObjectException {
         throw unsupported();
     }
 
     /** {@inheritDoc} */
-    @Override public BinaryType metadata(int typeId) throws BinaryObjectException {
+    @Override public BinaryType type(int typeId) throws BinaryObjectException {
         throw unsupported();
     }
 
     /** {@inheritDoc} */
-    @Override public Collection<BinaryType> metadata() throws BinaryObjectException
{
+    @Override public Collection<BinaryType> types() throws BinaryObjectException {
         throw unsupported();
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryObjectBuilderAdditionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryObjectBuilderAdditionalSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryObjectBuilderAdditionalSelfTest.java
index 356a25b..badad61 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryObjectBuilderAdditionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/BinaryObjectBuilderAdditionalSelfTest.java
@@ -968,7 +968,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.build();
 
-        BinaryType metadata = portables().metadata(TestObjectContainer.class);
+        BinaryType metadata = portables().type(TestObjectContainer.class);
 
         assertEquals("String", metadata.fieldTypeName("xx567"));
     }
@@ -984,7 +984,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.build();
 
-        BinaryType metadata = portables().metadata(TestObjectContainer.class);
+        BinaryType metadata = portables().type(TestObjectContainer.class);
 
         assertEquals("String", metadata.fieldTypeName("xx567"));
     }
@@ -1008,7 +1008,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.build();
 
-        BinaryType metadata = portables().metadata(c.getClass());
+        BinaryType metadata = portables().type(c.getClass());
 
         assertTrue(metadata.fieldNames().containsAll(Arrays.asList("intField", "intArrField",
"arrField", "strField",
             "colField", "mapField", "enumField", "enumArrField")));

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMetaDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMetaDataSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMetaDataSelfTest.java
index 5c25d3b..974b87e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMetaDataSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/portable/GridPortableMetaDataSelfTest.java
@@ -87,7 +87,7 @@ public class GridPortableMetaDataSelfTest extends GridCommonAbstractTest
{
     public void testGetAll() throws Exception {
         portables().toBinary(new TestObject2());
 
-        Collection<BinaryType> metas = portables().metadata();
+        Collection<BinaryType> metas = portables().types();
 
         assertEquals(2, metas.size());
 
@@ -153,14 +153,14 @@ public class GridPortableMetaDataSelfTest extends GridCommonAbstractTest
{
     public void testNoConfiguration() throws Exception {
         portables().toBinary(new TestObject3());
 
-        assertNotNull(portables().metadata(TestObject3.class));
+        assertNotNull(portables().type(TestObject3.class));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testReflection() throws Exception {
-        BinaryType meta = portables().metadata(TestObject1.class);
+        BinaryType meta = portables().type(TestObject1.class);
 
         assertNotNull(meta);
 
@@ -193,7 +193,7 @@ public class GridPortableMetaDataSelfTest extends GridCommonAbstractTest
{
     public void testPortableMarshalAware() throws Exception {
         portables().toBinary(new TestObject2());
 
-        BinaryType meta = portables().metadata(TestObject2.class);
+        BinaryType meta = portables().type(TestObject2.class);
 
         assertNotNull(meta);
 
@@ -230,7 +230,7 @@ public class GridPortableMetaDataSelfTest extends GridCommonAbstractTest
{
 
         portables().toBinary(new TestObject2());
 
-        BinaryType meta = portables().metadata(TestObject2.class);
+        BinaryType meta = portables().type(TestObject2.class);
 
         assertNotNull(meta);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
index 99e2073..9733080 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
@@ -158,7 +158,7 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends
GridCo
 
             IgniteBinary portables = ignite(i).binary();
 
-            Collection<BinaryType> metaCol = portables.metadata();
+            Collection<BinaryType> metaCol = portables.types();
 
             assertEquals(allTypes.size(), metaCol.size());
 
@@ -238,13 +238,13 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends
GridCo
 
             GridTestUtils.waitForCondition(new GridAbsPredicate() {
                 @Override public boolean apply() {
-                    Collection<BinaryType> metaCol = p0.metadata();
+                    Collection<BinaryType> metaCol = p0.types();
 
                     return metaCol.size() == 1000;
                 }
             }, getTestTimeout());
 
-            Collection<BinaryType> metaCol = portables.metadata();
+            Collection<BinaryType> metaCol = portables.types();
 
             assertEquals(1000, metaCol.size());
 
@@ -290,6 +290,6 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends
GridCo
             cache.put(i, builder.build());
         }
 
-        assertEquals(100, ignite(0).binary().metadata().size());
+        assertEquals(100, ignite(0).binary().types().size());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataTest.java
index 256e5fd..70d79d7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/GridCacheClientNodeBinaryObjectMetadataTest.java
@@ -118,8 +118,8 @@ public class GridCacheClientNodeBinaryObjectMetadataTest extends GridCacheAbstra
                 aff0.mapKeyToPrimaryAndBackups(obj2));
         }
 
-        Collection<BinaryType> meta1 = ignite1.binary().metadata();
-        Collection<BinaryType> meta2 = ignite1.binary().metadata();
+        Collection<BinaryType> meta1 = ignite1.binary().types();
+        Collection<BinaryType> meta2 = ignite1.binary().types();
 
         assertEquals(meta1.size(), meta2.size());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0a97c1c1/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
index ffae2d1..148d828 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
@@ -89,7 +89,7 @@ public class PlatformComputeBinarizableArgTask extends ComputeTaskAdapter<Object
         @Nullable @Override public Object execute() {
             BinaryObjectEx arg0 = ((BinaryObjectEx)arg);
 
-            BinaryType meta = ignite.binary().metadata(arg0.typeId());
+            BinaryType meta = ignite.binary().type(arg0.typeId());
 
             if (meta == null)
                 throw new IgniteException("Metadata doesn't exist.");


Mime
View raw message