Skip to content

Commit

Permalink
remove shutdown Node|Cluster as _shutdown has been removed (ruflin#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
p365labs committed Nov 16, 2016
1 parent c72a75b commit 083d7f1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 128 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file based on the
### Backward Compatibility Fixes
- Updated Elastica\Test\Suggest\CompletionTest now payload and output are removed
- Updated Elastica\Test\TypeTest::testGetDocumentWithFieldsSelection The stored_fields parameter will only return stored fields — it will no longer extract values from the _source
- remove _shutdown for Node and Cluster as deprecated

### Bugfixes

Expand Down
16 changes: 0 additions & 16 deletions lib/Elastica/Cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,4 @@ public function getSettings()
{
return new Settings($this->getClient());
}

/**
* Shuts down the complete cluster.
*
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html
*
* @param string $delay OPTIONAL Seconds to shutdown cluster after (default = 1s)
*
* @return \Elastica\Response
*/
public function shutdown($delay = '1s')
{
$path = '_shutdown?delay='.$delay;

return $this->_client->request($path, Request::POST);
}
}
16 changes: 0 additions & 16 deletions lib/Elastica/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,4 @@ public function refresh()
$this->_stats = null;
$this->_info = null;
}

/**
* Shuts this node down.
*
* @param string $delay OPTIONAL Delay after which node is shut down (default = 1s)
*
* @return \Elastica\Response
*
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html
*/
public function shutdown($delay = '1s')
{
$path = '_cluster/nodes/'.$this->getId().'/_shutdown?delay='.$delay;

return $this->_client->request($path, Request::POST);
}
}
11 changes: 2 additions & 9 deletions test/lib/Elastica/Test/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ protected function setUp()
{
parent::setUp();

$hasGroup = $this->_isUnitGroup() || $this->_isFunctionalGroup() || $this->_isShutdownGroup() || $this->_isBenchmarkGroup();
$this->assertTrue($hasGroup, 'Every test must have one of "unit", "functional", "shutdown" or "benchmark" group');
$hasGroup = $this->_isUnitGroup() || $this->_isFunctionalGroup() || $this->_isBenchmarkGroup();
$this->assertTrue($hasGroup, 'Every test must have one of "unit", "functional", "benchmark" group');
$this->showDeprecated();
}

Expand Down Expand Up @@ -218,13 +218,6 @@ protected function _isFunctionalGroup()
return in_array('functional', $groups);
}

protected function _isShutdownGroup()
{
$groups = \PHPUnit_Util_Test::getGroups(get_class($this), $this->getName(false));

return in_array('shutdown', $groups);
}

protected function _isBenchmarkGroup()
{
$groups = \PHPUnit_Util_Test::getGroups(get_class($this), $this->getName(false));
Expand Down
76 changes: 0 additions & 76 deletions test/lib/Elastica/Test/ShutdownTest.php

This file was deleted.

18 changes: 9 additions & 9 deletions test/lib/Elastica/Test/Suggest/CompletionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ protected function _getIndexForTest()

$type->addDocuments([
new Document(1, [
'fieldName' => [
'input' => ['Nevermind', 'Nirvana'],
'weight' => 5
'fieldName' => [
'input' => ['Nevermind', 'Nirvana'],
'weight' => 5,
],
]),
new Document(2, [
'fieldName' => [
'input' => ['Bleach', 'Nirvana'],
'weight' => 2
'fieldName' => [
'input' => ['Bleach', 'Nirvana'],
'weight' => 2,
],
]),
new Document(3, [
'fieldName' => [
'input' => ['Incesticide', 'Nirvana'],
'weight' => 7
'fieldName' => [
'input' => ['Incesticide', 'Nirvana'],
'weight' => 7,
],
]),
]);
Expand Down
4 changes: 2 additions & 2 deletions test/lib/Elastica/Test/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ public function testGetDocumentWithFieldsSelection()
'type' => 'string',
'store' => 'yes', ],
'country' => [
'type' => 'string'
]
'type' => 'string',
],
]);

$mapping->disableSource();
Expand Down

0 comments on commit 083d7f1

Please sign in to comment.