aerospike/info

Description:
  • The info protocol provides access to configuration and statistics for the Aerospike server. This module provides the parse utility function for parsing the info data returned by the Aerospike server.

Source:
See:

The info protocol provides access to configuration and statistics for the Aerospike server. This module provides the parse utility function for parsing the info data returned by the Aerospike server.

Example

const Aerospike = require('aerospike')

// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
  hosts: '192.168.33.10:3000',
}
Aerospike.connect(config, (error, client) => {
  if (error) throw error

  var cmd = 'build\nfeatures'
  client.infoAny(cmd, (err, infoStr) => {
    if (err) {
      console.error('error retrieving info for cmd "%s": %s [%d]',
      cmd, err.message, err.code)
    } else {
      var info = Aerospike.info.parse(infoStr)
      console.log(info) // => { build: '3.12.0',
                        //      features: [
                        //        'cdt-list',
                        //        'pipelining',
                        //        'geo',
                        //        ...,
                        //        'udf' ] }
    }
    client.close()
  })
})

Methods

(static) parse(info) → {Object}

Parses the info string returned from a cluster node into key-value pairs.

Source:
Since:
  • v2.6
Parameters:
Name Type Description
info string

The info string returned by the cluster node.

Returns:

key-value pairs

Type
Object