SteNicholas commented on a change in pull request #12516:
URL: https://github.com/apache/flink/pull/12516#discussion_r437073129



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/jobmanager/JobManagerFlinkMemoryUtils.java
##########
@@ -75,12 +75,12 @@ private static JobManagerFlinkMemory 
createJobManagerFlinkMemory(
                        MemorySize jvmHeap,
                        MemorySize offHeapMemory) {
                verifyJvmHeapSize(jvmHeap);
-               verifyJobStoreCacheSize(config, offHeapMemory);
+               verifyJobStoreCacheSize(config, jvmHeap);
                return new JobManagerFlinkMemory(jvmHeap, offHeapMemory);
        }
 
        private static void verifyJvmHeapSize(MemorySize jvmHeapSize) {
-               if (jvmHeapSize.compareTo(JobManagerOptions.MIN_JVM_HEAP_SIZE) 
< 1) {
+               if (jvmHeapSize.compareTo(JobManagerOptions.MIN_JVM_HEAP_SIZE) 
< 0) {

Review comment:
       @zentol I agree with you. @azagrebin The log tells the users the 
comparation result is "less than".

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/jobmanager/JobManagerFlinkMemoryUtils.java
##########
@@ -75,12 +75,12 @@ private static JobManagerFlinkMemory 
createJobManagerFlinkMemory(
                        MemorySize jvmHeap,
                        MemorySize offHeapMemory) {
                verifyJvmHeapSize(jvmHeap);
-               verifyJobStoreCacheSize(config, offHeapMemory);
+               verifyJobStoreCacheSize(config, jvmHeap);
                return new JobManagerFlinkMemory(jvmHeap, offHeapMemory);
        }
 
        private static void verifyJvmHeapSize(MemorySize jvmHeapSize) {
-               if (jvmHeapSize.compareTo(JobManagerOptions.MIN_JVM_HEAP_SIZE) 
< 1) {
+               if (jvmHeapSize.compareTo(JobManagerOptions.MIN_JVM_HEAP_SIZE) 
< 0) {

Review comment:
       @zentol I agree with you. @azagrebin The log tells users the comparation 
result is "less than".

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/jobmanager/JobManagerFlinkMemoryUtils.java
##########
@@ -91,13 +91,13 @@ private static void verifyJvmHeapSize(MemorySize 
jvmHeapSize) {
        private static void verifyJobStoreCacheSize(Configuration config, 
MemorySize jvmHeapSize) {
                MemorySize jobStoreCacheHeapSize =
                        
MemorySize.parse(config.getLong(JobManagerOptions.JOB_STORE_CACHE_SIZE) + "b");
-               if (jvmHeapSize.compareTo(jobStoreCacheHeapSize) < 1) {
+               if (jvmHeapSize.compareTo(jobStoreCacheHeapSize) < 0) {

Review comment:
       @azagrebin The same reason mentioned above.




----------------------------------------------------------------
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]


Reply via email to