Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).connect(function(response) {
// Check for errors
if ( response.code == aerospike.status.AEROSPIKE_OK ) {
// Connection succeeded
console.log("Connection to the Aerospike cluster succeeded!");
}
else {
// Connection failed
console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
process.exit(0);
}
});
}).connect(function(response) {
// Check for errors
if ( response.code == aerospike.status.AEROSPIKE_OK ) {
// Connection succeeded
console.log("Connection to the Aerospike cluster succeeded!");
}
else {
// Connection failed
console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
process.exit(0);
}
});
}).connect(function(response) {
// Check for errors
if ( response.code == aerospike.status.AEROSPIKE_OK ) {
// Connection succeeded
console.log("Connection to the Aerospike cluster succeeded!");
}
else {
// Connection failed
console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
process.exit(0);
}
});
}).connect(function(response) {
// Check for errors
if ( response.code == aerospike.status.AEROSPIKE_OK ) {
// Connection succeeded
console.log("Connection to the Aerospike cluster succeeded!");
}
else {
// Connection failed
console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
process.exit(0);
}
});
//
// Read records with keys in range 1-100, skipping every fifth
//
// node range_get --start 1 --end 100 --skip 5
//
// Write records with keys in range 900-1000
//
// node range_put --start 900
// *****************************************************************************
const fs = require('fs')
const Aerospike = require('aerospike')
const yargs = require('yargs')
const deasync = require('deasync')
const Status = Aerospike.status
// *****************************************************************************
// Options parsing
// *****************************************************************************
var argp = yargs
.usage('$0 [options]')
.options({
help: {
boolean: true,
describe: 'Display this message.'
},
host: {
alias: 'h',
default: process.env.AEROSPIKE_HOSTS || 'localhost:3000',
describe: 'Aerospike database address.'
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// *****************************************************************************
// *****************************************************************************
// Benchmark Worker, run operations and report results.
// *****************************************************************************
var aerospike = require('aerospike')
var cluster = require('cluster')
var util = require('util')
var winston = require('winston')
var stats = require('./stats')
var status = aerospike.status
var alerts = require('./alerts.js')
var argv = require('./config.json')
// *****************************************************************************
// MACROS
// *****************************************************************************
var OP_TYPES = 4 // READ, WRITE, QUERY and SCAN
var READ = 0
var WRITE = 1
var QUERY = 2
var SCAN = 3
var TPS = 0
var TIMEOUT = 1
var ERROR = 2
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// *****************************************************************************
// *****************************************************************************
// Write a record
// *****************************************************************************
const Aerospike = require('aerospike')
const fs = require('fs')
const yargs = require('yargs')
const status = Aerospike.status
const filter = Aerospike.filter
const GeoJSON = Aerospike.GeoJSON
const Key = Aerospike.Key
// *****************************************************************************
// Options parsing
// *****************************************************************************
var argp = yargs
.usage('$0 [options] key')
.options({
help: {
boolean: true,
describe: 'Display this message.'
},
host: {
//
// Read records with keys in range 1-100, skipping every fifth
//
// node range_get --start 1 --end 100 --skip 5
//
// Write records with keys in range 900-1000
//
// node range_put --start 900
// *****************************************************************************
const Aerospike = require('aerospike')
const fs = require('fs')
const yargs = require('yargs')
const deasync = require('deasync')
const Status = Aerospike.status
// *****************************************************************************
// Options parsing
// *****************************************************************************
var argp = yargs
.usage('$0 [options]')
.options({
help: {
boolean: true,
describe: 'Display this message.'
},
host: {
alias: 'h',
default: process.env.AEROSPIKE_HOSTS || 'localhost:3000',
describe: 'Aerospike database address.'
const request = {
key: new Aerospike.Key(argv.namespace, argv.set, key)
}
if (argv.bins) {
request.bins = argv.bins
} else {
request.read_all_bins = true
}
return request
})
const batchResults = await client.batchRead(batch)
for (const result of batchResults) {
const record = result.record
console.info(record.key.key, ':', result.status === Aerospike.status.OK
? record.bins : 'NOT FOUND')
}
}
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
/*******************************************************************************
*
* Write a record.
*
******************************************************************************/
var fs = require('fs');
var aerospike = require('aerospike');
var yargs = require('yargs');
var Policy = aerospike.policy;
var Status = aerospike.status;
/*******************************************************************************
*
* Options parsing
*
******************************************************************************/
var argp = yargs
.usage("$0 [options] ")
.options({
help: {
boolean: true,
describe: "Display this message."
},
profile: {
boolean: true,