Identification number asssociated with the Job.
Database command associated with the Job. query
and scan
are the possible values`
Check the progress of a background job running on the database.
Optional
policy: policy.InfoPolicyThe Info Policy to use for this command.
A Promise that resolves to the job info.
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
// Timeouts disabled, latency dependent on server location. Configure as needed.
policies: {
scan : new Aerospike.ScanPolicy({socketTimeout : 0, totalTimeout : 0}),
}
}
Aerospike.connect(config, (error, client) => {
if (error) throw error
var scan = client.scan('test', 'demo')
scan.background('myUdfModule', 'myUdfFunction', (error, job) => {
if (error) throw error
var timer = setInterval(() => {
job.info((error, info) => {
if (error) throw error
console.info('scan status: %d (%d%% complete, %d records scanned)', info.status, info.progressPct, info.recordsRead)
if (info.status === Aerospike.jobStatus.COMPLETED) {
console.info('scan completed!')
clearInterval(timer)
client.close()
}
})
}, 1000)
})
})
The function to call with the job info response.
The Info Policy to use for this command.
The function to call with the job info response.
Wait until the task has been completed.
Optional
pollInterval: numberInterval in milliseconds to use when polling the cluster nodes. Default is 1000 (ms)
A Promise that resolves once the job is completed.
The function to call when the task has completed.
Interval in milliseconds to use when polling the cluster nodes. Default is 1000 (ms)
The function to call when the task has completed.
Optional
pollInterval: numberInterval in milliseconds to use when polling the cluster nodes. Default is 1000 (ms)
A Promise that resolves to the job info.
The function to call with the job info response.
Interval in milliseconds to use when polling the cluster nodes. Default is 1000 (ms)
The function to call with the job info response.
Potentially long-running background job.
See