aerospike
Advanced tools
Comparing version 1.0.34 to 1.0.35
@@ -19,4 +19,4 @@ # Client Class | ||
- [Methods](#methods) | ||
- [batch_exists()](#batch_exists) | ||
- [batch_get()](#batch_get) | ||
- [batchExists()](#batchExists) | ||
- [batchGet()](#batchGet) | ||
- [close()](#close) | ||
@@ -47,6 +47,6 @@ - [connect()](#connect) | ||
################################################################################ | ||
batch_exists() | ||
batchExists() | ||
################################################################################ | ||
--> | ||
<a name="batch_exists"></a> | ||
<a name="batchExists"></a> | ||
@@ -102,6 +102,6 @@ ### batchExists(keys, policy=null, callback) | ||
################################################################################ | ||
batch_get() | ||
batchGet() | ||
################################################################################ | ||
--> | ||
<a name="batch_get"></a> | ||
<a name="batchGet"></a> | ||
@@ -108,0 +108,0 @@ ### batchGet(keys, policy=null, callback) |
@@ -11,2 +11,6 @@ # Configuration | ||
var config = { | ||
// username and password must be passed only to cluster with security feature enabled. | ||
// security feature is available only in Enterprise edition of Aerospike. | ||
user: "username", | ||
password: "password", | ||
hosts: [ | ||
@@ -38,3 +42,9 @@ // add three nodes in the cluster. | ||
## Configuration Attributes | ||
### `username` attribute | ||
User authentication to cluster. Leave empty for clusters running without restricted access. | ||
### `password` Attribute | ||
Password authentication to cluster. The hashed value of the password will be stored by the client | ||
and sent to server in same format. Leave empty for clusters running without restricted access. | ||
### `hosts` attribute | ||
@@ -41,0 +51,0 @@ |
@@ -13,3 +13,3 @@ # Operators | ||
op.append('a', 'world'), | ||
op.increment('b',10), | ||
op.incr('b',10), | ||
op.read('a'), | ||
@@ -53,3 +53,3 @@ op.read('b') | ||
### increment(bin, value) | ||
### incr(bin, value) | ||
@@ -64,3 +64,3 @@ Add the value to the bin. The bin must contain an Integer. | ||
```js | ||
op.increment('b', 10) | ||
op.incr('b', 10) | ||
``` | ||
@@ -67,0 +67,0 @@ |
@@ -135,3 +135,9 @@ /******************************************************************************* | ||
******************************************************************************/ | ||
aerospike.client(config).connect(function (err, client) { | ||
var client = aerospike.client(config) | ||
if(client == null) | ||
{ | ||
console.error("Error: Client object not initialized"); | ||
process.exit(1); | ||
} | ||
client.connect(function (err, client) { | ||
@@ -138,0 +144,0 @@ |
@@ -129,2 +129,7 @@ /******************************************************************************* | ||
var client = aerospike.client(config); | ||
if(client == null) | ||
{ | ||
console.error("Client object not initialized"); | ||
process.exit(1); | ||
} | ||
client.connect(function (err, client) { | ||
@@ -131,0 +136,0 @@ |
@@ -238,2 +238,7 @@ var as = require('../build/Release/aerospike.node') | ||
var client = as.client(config); | ||
if( client === null) | ||
{ | ||
console.error("Error in client object creation"); | ||
return client; | ||
} | ||
var proto = Object.getPrototypeOf(client); | ||
@@ -240,0 +245,0 @@ |
{ | ||
"name" : "aerospike", | ||
"version" : "1.0.34", | ||
"version" : "1.0.35", | ||
"description" : "Aerospike Client Library", | ||
@@ -5,0 +5,0 @@ "tags" : [ "aerospike", "database", "nosql" ], |
@@ -327,4 +327,14 @@ # Aerospike Node.js Client | ||
$ PREFIX=~/aerospike-client-c/target/Linux-x86_64 npm install | ||
$ export PREFIX=~/aerospike-client-c/target/Linux-x86_64 | ||
When Aerospike C Client is resolved through the environment variable PREFIX, | ||
the location to lua files that comes with C client installation must also be specified. | ||
Specifying lua file location is done using environment variable `AEROSPIKE_LUA_PATH=<PATH>`. | ||
The `<PATH>` must be a path to a directory containing files `aerospike.lua` and `as.lua`. | ||
The following is an example of specifying `AEROSPIKE_LUA_PATH` and then installing. | ||
$ export AEROSPIKE_LUA_PATH=/opt/aerospike/sys/udf/lua/ | ||
$ npm install | ||
<a name="Tests"></a> | ||
@@ -331,0 +341,0 @@ ## Tests |
@@ -57,3 +57,3 @@ /******************************************************************************* | ||
var LList = client.LargeList(listkey, "ldt_list_bin", writepolicy); | ||
var ldtEnabled = true; | ||
before(function(done) { | ||
@@ -63,3 +63,17 @@ client.connect(function(err){ | ||
expect(err.code).to.equal(status.AEROSPIKE_OK); | ||
done(); | ||
var ns = "namespace/" + options.namespace.toString(); | ||
client.info( ns, {addr:options.host, port: options.port}, | ||
function(err, response, host){ | ||
var nsConfig = response.split(";") | ||
for (var i = 0; i < nsConfig.length; i++) | ||
{ | ||
if(nsConfig[i].search("ldt-enabled=false") >= 0) | ||
{ | ||
ldtEnabled = false; | ||
console.log("Skipping LDT test cases"); | ||
break; | ||
} | ||
} | ||
done(); | ||
}); | ||
}); | ||
@@ -72,7 +86,14 @@ }); | ||
LList.destroy(function(err, val) { | ||
expect(err).to.be.ok(); | ||
expect(err.code).to.equal(status.AEROSPIKE_OK); | ||
client.close(); | ||
client = null; | ||
done(); | ||
if(ldtEnabled) | ||
{ | ||
expect(err).to.be.ok(); | ||
expect(err.code).to.equal(status.AEROSPIKE_OK); | ||
client.close(); | ||
client = null; | ||
done(); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
@@ -83,2 +104,4 @@ | ||
it('should add an element of type integer to the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var igen = valgen.integer(); | ||
@@ -99,4 +122,11 @@ var listval = igen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should add an element of type string to the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var sgen = valgen.string(); | ||
@@ -117,4 +147,11 @@ var listval = sgen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should add an element of type bytes to the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var bgen = valgen.bytes(); | ||
@@ -135,4 +172,11 @@ var listval = bgen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should add an element of type array to the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var agen = valgen.array(); | ||
@@ -153,4 +197,11 @@ var listval = agen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should add an element of type map to the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var mgen = valgen.map(); | ||
@@ -171,4 +222,11 @@ var listval = mgen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should add an array of values to LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var mgen = valgen.map(); | ||
@@ -206,4 +264,11 @@ var agen = valgen.array(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify that passing wrong number of arguments to add API fails gracefully', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var igen = valgen.integer(); | ||
@@ -217,5 +282,12 @@ var listval = igen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should update an element in the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var igen = valgen.integer(); | ||
@@ -236,4 +308,11 @@ var listval = igen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should update an array of values in the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var mgen = valgen.map(); | ||
@@ -270,4 +349,11 @@ var agen = valgen.array(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify that passing wrong number of arguments to update API fails gracefully', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var igen = valgen.integer(); | ||
@@ -281,5 +367,12 @@ var listval = igen(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the find API of LList -finds an existing element', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
//find an element in the list. | ||
@@ -292,4 +385,11 @@ LList.find({"key":"intvalue"}, function(err, val) { | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the find API of LList -finds a non-existing element and fails', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
//find an element in the list. | ||
@@ -301,6 +401,12 @@ LList.find({"key":"novalue"}, function(err, val) { | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}) | ||
it('should verify the range API of LList- expected to find existing elements', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.findRange("arraybytesvalue", "arraystrvalue", function(err, val) { | ||
@@ -312,5 +418,11 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the range API of LList- expected to not find any elements', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.findRange("zbytesvalue", "zstrvalue", function(err, val) { | ||
@@ -322,5 +434,11 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the size API of LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.size(function(err, val) { | ||
@@ -332,5 +450,11 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify that size API fails gracefully when passing wrong number of arguments', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.size(2, function(err, val) { | ||
@@ -341,5 +465,11 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the getCapacity and setCapacity API of LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var capacity = 25; | ||
@@ -356,5 +486,11 @@ LList.setCapacity(capacity, function(err, val) { | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the getCapacity and setCapacity API fails gracefully when wrong number of arguments are passed', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var capacity = 25; | ||
@@ -370,6 +506,12 @@ LList.setCapacity(capacity, 24, function(err, val) { | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the scan API of LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.scan(function(err, val) { | ||
@@ -381,5 +523,11 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify the scan API fails gracefully when wrong number of arguments are passed', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.scan("scan", function(err, val) { | ||
@@ -390,5 +538,12 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should remove an element from the LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var intval = {"key":"intvalue"} | ||
@@ -411,4 +566,11 @@ // remove the integer value into the list. | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should remove an array of elements from LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
var bytesval = {"key": "bytesvalue"} | ||
@@ -431,5 +593,11 @@ var stringval = {"key":"stringvalue"} | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify remove API fails when invalid number of arguments are passed', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
// remove an array of elements from the list. | ||
@@ -441,5 +609,12 @@ LList.remove("list", 123, function(err, retVal){ | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify removing a range of values in LList ', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.removeRange("arraybytesvalue", "arraystrvalue", function(err, retVal){ | ||
@@ -460,5 +635,11 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
it('should verify removeRange API fails when invalid number of arguments are passed', function(done) { | ||
if(ldtEnabled) | ||
{ | ||
LList.removeRange("list", 123, 345, function(err, retVal){ | ||
@@ -469,4 +650,8 @@ expect(err).to.be.ok(); | ||
}); | ||
} | ||
else | ||
{ | ||
done(); | ||
} | ||
}); | ||
}); |
@@ -68,3 +68,13 @@ /******************************************************************************* | ||
describe: "Set for the keys." | ||
} | ||
}, | ||
user: { | ||
alias: "u", | ||
default:"admin", | ||
describe: "Username to connect to a secure cluster" | ||
}, | ||
password: { | ||
alias: "p", | ||
default: "admin", | ||
describe: "Password to connect to a secure cluster" | ||
} | ||
}); | ||
@@ -71,0 +81,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
875356
9941
378