@ Nullable private MaintenanceOp getNextMaintenanceOp ( final TableJson json , boolean includeTask ) { if ( json . isDeleted ( ) || json . getStorages ( ) . isEmpty ( ) ) { return null ; } // Loop through the table uuids and pick the MaintenanceOp that should execute first, with the minimum "when". MaintenanceOp op = NULLS_LAST . min ( Iterables . transform ( json . getStorages ( ) , new Function < Storage , MaintenanceOp > ( ) { @ Override public MaintenanceOp apply ( Storage storage ) { return getNextMaintenanceOp ( json , storage ) ; } } ) ) ; // Don't expose the MaintenanceOp Runnable to most callers. It may only be run from the right data center // and with the right locks in place so it's best to not leak it to where it may be called accidentally. if ( op != null && ! includeTask ) { op . clearTask ( ) ; } return op ; }
Returns the next maintenance operation that should be performed on the specified table .