mirror of
https://github.com/predis/predis.git
synced 2026-10-08 21:06:44 +00:00
Separate id and alias in predis cluster (client-side sharding).
This change does not affect distribution but simply separates the two concepts of connection ID (ip:port pair) and alias (value set via the "alias" connection parameter), the method getConnectionByAlias() has been added to reflect this change. The method getConnectionBySlot() has also been added.
This commit is contained in:
@@ -690,7 +690,7 @@ class ClientTest extends PredisTestCase
|
||||
$nodes = array('tcp://host1?alias=node01', 'tcp://host2?alias=node02');
|
||||
$client = $this->getMock('Predis\Client', array('dummy'), array($nodes, array('cluster' => 'predis')), 'SubclassedClient');
|
||||
|
||||
$this->assertInstanceOf('SubclassedClient', $client->getClientBy('id', 'node02'));
|
||||
$this->assertInstanceOf('SubclassedClient', $client->getClientBy('alias', 'node02'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -715,7 +715,7 @@ class ClientTest extends PredisTestCase
|
||||
}))
|
||||
->will($this->returnValue('value'));
|
||||
|
||||
$this->assertSame('value', $client->getClientBy('id', 'node02', $callable));
|
||||
$this->assertSame('value', $client->getClientBy('alias', 'node02', $callable));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user