[ 
https://issues.apache.org/jira/browse/FLINK-2399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740755#comment-14740755
 ] 

ASF GitHub Bot commented on FLINK-2399:
---------------------------------------

Github user sachingoel0101 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/945#discussion_r39268191
  
    --- Diff: flink-core/src/main/java/org/apache/flink/util/VersionUtils.java 
---
    @@ -0,0 +1,81 @@
    +/*
    + * 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.flink.util;
    +
    +import org.apache.flink.configuration.Configuration;
    +
    +/**
    + * Version numbers to check compatibility between JobManager, TaskManager 
and JobClient.
    + */
    +public class VersionUtils {
    +
    +   public static final String FLINK_VERSION = Configuration.FLINK_VERSION;
    +   /**
    +    * Lower limit on client versions this job manager can work with.
    +    */
    +   public static final String JOB_CLIENT_VERSION_LOWER = "0.9.0";
    +
    +   /**
    +    * Gets the minimum supported Client version by this Job Manager.
    +    *
    +    * @return Minimum supported client version number.
    +    */
    +   public static String getJobClientVersionLower() {
    +           return JOB_CLIENT_VERSION_LOWER;
    +   }
    +
    +   /**
    +    * Checks whether the given client version is compatible with this Job 
Manager
    +    *
    +    * @param clientVersion Version of the client
    +    * @return Whether the given client is compatible with the Job Manager.
    +    */
    +   public static boolean isClientCompatible(String clientVersion) {
    +           return versionComparator(JOB_CLIENT_VERSION_LOWER, 
clientVersion) <= 0 && versionComparator(clientVersion, FLINK_VERSION) <= 0;
    +   }
    +
    +   /**
    +    * Checks which of the two given version strings is higher.
    +    *
    +    * @param version1 Version 1
    +    * @param version2 Version 2
    +    * @return 1 if version1 > version2, -1 if version1 < version2 and 0 if 
version1 = version2
    +    * <p>
    +    * Code taken from <a href = 
"http://stackoverflow.com/questions/6701948/efficient-way-to-compare-version-strings-in-java";>Stack
 Overflow</a>
    --- End diff --
    
    Ah. Sorry. Will fix this. 


> Fail when actor versions don't match
> ------------------------------------
>
>                 Key: FLINK-2399
>                 URL: https://issues.apache.org/jira/browse/FLINK-2399
>             Project: Flink
>          Issue Type: Improvement
>          Components: JobManager, TaskManager
>    Affects Versions: 0.9, master
>            Reporter: Ufuk Celebi
>            Assignee: Sachin Goel
>            Priority: Minor
>             Fix For: 0.10
>
>
> Problem: there can be subtle errors when actors from different Flink versions 
> communicate with each other, for example when an old client (e.g. Flink 0.9) 
> communicates with a new JobManager (e.g. Flink 0.10-SNAPSHOT).
> We can check that the versions match on first communication between the 
> actors and fail if they don't match.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to