public PaginatedResult<Flow> getPaginatedFlowsForStatus(String cluster,
      Flow.Status status, int limit, String user, byte[] startRow)
      throws IOException {
    // retrieve one more flow than requested for pagination support
    List<Flow> flows =
        getFlowsForStatus(cluster, status, limit + 1, user, startRow);
    PaginatedResult<Flow> result = new PaginatedResult<Flow>(limit);
    if (flows.size() > limit) {
      result.setValues(flows.subList(0, limit));
      Flow lastFlow = flows.get(limit);
      result.setNextStartRow(queueKeyConverter.toBytes(lastFlow.getQueueKey()));
    } else {
      result.setValues(flows);
    }
    return result;
  }
public PaginatedResult < Flow > getPaginatedFlowsForStatus ( String cluster , Flow . Status status , int limit , String user , byte [ ] startRow ) throws IOException { List < Flow > flows = getFlowsForStatus ( cluster , status , limit + 1 , user , startRow ) ; PaginatedResult < Flow > result = new PaginatedResult < Flow > ( limit ) ; if ( flows . size ( ) > limit ) { result . setValues ( flows . subList ( 0 , limit ) ) ; Flow lastFlow = flows . get ( limit ) ; result . setNextStartRow ( queueKeyConverter . toBytes ( lastFlow . getQueueKey ( ) ) ) ; } else { result . setValues ( flows ) ; } return result ; }
Returns a page of flows for the given cluster and status
@param cluster The cluster for the flows' execution
@param status The flows' status
@param limit Maximum number of flows to retrieve
@param user Filter results to this user, if present
@param startRow Start pagination with this row (inclusive), if present
@return A page of Flow instances
@throws IOException In the case of an error retrieving results