public boolean isMatching ( ResourceProfile required ) { if ( required == UNKNOWN ) { return true ; } if ( cpuCores >= required . getCpuCores ( ) && heapMemoryInMB >= required . getHeapMemoryInMB ( ) && directMemoryInMB >= required . getDirectMemoryInMB ( ) && nativeMemoryInMB >= required . getNativeMemoryInMB ( ) && networkMemoryInMB >= required . getNetworkMemoryInMB ( ) ) { for ( Map . Entry < String , Resource > resource : required . extendedResources . entrySet ( ) ) { if ( ! extendedResources . containsKey ( resource . getKey ( ) ) || ! extendedResources . get ( resource . getKey ( ) ) . getResourceAggregateType ( ) . equals ( resource . getValue ( ) . getResourceAggregateType ( ) ) || extendedResources . get ( resource . getKey ( ) ) . getValue ( ) < resource . getValue ( ) . getValue ( ) ) { return false ; } } return true ; } return false ; }
Check whether required resource profile can be matched .