1u0 commented on a change in pull request #8741: [FLINK-12752] Add Option to 
Pass Seed for JobID Hash for StandaloneJobClusterEntrypoint
URL: https://github.com/apache/flink/pull/8741#discussion_r297702281
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/JobID.java
 ##########
 @@ -64,27 +67,48 @@ public JobID(long lowerPart, long upperPart) {
        public JobID(byte[] bytes) {
                super(bytes);
        }
-       
+
        // 
------------------------------------------------------------------------
        //  Static factory methods
        // 
------------------------------------------------------------------------
 
        /**
         * Creates a new (statistically) random JobID.
-        * 
+        *
         * @return A new random JobID.
         */
        public static JobID generate() {
                return new JobID();
        }
 
+       /**
+        * Creates a new JobID based on the given seed. The JobIDs returned by 
two invocations of this
+        * method with the same seed will be equal.
+        *
+        * @param seed the seed to base the generation of the JobID
+        *
+        * @return A new JobID based on the given seed.
+        */
+       public static JobID fromSeed(String seed) {
 
 Review comment:
   Just, imo, I'd move this method outside of `JobID` class 
(`StandaloneJobClusterEntryPoint` is probable host candidate):
    - this method is now less "generic" as before (although, before it was also 
specific);
    - it's computationally not cheap, and may be unintentionally used in other 
places.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to