1 | <?php |
||
13 | class ElasticsearchGetDocumentCheck extends AbstractElasticsearchCheck |
||
14 | { |
||
15 | const CHECK = 'elasticsearch-get-document-check'; |
||
16 | |||
17 | const INDEX_GET_SIZE = 5; |
||
18 | |||
19 | /** |
||
20 | * @var ElasticsearchClient |
||
21 | */ |
||
22 | protected $client; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $index; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $type; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $minSize; |
||
38 | |||
39 | /** |
||
40 | * @param string $checkNode |
||
41 | * @param ElasticsearchClient $client |
||
42 | * @param string $index |
||
43 | * @param string $type |
||
44 | * @param int $minSize |
||
45 | */ |
||
46 | 4 | public function __construct($checkNode, ElasticsearchClient $client, $index, $type, $minSize = self::INDEX_GET_SIZE) |
|
54 | |||
55 | /** |
||
56 | * Check elasticsearch client can get index type. |
||
57 | * |
||
58 | * @param string $index |
||
59 | * @param string $type |
||
60 | * @param int $minSize |
||
61 | * @return void |
||
62 | * |
||
63 | * @throws ElasticsearchGetDocumentCheckException |
||
64 | * @throws Exception |
||
65 | */ |
||
66 | 4 | public function performCheck($index = null, $type = null, $minSize = null) |
|
101 | |||
102 | /** |
||
103 | * @return ElasticsearchClient |
||
104 | */ |
||
105 | 4 | public function getClient() |
|
109 | |||
110 | /** |
||
111 | * @return string |
||
112 | */ |
||
113 | 4 | public function getIndex() |
|
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | 4 | public function getType() |
|
125 | |||
126 | /** |
||
127 | * @return int |
||
128 | */ |
||
129 | 4 | public function getMinSize() |
|
133 | |||
134 | /** |
||
135 | * @param string $index |
||
136 | */ |
||
137 | 4 | protected function setIndex($index) |
|
141 | |||
142 | /** |
||
143 | * @param string $type |
||
144 | */ |
||
145 | 4 | protected function setType($type) |
|
149 | |||
150 | /** |
||
151 | * @param int $minSize |
||
152 | */ |
||
153 | 4 | protected function setMinSize($minSize) |
|
157 | |||
158 | /** |
||
159 | * @param ElasticsearchClient $client |
||
160 | */ |
||
161 | 4 | protected function setClient(ElasticsearchClient $client) |
|
165 | } |
||
166 |