ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [41/50] [abbrv] ignite git commit: IGNITE-1486: Removed protocol version as we decided it is not needed.
Date Fri, 23 Oct 2015 08:48:07 GMT
IGNITE-1486: Removed protocol version as we decided it is not needed.


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

Branch: refs/heads/ignite-1655
Commit: 4f1120f1b13396139fd3bb72ecc22772b9e58fb4
Parents: e4dba7b
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Oct 22 12:09:41 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Oct 22 12:09:41 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  4 --
 .../discovery/GridDiscoveryManager.java         | 10 ----
 .../marshaller/portable/PortableMarshaller.java | 32 -------------
 .../portable/PortableProtocolVersion.java       | 41 ----------------
 .../resources/META-INF/classnames.properties    |  1 -
 .../GridDiscoveryManagerAttributesSelfTest.java | 50 --------------------
 6 files changed, 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4f1120f1/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 a4ad469..d7cacab 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
@@ -204,7 +204,6 @@ import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MARSHALLER;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_NODE_CONSISTENT_ID;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PEER_CLASSLOADING;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PHY_RAM;
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PORTABLE_PROTO_VER;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PREFIX;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_RESTART_ENABLED;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_REST_PORT_RANGE;
@@ -1271,9 +1270,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         add(ATTR_MARSHALLER, cfg.getMarshaller().getClass().getName());
         add(ATTR_USER_NAME, System.getProperty("user.name"));
         add(ATTR_GRID_NAME, gridName);
-        add(ATTR_PORTABLE_PROTO_VER, cfg.getMarshaller() instanceof PortableMarshaller ?
-            ((PortableMarshaller)cfg.getMarshaller()).getProtocolVersion().toString() :
-            PortableMarshaller.DFLT_PORTABLE_PROTO_VER.toString());
 
         add(ATTR_PEER_CLASSLOADING, cfg.isPeerClassLoadingEnabled());
         add(ATTR_DEPLOYMENT_MODE, cfg.getDeploymentMode());

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f1120f1/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 da934ea..6aba211 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
@@ -126,7 +126,6 @@ import static org.apache.ignite.events.EventType.EVT_NODE_SEGMENTED;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PEER_CLASSLOADING;
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PORTABLE_PROTO_VER;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_USER_NAME;
 import static org.apache.ignite.internal.IgniteVersionUtils.VER;
 import static org.apache.ignite.plugin.segmentation.SegmentationPolicy.NOOP;
@@ -983,8 +982,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
         // Fetch local node attributes once.
         String locPreferIpV4 = locNode.attribute("java.net.preferIPv4Stack");
 
-        String locPortableProtoVer = locNode.attribute(ATTR_PORTABLE_PROTO_VER);
-
         Object locMode = locNode.attribute(ATTR_DEPLOYMENT_MODE);
 
         int locJvmMajVer = nodeJavaMajorVersion(locNode);
@@ -1039,13 +1036,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
                         ", rmtId8=" + U.id8(n.id()) + ", rmtPeerClassLoading=" + rmtP2pEnabled
+
                         ", rmtAddrs=" + U.addressesAsString(n) + ']');
             }
-
-            String rmtPortableProtoVer = n.attribute(ATTR_PORTABLE_PROTO_VER);
-
-            // In order to support backward compatibility skip the check for nodes that don't
have this attribute.
-            if (rmtPortableProtoVer != null && !F.eq(locPortableProtoVer, rmtPortableProtoVer))
-                throw new IgniteCheckedException("Remote node has portable protocol version
different from local " +
-                    "[locVersion=" + locPortableProtoVer + ", rmtVersion=" + rmtPortableProtoVer
+ ']');
         }
 
         if (log.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f1120f1/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
index e3905cd..3f02c65 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/PortableMarshaller.java
@@ -32,7 +32,6 @@ import org.apache.ignite.marshaller.MarshallerContext;
 import org.apache.ignite.portable.PortableException;
 import org.apache.ignite.portable.PortableIdMapper;
 import org.apache.ignite.portable.PortableObject;
-import org.apache.ignite.portable.PortableProtocolVersion;
 import org.apache.ignite.portable.PortableSerializer;
 import org.apache.ignite.portable.PortableTypeConfiguration;
 import org.jetbrains.annotations.Nullable;
@@ -77,9 +76,6 @@ import org.jetbrains.annotations.Nullable;
  * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
  */
 public class PortableMarshaller extends AbstractMarshaller {
-    /** Default portable protocol version. */
-    public static final PortableProtocolVersion DFLT_PORTABLE_PROTO_VER = PortableProtocolVersion.VER_1_4_0;
-
     /** Class names. */
     private Collection<String> clsNames;
 
@@ -104,9 +100,6 @@ public class PortableMarshaller extends AbstractMarshaller {
     /** Keep deserialized flag. */
     private boolean keepDeserialized = true;
 
-    /** Protocol version. */
-    private PortableProtocolVersion protoVer = DFLT_PORTABLE_PROTO_VER;
-
     /** */
     private GridPortableMarshaller impl;
 
@@ -268,31 +261,6 @@ public class PortableMarshaller extends AbstractMarshaller {
     }
 
     /**
-     * Gets portable protocol version.
-     * <p>
-     * Defaults to {@link #DFLT_PORTABLE_PROTO_VER}.
-     *
-     * @return Portable protocol version.
-     */
-    public PortableProtocolVersion getProtocolVersion() {
-        return protoVer;
-    }
-
-    /**
-     * Sets portable protocol version.
-     * <p>
-     * Defaults to {@link #DFLT_PORTABLE_PROTO_VER}.
-     *
-     * @param protoVer Portable protocol version.
-     */
-    public void setProtocolVersion(PortableProtocolVersion protoVer) {
-        if (protoVer == null)
-            throw new IllegalArgumentException("Wrong portable protocol version: " + protoVer);
-
-        this.protoVer = protoVer;
-    }
-
-    /**
      * Returns currently set {@link MarshallerContext}.
      *
      * @return Marshaller context.

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f1120f1/modules/core/src/main/java/org/apache/ignite/portable/PortableProtocolVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/portable/PortableProtocolVersion.java
b/modules/core/src/main/java/org/apache/ignite/portable/PortableProtocolVersion.java
deleted file mode 100644
index 9189b28..0000000
--- a/modules/core/src/main/java/org/apache/ignite/portable/PortableProtocolVersion.java
+++ /dev/null
@@ -1,41 +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.portable;
-
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Portable protocol version.
- */
-public enum PortableProtocolVersion {
-    /** Ignite 1.4.0 release. */
-    VER_1_4_0;
-
-    /** Enumerated values. */
-    private static final PortableProtocolVersion[] VALS = values();
-
-    /**
-     * Efficiently gets enumerated value from its ordinal.
-     *
-     * @param ord Ordinal value.
-     * @return Enumerated value or {@code null} if ordinal out of range.
-     */
-    @Nullable public static PortableProtocolVersion fromOrdinal(int ord) {
-        return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f1120f1/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 70c32e5..9376613 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -1575,7 +1575,6 @@ org.apache.ignite.plugin.segmentation.SegmentationResolver
 org.apache.ignite.portable.PortableException
 org.apache.ignite.portable.PortableInvalidClassException
 org.apache.ignite.portable.PortableObject
-org.apache.ignite.portable.PortableProtocolVersion
 org.apache.ignite.services.Service
 org.apache.ignite.services.ServiceConfiguration
 org.apache.ignite.services.ServiceContext

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f1120f1/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 82da10f..3c6d53b 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
@@ -17,15 +17,10 @@
 
 package org.apache.ignite.internal.managers.discovery;
 
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.DeploymentMode;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteNodeAttributes;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -159,51 +154,6 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends
GridCommonA
     }
 
     /**
-     * @throws Exception If failed.
-     */
-    public void testDifferentPortableProtocolVersions() throws Exception {
-        startGridWithPortableProtocolVer("VER_99_99_99");
-
-        try {
-            startGrid(1);
-
-            fail();
-        }
-        catch (IgniteCheckedException e) {
-            if (!e.getCause().getMessage().startsWith("Remote node has portable protocol
version different from local"))
-                throw e;
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testNullPortableProtocolVersion() throws Exception {
-        startGridWithPortableProtocolVer(null);
-
-        // Must not fail in order to preserve backward compatibility with the nodes that
don't have this property yet.
-        startGrid(1);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    private void startGridWithPortableProtocolVer(String ver) throws Exception {
-        Ignite ignite = startGrid(0);
-
-        ClusterNode clusterNode = ignite.cluster().localNode();
-
-        Field f = clusterNode.getClass().getDeclaredField("attrs");
-        f.setAccessible(true);
-
-        Map<String, Object> attrs = new HashMap<>((Map<String, Object>)f.get(clusterNode));
-
-        attrs.put(IgniteNodeAttributes.ATTR_PORTABLE_PROTO_VER, ver);
-
-        f.set(clusterNode, attrs);
-    }
-
-    /**
      * @param preferIpV4 {@code java.net.preferIPv4Stack} system property value.
      * @throws Exception If failed.
      */


Mime
View raw message