private DataSink < T > setResources ( ResourceSpec resources ) { Preconditions . checkNotNull ( resources , "The resources must be not null." ) ; Preconditions . checkArgument ( resources . isValid ( ) , "The values in resources must be not less than 0." ) ; this . minResources = resources ; this . preferredResources = resources ; return this ; }
Sets the resources for this data sink and the minimum and preferred resources are the same by default .