tillrohrmann commented on a change in pull request #8608: [FLINK-11392][network] Introduce ShuffleEnvironment interface URL: https://github.com/apache/flink/pull/8608#discussion_r291190447
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java ########## @@ -131,4 +134,26 @@ public static void checkConfigParameter(boolean condition, Object parameter, Str name + " : " + parameter + " - " + errorMessage); } } + + /** + * Parses the configuration to get the page size and validates the value. + * + * @param configuration configuration object + * @return size of memory segment + */ + public static int getPageSize(Configuration configuration) { + final int pageSize = checkedDownCast(MemorySize.parse( + configuration.getString(TaskManagerOptions.MEMORY_SEGMENT_SIZE)).getBytes()); + + // check page size of for minimum size + checkConfigParameter(pageSize >= MemoryManager.MIN_PAGE_SIZE, pageSize, + TaskManagerOptions.MEMORY_SEGMENT_SIZE.key(), + "Minimum memory segment size is " + MemoryManager.MIN_PAGE_SIZE); + // check page size for power of two + checkConfigParameter(MathUtils.isPowerOf2(pageSize), pageSize, + TaskManagerOptions.MEMORY_SEGMENT_SIZE.key(), + "Memory segment size must be a power of 2."); Review comment: Formatting in this method seems a bit off. ---------------------------------------------------------------- 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