How to use the aerospike.Policy function in aerospike

To help you get started, we’ve selected a few aerospike examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aerospike / aerospike-client-nodejs / examples / info_cluster.js View on Github external
var env = require('./env')
var aerospike = require('aerospike')

var status = aerospike.Status
var policy = aerospike.Policy
var client = aerospike.client(env.config)
//Connect call is necessary for info_cluster call.
client = client.connect()

if (client === null)
{
    console.log("Client object is null \n ---Application Exiting --- ")
	process.exit(1)
}

/* infopolicy is an optional argument 
 * If infopolicy is not passed, default value is used 
 * */

var infopolicy = {
  timeout: 1,
github aerospike / aerospike-client-nodejs / examples / env.js View on Github external
var aerospike = require('aerospike')
var policy    = aerospike.Policy;
var log       = aerospike.Log;

// environment settings
var env = {
  host:       { addr: "192.168.5.102", port: 3000},
  namespace:  "test",
  set:        "demo",
  nops:       1000 * 1
};

// client settings
env.config = {
  // server address - host and port
  hosts: [ env.host ],
	log : {
		level : log.INFO
github aerospike / aerospike-client-nodejs / examples / put_get.js View on Github external
var env = require('./env')
var aerospike = require('aerospike')

var status = aerospike.Status
var policy = aerospike.Policy
var client = aerospike.client(env.config)
client = client.connect()
if (client === null)
{
    console.log("Client object is null \n ---Application Exiting --- ")
	process.exit(1)
}


var n = env.nops
var m = 0

console.time(n + " put+get")
for (var i = 0; i < n; i++ ) {

  var key0 = {