ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dma...@apache.org
Subject ignite git commit: IGNITE-3098: improvements
Date Mon, 16 May 2016 08:08:19 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3098 99b8830e3 -> d43b71c52


IGNITE-3098: improvements


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

Branch: refs/heads/ignite-3098
Commit: d43b71c526d2ee0ac8a40bb52bbdbbaa8c595f13
Parents: 99b8830
Author: Denis Magda <dmagda@gridgain.com>
Authored: Mon May 16 11:08:11 2016 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon May 16 11:08:11 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/IgniteSystemProperties.java   |  5 +++--
 .../org/apache/ignite/internal/IgniteKernal.java    |  5 +++--
 .../apache/ignite/internal/binary/BinaryUtils.java  |  4 ++--
 .../managers/discovery/GridDiscoveryManager.java    |  4 ++--
 .../apache/ignite/spi/discovery/tcp/ServerImpl.java |  6 +++---
 .../internal/binary/BinaryMarshallerSelfTest.java   | 15 ---------------
 .../GridDiscoveryManagerAttributesSelfTest.java     | 16 ++++++++--------
 7 files changed, 21 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 8e90e6c..47f0f66 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -391,9 +391,10 @@ public final class IgniteSystemProperties {
         "IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID";
 
     /**
-     * Manages type of serialization mechanism for {@link String} that are marshalled/unmarshaller
by BinaryMarshaller.
+     * Manages type of serialization mechanism for {@link String} that is marshalled/unmarshalled
by BinaryMarshaller.
      */
-    public static final String IGNITE_USE_BINARY_STRING_SER_VER_2 = "IGNITE_USE_BINARY_STRING_SER_VER_2";
+    public static final String IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2 =
+        "IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2";
 
     /**
      * If set to {@code true}, then default selected keys set is used inside

http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index b2a8d25..18e5c62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -180,7 +180,7 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALL
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_STARVATION_CHECK_INTERVAL;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_SUCCESS_FILE;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_USE_BINARY_STRING_SER_VER_2;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
 import static org.apache.ignite.IgniteSystemProperties.getBoolean;
 import static org.apache.ignite.IgniteSystemProperties.snapshot;
 import static org.apache.ignite.internal.GridKernalState.DISCONNECTED;
@@ -1306,7 +1306,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 cfg.getBinaryConfiguration().isCompactFooter());
 
             add(ATTR_MARSHALLER_USE_BINARY_STRING_SER_VER_2,
-                getBoolean(IGNITE_USE_BINARY_STRING_SER_VER_2, BinaryUtils.USE_STR_SERIALIZATION_VER_2));
+                getBoolean(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2,
+                    BinaryUtils.USE_STR_SERIALIZATION_VER_2));
         }
 
         add(ATTR_USER_NAME, System.getProperty("user.name"));

http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index 0914814..0d3d7b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -64,7 +64,7 @@ import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_USE_BINARY_STRING_SER_VER_2;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
@@ -79,7 +79,7 @@ public class BinaryUtils {
 
     /** */
     public static final boolean USE_STR_SERIALIZATION_VER_2 = IgniteSystemProperties.getBoolean(
-        IGNITE_USE_BINARY_STRING_SER_VER_2, true);
+        IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2, true);
 
     /** {@code true} if serialized value of this type cannot contain references to objects.
*/
     private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102];

http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 8f4c60f..6aa4d54 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -118,7 +118,7 @@ import org.jsr166.ConcurrentHashMap8;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_USE_BINARY_STRING_SER_VER_2;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
 import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED;
 import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED;
 import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
@@ -1075,7 +1075,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             boolean rmtMarshStrSerVer2Bool = rmtMarshStrSerVer2 == null ? false : rmtMarshStrSerVer2;
 
             if (locMarshStrSerVer2Bool != rmtMarshStrSerVer2Bool) {
-                throw new IgniteCheckedException("Local node's " + IGNITE_USE_BINARY_STRING_SER_VER_2
+
+                throw new IgniteCheckedException("Local node's " + IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2
+
                     " property value differs from remote node's value " +
                     "(to make sure all nodes in topology have identical marshaller settings,
" +
                     "configure system property explicitly) " +

http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 0f26316..a4c7276 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -133,7 +133,7 @@ import org.jsr166.ConcurrentHashMap8;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_DISCOVERY_HISTORY_SIZE;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_USE_BINARY_STRING_SER_VER_2;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
 import static org.apache.ignite.IgniteSystemProperties.getInteger;
 import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
 import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
@@ -3349,7 +3349,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                     utilityPool.submit(
                         new Runnable() {
                             @Override public void run() {
-                                String errMsg = "Local node's " + IGNITE_USE_BINARY_STRING_SER_VER_2
+
+                                String errMsg = "Local node's " + IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2
+
                                     " property value differs from remote node's value " +
                                     "(to make sure all nodes in topology have identical marshaller
settings, " +
                                     "configure system property explicitly) " +
@@ -3359,7 +3359,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                                     ", rmtNodeAddrs=" + U.addressesAsString(node) +
                                     ", locNodeId=" + locNode.id() + ", rmtNodeId=" + msg.creatorNodeId()
+ ']';
 
-                                String sndMsg = "Local node's " + IGNITE_USE_BINARY_STRING_SER_VER_2
+
+                                String sndMsg = "Local node's " + IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2
+
                                     " property value differs from remote node's value " +
                                     "(to make sure all nodes in topology have identical marshaller
settings, " +
                                     "configure system property explicitly) " +

http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index 0b38c3b..e0b46d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -206,26 +206,11 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
         str = new String(new char[]{0xD800, '的', 0xD800, 0xD800, 0xDC00, 0xDFFF});
         assertEquals(str, marshalUnmarshal(str));
 
-        bytes = str.getBytes(UTF_8);
-        try {
-            BinaryUtils.utf8BytesToStr(bytes, 0, bytes.length);
-            assert false : "Mustn't be able to convert the string:" + str;
-        }
-        catch (BinaryObjectException e) {
-            //expected.
-        }
-
-        bytes = BinaryUtils.strToUtf8Bytes(str);
-        assertNotEquals(str, new String(bytes, UTF_8));
-
         str = new String(new char[]{55296});
         assertEquals(str, marshalUnmarshal(str));
 
         bytes = str.getBytes(UTF_8);
         assertNotEquals(str, BinaryUtils.utf8BytesToStr(bytes, 0, bytes.length));
-
-        bytes = BinaryUtils.strToUtf8Bytes(str);
-        assertNotEquals(str, new String(bytes, UTF_8));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/d43b71c5/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
index a1de38d..28380df 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
@@ -29,7 +29,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_USE_BINARY_STRING_SER_VER_2;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
 import static org.apache.ignite.configuration.DeploymentMode.CONTINUOUS;
 import static org.apache.ignite.configuration.DeploymentMode.SHARED;
 
@@ -170,7 +170,7 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
     }
 
     public void testUseStringSerVer2() throws Exception {
-        String old = System.getProperty(IGNITE_USE_BINARY_STRING_SER_VER_2);
+        String old = System.getProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2);
 
         binaryMarshallerEnabled = true;
 
@@ -183,9 +183,9 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
         }
         finally {
             if (old != null)
-                System.setProperty(IGNITE_USE_BINARY_STRING_SER_VER_2, old);
+                System.setProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2,
old);
             else
-                System.clearProperty(IGNITE_USE_BINARY_STRING_SER_VER_2);
+                System.clearProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2);
 
             binaryMarshallerEnabled = false;
         }
@@ -197,16 +197,16 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends
GridCommonA
     private void doTestUseStrSerVer2(String first, String second, boolean fail) throws Exception
{
         try {
             if (first != null)
-                System.setProperty(IGNITE_USE_BINARY_STRING_SER_VER_2, first);
+                System.setProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2,
first);
             else
-                System.clearProperty(IGNITE_USE_BINARY_STRING_SER_VER_2);
+                System.clearProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2);
 
             startGrid(0);
 
             if (second != null)
-                System.setProperty(IGNITE_USE_BINARY_STRING_SER_VER_2, second);
+                System.setProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2,
second);
             else
-                System.clearProperty(IGNITE_USE_BINARY_STRING_SER_VER_2);
+                System.clearProperty(IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2);
 
             try {
                 startGrid(1);


Mime
View raw message