aerospike
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -48,3 +48,2 @@ // ***************************************************************************** | ||
var RANGE_COUNT = 0 | ||
var ITERATION_COUNT = 0 | ||
@@ -291,3 +290,2 @@ | ||
memCnt = 0 | ||
RANGE_COUNT++ | ||
} | ||
@@ -294,0 +292,0 @@ |
@@ -105,3 +105,3 @@ // ***************************************************************************** | ||
} else { | ||
logger.info('worker connected: ' + client.config.hosts.map(function (host) { return host.addr + ':' + host.port })) | ||
logger.info('worker connected: ' + client.config.hosts) | ||
} | ||
@@ -108,0 +108,0 @@ }) |
@@ -0,1 +1,11 @@ | ||
v2.4.2 / 2016-11-10 | ||
=================== | ||
* **New Features** | ||
* Added constant enums `Aerospike.ttl` for "special" TTL values, incl. `DONT_UPDATE` value supported by Aerospike Server v3.10.1 and later. | ||
* **Bug Fixes** | ||
* Security Fix: Download C client using HTTPS and verify package checksum. [#153](https://github.com/aerospike/aerospike-client-nodejs/issues/153) Thanks to [Adam Baldwin](https://github.com/evilpacket) of [@liftsecurity](https://github.com/liftsecurity) for the report! | ||
* Support for Ubuntu 16.10/17.04 in the C client download script. [#154](https://github.com/aerospike/aerospike-client-nodejs/issues/154) Thanks to [@kitex](https://github.com/kitex)! | ||
v2.4.1 / 2016-10-10 | ||
@@ -2,0 +12,0 @@ =================== |
@@ -64,3 +64,5 @@ // ***************************************************************************** | ||
* - `gen` – (optional) The generation (version) of the record. Must be an Integer. | ||
* - `ttl` – (optional) The time-to-live in seconds (expiration) of the record. Must be an Integer. | ||
* - `ttl` – (optional) The time-to-live in seconds (expiration) of the record. | ||
* Must be an Integer. There are a few "special" TTL values which are defined | ||
* under the {@link module:aerospike.ttl|ttl} property on the aerospike module. | ||
* | ||
@@ -373,2 +375,43 @@ * Example: | ||
/** | ||
* @summary Enumertion of special TTL (time-to-live) values. | ||
* | ||
* @description Instead of specifying a TTL in seconds, you can set the TTL | ||
* to one of these special values when creating or updating a record. | ||
* | ||
* @member {Object} ttl | ||
* @readonly | ||
* @static | ||
* | ||
* @property NAMESPACE_DEFAULT - Use the default TTL value for the namespace of the record. | ||
* @property NEVER_EXIRE - Never expire the record. | ||
* @property DONT_UPDATE - Update the record without changing the record's | ||
* TTL value. Requires Aerospike Server version 3.10.1 or later. | ||
* | ||
* @example | ||
* | ||
* const Aerospike = require('aerospike') | ||
* const Key = Aerospike.Key | ||
* | ||
* Aerospike.connect((error, client) => { | ||
* if (error) throw error | ||
* var key = new Key('test', 'demo', 'key1') | ||
* var record = { 'a': 1, 'b': 2 } | ||
* var meta = { ttl: 12345 } | ||
* var policy = { exists: Aerospike.policy.exists.CREATE_OR_REPLACE } | ||
* client.put(key, record, meta, policy, (error) => { | ||
* if (error) throw error | ||
* client.put(key, { c: 3 }, { ttl: Aerospike.ttl.DONT_UPDATE }, (error) => { | ||
* if (error) throw error | ||
* client.get(key, (error, record, meta) => { | ||
* if (error) throw error | ||
* console.log(record, meta) // => { a: 1, b: 2, c: 3 } { ttl: 12345, gen: 2 } | ||
* client.close() | ||
* }) | ||
* }) | ||
* }) | ||
* }) | ||
*/ | ||
this.ttl = as.ttl | ||
/** | ||
* Enumeration of predicate types. | ||
@@ -375,0 +418,0 @@ * @private |
@@ -72,6 +72,7 @@ // ***************************************************************************** | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listAppend('tags', 'orange'), | ||
* lists.append('tags', 'orange'), | ||
* op.read('tags') | ||
@@ -109,6 +110,7 @@ * ] | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listAppendItems('tags', ['orange', 'green']), | ||
* lists.appendItems('tags', ['orange', 'green']), | ||
* op.read('tags') | ||
@@ -147,6 +149,7 @@ * ] | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listInsert('tags', 2, 'orange'), | ||
* lists.insert('tags', 2, 'orange'), | ||
* op.read('tags') | ||
@@ -186,6 +189,7 @@ * ] | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listInsertItems('tags', 2, ['orange', 'green']), | ||
* lists.insertItems('tags', 2, ['orange', 'green']), | ||
* op.read('tags') | ||
@@ -227,3 +231,3 @@ * ] | ||
* var ops = [ | ||
* op.listPop('tags', 1) | ||
* lists.pop('tags', 1) | ||
* ] | ||
@@ -264,7 +268,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listPopRange('tags', 0, 2) | ||
* lists.popRange('tags', 0, 2) | ||
* ] | ||
@@ -305,7 +309,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listRemove('tags', 1) | ||
* lists.remove('tags', 1) | ||
* ] | ||
@@ -345,7 +349,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listRemoveRange('tags', 0, 2) | ||
* lists.removeRange('tags', 0, 2) | ||
* ] | ||
@@ -384,7 +388,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listClear('tags') | ||
* lists.clear('tags') | ||
* ] | ||
@@ -422,7 +426,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listSet('tags', 1, 'green') | ||
* lists.set('tags', 1, 'green') | ||
* ] | ||
@@ -463,7 +467,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listTrim('tags', 1, 1) | ||
* lists.trim('tags', 1, 1) | ||
* ] | ||
@@ -503,7 +507,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listGet('tags', 0) | ||
* lists.get('tags', 0) | ||
* ] | ||
@@ -543,7 +547,7 @@ * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listGetRange('tags', 1) | ||
* lists.getRange('tags', 1) | ||
* ] | ||
@@ -588,7 +592,7 @@ * | ||
// * const Aerospike = require('aerospike') | ||
// * const op = Aerospike.operator | ||
// * const lists = Aerospike.lists | ||
// * const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
// * | ||
// * var ops = [ | ||
// * op.listIncrement('counters', 1, 3) | ||
// * lists.increment('counters', 1, 3) | ||
// * ] | ||
@@ -628,7 +632,7 @@ // * | ||
* const Aerospike = require('aerospike') | ||
* const op = Aerospike.operator | ||
* const lists = Aerospike.lists | ||
* const key = new Aerospike.Key('test', 'demo', 'mykey1') | ||
* | ||
* var ops = [ | ||
* op.listSize('tags') | ||
* lists.size('tags') | ||
* ] | ||
@@ -635,0 +639,0 @@ * |
{ | ||
"name": "aerospike", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "Aerospike Client Library", | ||
@@ -5,0 +5,0 @@ "tags": [ |
@@ -17,3 +17,3 @@ // ***************************************************************************** | ||
/* global after, afterEach, before, beforeEach, context, expect, describe, it */ | ||
/* global context, expect, describe, it */ | ||
@@ -27,12 +27,5 @@ const Aerospike = require('../lib/aerospike') | ||
describe('Client#isConnected', function () { | ||
var client = null | ||
beforeEach(function () { | ||
client = new Client(helper.config) | ||
}) | ||
afterEach(function () { | ||
client.close(false) | ||
}) | ||
context('without tender health check', function () { | ||
it('returns false if the client is not connected', function () { | ||
var client = new Client(helper.config) | ||
expect(client.isConnected(false)).to.be(false) | ||
@@ -42,4 +35,6 @@ }) | ||
it('returns true if the client is connected', function (done) { | ||
var client = new Client(helper.config) | ||
client.connect(function () { | ||
expect(client.isConnected(false)).to.be(true) | ||
client.close(false) | ||
done() | ||
@@ -50,2 +45,3 @@ }) | ||
it('returns false after the connection is closed', function (done) { | ||
var client = new Client(helper.config) | ||
client.connect(function () { | ||
@@ -60,7 +56,5 @@ client.close(false) | ||
context('with tender health check', function () { | ||
var orig = null | ||
before(function () { orig = client.as_client.isConnected }) | ||
after(function () { client.as_client.isConnected = orig }) | ||
it("calls the Aerospike C client library's isConnected() method", function (done) { | ||
var client = new Client(helper.config) | ||
var orig = client.as_client.isConnected | ||
client.connect(function () { | ||
@@ -71,2 +65,4 @@ var tenderHealthCheck = false | ||
expect(tenderHealthCheck).to.be(true) | ||
client.as_client.isConnected = orig | ||
client.close(false) | ||
done() | ||
@@ -76,13 +72,13 @@ }) | ||
}) | ||
}) | ||
context('cluster name', function () { | ||
it('should fail to connect to the cluster if the cluster name does not match', function (done) { | ||
var config = extend({}, helper.config) | ||
config.clusterName = 'notAValidClusterName' | ||
client = new Client(config) | ||
client.connect(function (err) { | ||
expect(err.code).to.be(Aerospike.status.AEROSPIKE_ERR_CLIENT) | ||
done() | ||
}) | ||
context('cluster name', function () { | ||
it('should fail to connect to the cluster if the cluster name does not match', function (done) { | ||
var config = extend({}, helper.config) | ||
config.clusterName = 'notAValidClusterName' | ||
var client = new Client(config) | ||
client.connect(function (err) { | ||
expect(err.code).to.be(Aerospike.status.AEROSPIKE_ERR_CLIENT) | ||
client.close(false) | ||
done() | ||
}) | ||
@@ -89,0 +85,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
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
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
1395563
205
18434