[Groonga-commit] droonga/express-droonga at c3fc7d7 [master] Accept non-formatted value as node name of the Serf agent

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Nov 5 12:00:37 JST 2014


YUKI Hiroshi	2014-11-05 12:00:37 +0900 (Wed, 05 Nov 2014)

  New Revision: c3fc7d7f16ce25d29a3024611b315bb9440ab8ac
  https://github.com/droonga/express-droonga/commit/c3fc7d7f16ce25d29a3024611b315bb9440ab8ac

  Message:
    Accept non-formatted value as node name of the Serf agent

  Modified files:
    lib/serf/agent.js

  Modified: lib/serf/agent.js (+3 -11)
===================================================================
--- lib/serf/agent.js    2014-11-05 11:49:31 +0900 (3e38430)
+++ lib/serf/agent.js    2014-11-05 12:00:37 +0900 (5fc6ff6)
@@ -3,7 +3,7 @@
  *   var Agent = require('lib/serf/agent');
  *   var serf = new Agent({
  *                serf: '/path/to/serf',
- *                name: 'node0:10041/droonga',
+ *                hostName: 'node0',
  *                otherHostNames: ['node0:7946', 'node1:8946', 'node2', ...]
  *              });
  *   serf.start()
@@ -28,7 +28,7 @@ function Agent(options) {
 
   this._logger = options.logger || new ConsoleLogger();
 
-  this._name = options.name;
+  this._hostName = options.hostName;
   this._serf = options.serf || 'serf';
   if (this._serf.charAt(0) == '.')
     this._serf = path.resolve(this._serf);
@@ -37,14 +37,6 @@ function Agent(options) {
   if (!Array.isArray(this._otherHostNames))
     this._otherHostNames = [this._otherHostNames];
 
-  var matched = String(this._name).match(NODE_NAME_PATTERN);
-  if (!matched)
-    throw new Error('Name must be <host name>:<port number>/<tag name> !');
-
-  this._hostName = matched[1];
-  this._port     = matched[2];
-  this._tag      = matched[3];
-
   this._agentProcess = null;
   this.shutdown = this.shutdown.bind(this);
 }
@@ -84,7 +76,7 @@ Agent.prototype = {
                                        'express-droonga-serf-event-handler');
     var agentArgs = [
       'agent',
-      '-node', this._name,
+      '-node', this._hostName + '/protocol-adapter',
       '-bind', this._hostName + ':8946',
       // '-event-handler', eventHandlerPath,
       // '-log-level', this._logLevel,
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index