lib/connect-aerospike.js
function AerospikeStore(options){
    var self = this;
    options = options || {};
    Store.call(self,options);

    self.prefix = null == options.prefix ? _default_prefix : options.prefix;
    self.ns = null == options.ns ? _default_ns : options.ns;
    self.st = null == options.st ? _default_set : options.st;
    self.ttl = null == options.ttl ? _default_ttl : options.ttl;

    if(!options.hosts || options.hosts.length<=0){
      options.hosts = [_default_host];
    }

    if(options.hosts){
      var hosts = options.hosts.map(function(host){
        var _val = host.split(':');
        var _host = _val[0];
        var _port = ~~_val[1] || _default_port;
        return { addr:_host,port:_port};
      });
      var timeout = (typeof options.timeout === 'number' ? options.timeout : _default_timeout);
      aerospike.client({
        hosts:hosts,
        log:{
          level: _default_log_level
        },
        policies:{
          timeout: timeout
        }
      }).connect(function(err,client){
        if(err && err.code !== aerospike.status.AEROSPIKE_OK){
          console.error('Aerospike server connection Error : %j',err);
        }else{
          self.client = client;
        }
      });
    }
  }
function AerospikeStore(options){
    var self = this;
    options = options || {};
    Store.call(self,options);

    self.prefix = null == options.prefix ? _default_prefix : options.prefix;
    self.ns = null == options.ns ? _default_ns : options.ns;
    self.st = null == options.st ? _default_set : options.st;
    self.ttl = null == options.ttl ? _default_ttl : options.ttl;

    if(!options.hosts || options.hosts.length<=0){
      options.hosts = [_default_host];
    }

    if(options.hosts){
      var hosts = options.hosts.map(function(host){
        var _val = host.split(':');
        var _host = _val[0];
        var _port = ~~_val[1] || _default_port;
        return { addr:_host,port:_port};
      });
      var timeout = (typeof options.timeout === 'number' ? options.timeout : _default_timeout);
      aerospike.client({
        hosts:hosts,
        log:{
          level: _default_log_level
        },
        policies:{
          timeout: timeout
        }
      }).connect(function(err,client){
        if(err && err.code !== aerospike.status.AEROSPIKE_OK){
          console.error('Aerospike server connection Error : %j',err);
        }else{
          self.client = client;
        }
      });
    }
  }
function AerospikeStore ( options ) { var self = this ; options = options || { } ; Store . call ( self , options ) ; self . prefix = null == options . prefix ? _default_prefix : options . prefix ; self . ns = null == options . ns ? _default_ns : options . ns ; self . st = null == options . st ? _default_set : options . st ; self . ttl = null == options . ttl ? _default_ttl : options . ttl ; if ( ! options . hosts || options . hosts . length <= 0 ) { options . hosts = [ _default_host ] ; } if ( options . hosts ) { var hosts = options . hosts . map ( function ( host ) { var _val = host . split ( ':' ) ; var _host = _val [ 0 ] ; var _port = ~ ~ _val [ 1 ] || _default_port ; return { addr : _host , port : _port } ; } ) ; var timeout = ( typeof options . timeout === 'number' ? options . timeout : _default_timeout ) ; aerospike . client ( { hosts : hosts , log : { level : _default_log_level } , policies : { timeout : timeout } } ) . connect ( function ( err , client ) { if ( err && err . code !== aerospike . status . AEROSPIKE_OK ) { console . error ( 'Aerospike server connection Error : %j' , err ) ; } else { self . client = client ; } } ) ; } }
Initialize AerospikeStore with the given options

pparam {Object} options
@api public
Initialize AerospikeStore with the given options