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_r298057881
 
 

 ##########
 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:
   I have realized, that `JobID` is in fact marked as Flink public API. This 
makes the argument to move this method away from `JobID` even stronger.
   
   Could you also add a test that passes a few hardcoded seed values and checks 
that the results of this calls return precomputed ids?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to