public static int getSlot ( Configuration configuration ) { int slots = configuration . getInteger ( TaskManagerOptions . NUM_TASK_SLOTS , 1 ) ; // we need this because many configs have been written with a "-1" entry if ( slots == - 1 ) { slots = 1 ; } ConfigurationParserUtils . checkConfigParameter ( slots >= 1 , slots , TaskManagerOptions . NUM_TASK_SLOTS . key ( ) , "Number of task slots must be at least one." ) ; return slots ; }
Parses the configuration to get the number of slots and validates the value .