aerospike
Advanced tools
Comparing version 5.2.1 to 5.2.2
@@ -370,3 +370,3 @@ // ***************************************************************************** | ||
* | ||
* @default 55 seconds | ||
* @default 0 seconds | ||
*/ | ||
@@ -398,3 +398,3 @@ if (Number.isInteger(config.maxSocketIdle)) { | ||
* | ||
* @default 300 | ||
* @default 100 | ||
*/ | ||
@@ -401,0 +401,0 @@ if (Number.isInteger(config.maxConnsPerNode)) { |
@@ -27,3 +27,3 @@ // ***************************************************************************** | ||
* For more information, please refer to the section on | ||
* <a href="http://www.aerospike.com/docs/guide/geospatial.html" title="Aerospike Geospatial Data Type">⇑Geospatial Data Type</a> | ||
* <a href="https://docs.aerospike.com/server/guide/data-types/geospatial" title="Aerospike Geospatial Data Type">⇑Geospatial Data Type</a> | ||
* in the Aerospike technical documentation. | ||
@@ -30,0 +30,0 @@ * |
@@ -71,2 +71,21 @@ // ***************************************************************************** | ||
this.infoTimeout = props.infoTimeout | ||
/** | ||
* Total transaction timeout in milliseconds. | ||
* | ||
* The <code>totalTimeout</code> is tracked on the client and sent to the | ||
* server along with the transaction in the wire protocol. The client will | ||
* most likely timeout first, but the server also has the capability to | ||
* timeout the transaction. | ||
* | ||
* If <code>totalTimeout</code> is not zero and <code>totalTimeout</code> | ||
* is reached before the transaction completes, the transaction will return | ||
* error {@link module:aerospike/status.ERR_TIMEOUT|ERR_TIMEOUT}. | ||
* If <code>totalTimeout</code> is zero, there will be no total time limit. | ||
* | ||
* @type number | ||
* @default 0 | ||
* @override | ||
*/ | ||
this.totalTimeout = props.totalTimeout | ||
} | ||
@@ -73,0 +92,0 @@ } |
@@ -75,2 +75,21 @@ // ***************************************************************************** | ||
this.maxRecords = props.maxRecords | ||
/** | ||
* Total transaction timeout in milliseconds. | ||
* | ||
* The <code>totalTimeout</code> is tracked on the client and sent to the | ||
* server along with the transaction in the wire protocol. The client will | ||
* most likely timeout first, but the server also has the capability to | ||
* timeout the transaction. | ||
* | ||
* If <code>totalTimeout</code> is not zero and <code>totalTimeout</code> | ||
* is reached before the transaction completes, the transaction will return | ||
* error {@link module:aerospike/status.ERR_TIMEOUT|ERR_TIMEOUT}. | ||
* If <code>totalTimeout</code> is zero, there will be no total time limit. | ||
* | ||
* @type number | ||
* @default 0 | ||
* @override | ||
*/ | ||
this.totalTimeout = props.totalTimeout | ||
} | ||
@@ -77,0 +96,0 @@ } |
@@ -27,11 +27,3 @@ // ***************************************************************************** | ||
// ======================================================================== | ||
// Constants | ||
// ======================================================================== | ||
/** | ||
* One or more keys failed in a batch. | ||
* @const {number} | ||
*/ | ||
exports.BATCH_FAILED = exports.AEROSPIKE_BATCH_FAILED = as.status.AEROSPIKE_BATCH_FAILED | ||
/** | ||
* Async command delay queue is full. | ||
@@ -38,0 +30,0 @@ * @const {number} |
{ | ||
"name": "aerospike", | ||
"version": "5.2.1", | ||
"version": "5.2.2", | ||
"description": "Aerospike Client Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -42,3 +42,3 @@ // ***************************************************************************** | ||
before(function () { | ||
const nrecords = 10 | ||
const nrecords = 17 | ||
const generators = { | ||
@@ -160,3 +160,3 @@ keygen: keygen.string(helper.namespace, helper.set, { prefix: 'test/batch_write/', random: false }), | ||
type: batchType.BATCH_READ, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/7'), | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/6'), | ||
readAllBins: true | ||
@@ -182,3 +182,3 @@ }] | ||
type: batchType.BATCH_READ, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/8'), | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/7'), | ||
readAllBins: true | ||
@@ -194,3 +194,3 @@ } | ||
.then(result => { | ||
expect(result.status).to.equal(Aerospike.status.OK) | ||
expect(result.status).to.equal(status.OK) | ||
expect(result.record).to.be.instanceof(Aerospike.Record) | ||
@@ -201,3 +201,3 @@ }) | ||
context('with exists.IGNORE ', function () { | ||
context('with exists.IGNORE returning callback', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
@@ -209,3 +209,3 @@ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/9'), | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/8'), | ||
ops: [ | ||
@@ -233,5 +233,34 @@ op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
context('with exists.CREATE ', function () { | ||
context('with exists.IGNORE returning promise', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function () { | ||
const batchRecords = [ | ||
{ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/9'), | ||
ops: [ | ||
op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
op.write('blob', Buffer.from('bar')) | ||
], | ||
policy: new Aerospike.BatchWritePolicy({ | ||
exists: Aerospike.policy.exists.IGNORE | ||
}) | ||
} | ||
] | ||
return client.batchWrite(batchRecords) | ||
.then(results => { | ||
return client.batchWrite(batchRecords) | ||
}) | ||
.then(results => { | ||
expect(results[0].status).to.equal(status.OK) | ||
}) | ||
}) | ||
}) | ||
context('with exists.CREATE returning callback', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the correct status and error value', function (done) { | ||
@@ -254,5 +283,5 @@ const batchRecords = [ | ||
client.batchWrite(batchRecords, function (error, results) { | ||
if (error) { error = null } | ||
if (error) throw error | ||
client.batchWrite(batchRecords, function (error, results) { | ||
expect(error.code).to.equal(status.BATCH_FAILED) | ||
expect(error).not.to.be.ok() | ||
expect(results[0].status).to.equal(status.ERR_RECORD_EXISTS) | ||
@@ -265,6 +294,6 @@ done() | ||
context('with exists.UPDATE ', function () { | ||
context('with exists.CREATE returning promise', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function (done) { | ||
it('returns the status whether each key was found or not', function () { | ||
const batchRecords = [ | ||
@@ -279,2 +308,30 @@ { | ||
policy: new Aerospike.BatchWritePolicy({ | ||
exists: Aerospike.policy.exists.CREATE | ||
}) | ||
} | ||
] | ||
return client.batchWrite(batchRecords) | ||
.then((results) => { | ||
return client.batchWrite(batchRecords) | ||
}) | ||
.then((results) => { | ||
expect(results[0].status).to.equal(status.ERR_RECORD_EXISTS) | ||
}) | ||
}) | ||
}) | ||
context('with exists.UPDATE return callback', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function (done) { | ||
const batchRecords = [ | ||
{ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/12'), | ||
ops: [ | ||
op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
op.write('blob', Buffer.from('bar')) | ||
], | ||
policy: new Aerospike.BatchWritePolicy({ | ||
exists: Aerospike.policy.exists.UPDATE | ||
@@ -286,4 +343,4 @@ }) | ||
client.remove(new Key(helper.namespace, helper.set, 'test/batch_write/11'), function (error, results) { | ||
if (error) { error = null } | ||
client.remove(new Key(helper.namespace, helper.set, 'test/batch_write/12'), function (error, results) { | ||
if (error) throw error | ||
client.batchWrite(batchRecords, function (error, results) { | ||
@@ -298,5 +355,34 @@ expect(error).not.to.be.ok() | ||
context('with exists.REPLACE ', function () { | ||
context('with exists.UPDATE returning promise', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function () { | ||
const batchRecords = [ | ||
{ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/13'), | ||
ops: [ | ||
op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
op.write('blob', Buffer.from('bar')) | ||
], | ||
policy: new Aerospike.BatchWritePolicy({ | ||
exists: Aerospike.policy.exists.UPDATE | ||
}) | ||
} | ||
] | ||
return client.remove(new Key(helper.namespace, helper.set, 'test/batch_write/13')) | ||
.then((results) => { | ||
return client.batchWrite(batchRecords) | ||
}) | ||
.then((results) => { | ||
expect(results[0].status).to.equal(status.ERR_RECORD_NOT_FOUND) | ||
}) | ||
}) | ||
}) | ||
context('with exists.REPLACE return callback', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function (done) { | ||
@@ -306,3 +392,3 @@ const batchRecords = [ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/12'), | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/14'), | ||
ops: [ | ||
@@ -319,4 +405,4 @@ op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
client.remove(new Key(helper.namespace, helper.set, 'test/batch_write/12'), function (error, results) { | ||
if (error) { error = null } | ||
client.remove(new Key(helper.namespace, helper.set, 'test/batch_write/14'), function (error, results) { | ||
if (error) throw error | ||
client.batchWrite(batchRecords, function (error, results) { | ||
@@ -331,5 +417,34 @@ expect(error).not.to.be.ok() | ||
context('with exists.CREATE_OR_REPLACE ', function () { | ||
context('with exists.REPLACE returning promise', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function () { | ||
const batchRecords = [ | ||
{ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/15'), | ||
ops: [ | ||
op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
op.write('blob', Buffer.from('bar')) | ||
], | ||
policy: new Aerospike.BatchWritePolicy({ | ||
exists: Aerospike.policy.exists.REPLACE | ||
}) | ||
} | ||
] | ||
return client.remove(new Key(helper.namespace, helper.set, 'test/batch_write/15')) | ||
.then((results) => { | ||
return client.batchWrite(batchRecords) | ||
}) | ||
.then((results) => { | ||
expect(results[0].status).to.equal(status.ERR_RECORD_NOT_FOUND) | ||
}) | ||
}) | ||
}) | ||
context('with exists.CREATE_OR_REPLACE return callback', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function (done) { | ||
@@ -339,3 +454,3 @@ const batchRecords = [ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/13'), | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/16'), | ||
ops: [ | ||
@@ -362,2 +477,31 @@ op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
}) | ||
context('with exists.CREATE_OR_REPLACE returning promise', function () { | ||
helper.skipUnlessVersion('>= 6.0.0', this) | ||
it('returns the status whether each key was found or not', function () { | ||
const batchRecords = [ | ||
{ | ||
type: batchType.BATCH_WRITE, | ||
key: new Key(helper.namespace, helper.set, 'test/batch_write/17'), | ||
ops: [ | ||
op.write('geo', new GeoJSON({ type: 'Point', coordinates: [123.456, 1.308] })), | ||
op.write('blob', Buffer.from('bar')) | ||
], | ||
policy: new Aerospike.BatchWritePolicy({ | ||
exists: Aerospike.policy.exists.CREATE_OR_REPLACE | ||
}) | ||
} | ||
] | ||
return client.batchWrite(batchRecords) | ||
.then((results) => { | ||
return client.batchWrite(batchRecords) | ||
}) | ||
.then((results) => { | ||
expect(results[0].status).to.equal(status.OK) | ||
}) | ||
}) | ||
}) | ||
}) |
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
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
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
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
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
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
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
37919
284992424