All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Enumerations | Functions
as_job.h File Reference
#include <aerospike/aerospike.h>
+ Include dependency graph for as_job.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_job_info
 

Enumerations

enum  as_job_status { AS_JOB_STATUS_UNDEF, AS_JOB_STATUS_INPROGRESS, AS_JOB_STATUS_COMPLETED }
 

Functions

AS_EXTERN as_status aerospike_job_info (aerospike *as, as_error *err, const as_policy_info *policy, const char *module, uint64_t job_id, bool stop_if_in_progress, as_job_info *info)
 
AS_EXTERN as_status aerospike_job_wait (aerospike *as, as_error *err, const as_policy_info *policy, const char *module, uint64_t job_id, uint32_t interval_ms)
 

Enumeration Type Documentation

The status of a particular background scan.

Enumerator
AS_JOB_STATUS_UNDEF 

The job status is undefined. This is likely due to the status not being properly checked.

AS_JOB_STATUS_INPROGRESS 

The job is currently running.

AS_JOB_STATUS_COMPLETED 

The job completed successfully.

Definition at line 32 of file as_job.h.

Function Documentation

AS_EXTERN as_status aerospike_job_info ( aerospike as,
as_error err,
const as_policy_info policy,
const char *  module,
uint64_t  job_id,
bool  stop_if_in_progress,
as_job_info info 
)

Check the progress of a background job running on the database. The status of the job running on the datatabse will be populated in as_job_info.

uint64_t job_id = 1234;
as_job_info job_info;
if (aerospike_scan_info(&as, &err, NULL, "scan", job_id, &job_info) != AEROSPIKE_OK) {
fprintf(stderr, "error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
}
else {
printf("Scan id=%ll, status=%d percent=%d", job_id, job_info.status, job_info.progress_pct);
}
Parameters
asThe aerospike instance to use for this operation.
errThe as_error to be populated if an error occurs.
policyThe policy to use for this operation. If NULL, then the default policy will be used.
moduleBackground module. Values: scan | query
job_idJob ID.
stop_if_in_progressStop querying nodes if background job is still running.
infoInformation about this background job, to be populated by this operation.
Returns
AEROSPIKE_OK on success. Otherwise an error occurred.
AS_EXTERN as_status aerospike_job_wait ( aerospike as,
as_error err,
const as_policy_info policy,
const char *  module,
uint64_t  job_id,
uint32_t  interval_ms 
)

Wait for a background job to be completed by servers.

uint64_t job_id = 1234;
aerospike_job_wait(&as, &err, NULL, "scan", job_id, 0);
Parameters
asThe aerospike instance to use for this operation.
errThe as_error to be populated if an error occurs.
policyThe policy to use for this operation. If NULL, then the default policy will be used.
moduleBackground module. Values: scan | query
job_idJob ID.
interval_msPolling interval in milliseconds. If zero, 1000 ms is used.
Returns
AEROSPIKE_OK on success. Otherwise an error occurred.