/** * <pre> * function to register the static remaining flow size filter. * NOTE : this is a static filter which means the filter will be filtering based on the system * standard which is not * Coming for the passed flow. * Ideally this filter will make sure only the executor hasn't reached the Max allowed # * of * executing flows. * </pre> */ private static FactorFilter<Executor, ExecutableFlow> getStaticRemainingFlowSizeFilter() { return FactorFilter .create(STATICREMAININGFLOWSIZE_FILTER_NAME, (filteringTarget, referencingObject) -> { if (null == filteringTarget) { logger.debug(String.format("%s : filtering out the target as it is null.", STATICREMAININGFLOWSIZE_FILTER_NAME)); return false; } final ExecutorInfo stats = filteringTarget.getExecutorInfo(); if (null == stats) { logger.debug(String.format("%s : filtering out %s as it's stats is unavailable.", STATICREMAININGFLOWSIZE_FILTER_NAME, filteringTarget.toString())); return false; } return stats.getRemainingFlowCapacity() > 0; }); }
/** * <pre> * function to register the static remaining flow size filter. * NOTE : this is a static filter which means the filter will be filtering based on the system * standard which is not * Coming for the passed flow. * Ideally this filter will make sure only the executor hasn't reached the Max allowed # * of * executing flows. * </pre> */ private static FactorFilter<Executor, ExecutableFlow> getStaticRemainingFlowSizeFilter() { return FactorFilter .create(STATICREMAININGFLOWSIZE_FILTER_NAME, (filteringTarget, referencingObject) -> { if (null == filteringTarget) { logger.debug(String.format("%s : filtering out the target as it is null.", STATICREMAININGFLOWSIZE_FILTER_NAME)); return false; } final ExecutorInfo stats = filteringTarget.getExecutorInfo(); if (null == stats) { logger.debug(String.format("%s : filtering out %s as it's stats is unavailable.", STATICREMAININGFLOWSIZE_FILTER_NAME, filteringTarget.toString())); return false; } return stats.getRemainingFlowCapacity() > 0; }); }