Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
log: {
level: argv['log-level'],
file: argv['log-file'] ? fs.openSync(argv['log-file'], 'a') : 2
},
policies: {
timeout: argv.timeout
},
user: argv.user,
password: argv.password
}
// *****************************************************************************
// Perform the operation
// *****************************************************************************
Aerospike.connect(config, function (err, client) {
if (err) {
console.error('Error: Aerospike server connection error. ', err.message)
process.exit(1)
}
//
// Perform the operation
//
const maxConcurrent = 200
var inFlight = 0
function removeDone (client, start, end, skip) {
var total = end - start + 1
var done = 0
var success = 0
log: {
level: argv['log-level'],
file: argv['log-file'] ? fs.openSync(argv['log-file'], 'a') : 2
},
policies: {
timeout: argv.timeout
},
user: argv.user,
password: argv.password
}
// *****************************************************************************
// Perform the operation
// *****************************************************************************
Aerospike.connect(config, function (err, client) {
if (err) {
console.error('Error: Aerospike server connection error. ', err.message)
process.exit(1)
}
//
// Perform the operation
//
const maxConcurrent = 200
var inFlight = 0
function getDone (client, start, end, skip) {
var total = end - start + 1
var done = 0
var success = 0
log: {
level: argv['log-level'],
file: argv['log-file'] ? fs.openSync(argv['log-file'], 'a') : 2
},
policies: {
timeout: argv.timeout
},
user: argv.user,
password: argv.password
}
// *****************************************************************************
// Perform the operation
// *****************************************************************************
Aerospike.connect(config, function (err, client) {
if (err) {
console.error('Error: Aerospike server connection error. ', err.message)
process.exit(1)
}
//
// Perform the operation
//
const maxConcurrent = 200
var inFlight = 0
function putDone (client, start, end) {
var total = end - start + 1
var done = 0
var timeLabel = 'range_put @ ' + total
user: argv.user,
password: argv.password
}
// *****************************************************************************
// Perform the operation
// *****************************************************************************
function run (client, done) {
client.query(argv.namespace, argv.set).info(scanId, function (res) {
!argv.quiet && console.log(JSON.stringify(res, null, ' '))
done()
})
}
Aerospike.connect(config, function (err, client) {
if (err) throw err
run(client, function () {
client.close()
})
})
},
policies: {
timeout: argv.timeout
},
modllua: {
userPath: __dirname
},
user: argv.user,
password: argv.password
}
// *****************************************************************************
// Establish a connection to the cluster.
// *****************************************************************************
Aerospike.connect(config, function (err, client) {
if (err) throw err
var scan = client.query(argv.namespace, argv.set)
scan.background('scan', 'updateRecord', function (error, job) {
if (error) throw error
var timer = setInterval(function () {
job.info((error, info) => {
if (error) {
console.info('Error checking background scan status:', error)
clearInterval(timer)
client.close()
} else if (info.status === Aerospike.jobStatus.COMPLETED) {
console.info('Scan completed')
clearInterval(timer)
client.close()
password: argv.password
}
// *****************************************************************************
// Perform the operation
// *****************************************************************************
var checkError = function (err, msg) {
if (err) {
console.error(err)
} else {
console.log(msg)
}
}
Aerospike.connect(config, function (err, client) {
if (err) throw err
// Get a largelist object from client.
var listkey = new Aerospike.Key(argv.namespace, argv.set, 'ldt_list_key')
var policy = { timeout: 1000 }
var list = client.LargeList(listkey, 'ldt_list_bin', policy)
// perform all the largelist operations.
// add single value to the list.
var val = 'listvalsingle'
list.add(val, function (err, val) {
checkError(err, 'Added a single value')
})
// update single value added to the list.
// *****************************************************************************
// Perform the operation
// *****************************************************************************
function run (client, done) {
client.udfRegister(file, function (err, job) {
if (err) throw err
job.waitUntilDone(function (err) {
if (err) throw err
!argv.quiet && console.log('UDF module registered successfully: %s', file)
done()
})
})
}
Aerospike.connect(config, function (err, client) {
if (err) throw err
run(client, function () {
client.close()
})
})
// *****************************************************************************
// Perform the operation
// *****************************************************************************
function run (client, done) {
client.udfRemove(module, function (err, job) {
if (err) throw err
job.waitUntilDone(function (err) {
if (err) throw err
!argv.quiet && console.log('UDF module removed successfully: %s', module)
done()
})
})
}
Aerospike.connect(config, function (err, client) {
if (err) throw err
run(client, function () {
client.close()
})
})
log: {
level: argv['log-level'],
file: argv['log-file'] ? fs.openSync(argv['log-file'], 'a') : 2
},
policies: {
timeout: argv.timeout
},
user: argv.user,
password: argv.password
}
// *****************************************************************************
// Perform the operation
// *****************************************************************************
Aerospike.connect(config, function (err, client) {
if (err) throw err
//
// Perform the operation
//
const maxConcurrent = 200
var inFlight = 0
function existsDone (client, start, end, skip) {
var total = end - start + 1
var done = 0
var success = 0
var notfound = 0
var failure = 0
var skipped = 0
return removeIndex(client, done)
}
var key = new Key(argv.namespace, argv.set, ndx)
client.remove(key, function (err, key) {
if (err && err.code !== status.ERR_RECORD_NOT_FOUND) throw err
removeRecords(client, ndx + 1, end, done)
})
}
function cleanup (client, done) {
removeRecords(client, 0, numberOfRecords, done)
}
Aerospike.connect(config, function (err, client) {
if (err) throw err
createIndex(client, function () {
client.close()
})
})