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

    https://github.com/apache/flink/pull/886#discussion_r34047058
  
    --- Diff: 
flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
 ---
    @@ -993,9 +1000,34 @@ object JobManager {
           configuration.setString(ConfigConstants.FLINK_BASE_DIR_PATH_KEY, 
configDir + "/..")
         }
     
    -    val hostname = 
configuration.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null)
    -    val port = 
configuration.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY,
    -      ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT)
    +    // HA mode
    +    val (hostname, port) = if 
(ZooKeeperUtil.isJobManagerHighAvailabilityEnabled(configuration)) {
    +      // TODO @removeme @tillrohrmann This is the place where the host and 
random port for JM is
    +      // chosen.  For the FlinkMiniCluster you have to choose it on your 
own.
    +      LOG.info("HA mode.")
    +
    +      if (config.getHost == null) {
    --- End diff --
    
    Across Java/Scala, this is a tricky discussion.
    
    It holds if you are within the Scala Ecosystem. There, you define a method 
with parenthesis, or without. The definition of the method clearly indicates 
the purity.
    
    When cross-referencing Java methods, that does not work any more. The 
implementer cannot state the purity of the method. Letting the caller call the 
method in a way that he hopes the method behaves is not very clean.
    
    In this case it works, but we have a lot of our Java methods start with 
`get` and have side effects. They get called without parenthesis frequently, 
because IDEs suggest that methods starting with `get` should have no 
parenthesis (which assumes all Java code ever was written with Scala semantics 
assumed).
    
    To be consistent in Scala means calling empty-parenthesis methods with 
parenthesis. I find it strange to not apply the same principle to Java methods 
(which are all defined as empty-parenthesis methods).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to