ICluster::ListAllJobsWithPaging method

Retrieves all jobs in the cluster. The jobs are returned in blocks of jobs from a specified snapshot of the cluster.

Syntax

HRESULT ListAllJobsWithPaging(
  [in]      VARIANT_BOOL       withTasks,
  [in, out] VARIANT            *Timestamp,
  [in, out] VARIANT            *Version,
  [in]      long               pageSize,
  [out]     IClusterEnumerable **pRetVal
);

Parameters

  • withTasks [in]
    Specify VARIANT_TRUE to retrieve only jobs that contain tasks; otherwise, VARIANT_FALSE.

  • Timestamp [in, out]
    The opaque value used by the method to track the jobs that have been returned. Set to NULL on first call. See Remarks for details.

  • Version [in, out]
    The opaque value used by the method to track the snapshot of the list. Set to NULL on first call. See Remarks for details.

  • pageSize [in]
    The number of jobs to retrieve. The minimum number of jobs to retrieve is 1, and the maximum is 10,000. If the value is outside this range, the method uses 10,000.

  • pRetVal [out]
    An IClusterEnumerable interface that contains the list of jobs. To retrieve the list of IJob interfaces, call the IClusterEnumerable::GetEnumerator method. The variant type of each item is VT_DISPATCH. Query the pdispVal member of the variant for the IJob interface. The enumerable object is empty when there are no jobs left to return.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the return value is an error code. To get a description of the error, call the ICluster::get_ErrorMessage method.

Remarks

If there are more than 2,000 jobs in the cluster or if your application requires quick response time, consider calling this method instead of calling the ICluster::ListAllJobs method.

This method is meant to be called in a loop. Set the Timestamp and Version parameters to NULL on the first call and do not change their values on subsequent calls. The first call takes a snapshot of the list of jobs and returns the requested number of jobs. The loop ends when the enumerable object is empty.

To get the delta of the jobs that were added or whose state has changed since the last snapshot, set the Version parameter to NULL, but leave the Timestamp parameter unchanged.

To reset the snapshot to the beginning, set the Timestamp parameter to NULL, but leave the Version parameter unchanged.

To determine the total number of jobs in the cluster, call the ICluster::get_ClusterCounter method and then the IClusterCounter::get_TotalNumberOfJobs method.

Requirements

Product

Compute Cluster Pack Client Utilities

Type library

Ccpapi.tlb

See also

ICluster

ICluster::ListAllJobs

ICluster::ListJobsWithPaging