public static boolean isPoolMatchesCapacityForThinProvisioning(StoragePool pool,long requestedCapacityInKB,long preAllocationSize,CoordinatorClient coordinator){
  if (!isThinPoolLessUtilized(pool,preAllocationSize,coordinator)) {
    String msg=String.format("Thin pool %s is not matching as it will have utilization of %s percent after allocation. Pool's max utilization percentage is %s percent .",pool.getId(),100 - getThinPoolFreeCapacityPercentage(pool,preAllocationSize),getMaxPoolUtilizationPercentage(pool,coordinator));
    _log.info(msg);
    return false;
  }
  if (!isThinPoolLessSubscribed(pool,requestedCapacityInKB,coordinator)) {
    String msg=String.format("Thin pool %s is not matching as it will have %s percent subscribed after allocation. Pool's max subscription percentage is %s percent .",pool.getId(),getThinPoolSubscribedCapacityPercentage(pool,requestedCapacityInKB),getMaxPoolSubscriptionPercentage(pool,coordinator));
    _log.info(msg);
    return false;
  }
  return true;
}

public static boolean isPoolMatchesCapacityForThinProvisioning ( StoragePool pool , long requestedCapacityInKB , long preAllocationSize , CoordinatorClient coordinator ) { if ( ! isThinPoolLessUtilized ( pool , preAllocationSize , coordinator ) ) { String msg = String . format ( "Thin pool %s is not matching as it will have utilization of %s percent after allocation. Pool's max utilization percentage is %s percent ." , pool . getId ( ) , 100 - getThinPoolFreeCapacityPercentage ( pool , preAllocationSize ) , getMaxPoolUtilizationPercentage ( pool , coordinator ) ) ; _log . info ( msg ) ; return false ; } if ( ! isThinPoolLessSubscribed ( pool , requestedCapacityInKB , coordinator ) ) { String msg = String . format ( "Thin pool %s is not matching as it will have %s percent subscribed after allocation. Pool's max subscription percentage is %s percent ." , pool . getId ( ) , getThinPoolSubscribedCapacityPercentage ( pool , requestedCapacityInKB ) , getMaxPoolSubscriptionPercentage ( pool , coordinator ) ) ; _log . info ( msg ) ; return false ; } return true ; }
check whether thin pool matches with the pool capacity requirement or not . formulae : [ ispoollessutilized & & ispoollesssubscribed ]
