Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace CirrusSearch\Assignment;
4
5interface ClusterAssignment {
6
7    /**
8     * @param string $cluster The cluster to id.
9     * @return string An identifier that unique describes the
10     *  connection properties. Instances of the same implementation
11     *  will return same value for same configuration.
12     */
13    public function uniqueId( $cluster );
14
15    /**
16     * @return string Name of the cluster group to search against
17     */
18    public function getSearchCluster();
19
20    /**
21     * @param string $updateGroup UpdateGroup::* constant
22     * @return string[] List of the cluster groups to send writes to
23     */
24    public function getWritableClusters( string $updateGroup ): array;
25
26    /**
27     * @return string[] List of the cluster groups to manage indexes on.
28     */
29    public function getManagedClusters(): array;
30
31    /**
32     * @param string $clusterName
33     * @return bool True if the cluster is defined
34     */
35    public function hasCluster( string $clusterName ): bool;
36
37    /**
38     * @param string $clusterName
39     * @param string $updateGroup UpdateGroup::* constant
40     * @return bool True when the named cluster is writable for this kind of update
41     */
42    public function canWriteToCluster( $clusterName, $updateGroup );
43
44    /**
45     * @param string $clusterName
46     * @return bool True when the named cluster is in the set of managable clusters.
47     */
48    public function canManageCluster( $clusterName ): bool;
49
50    /**
51     * @param string|null $cluster Name of cluster group to return connection
52     *  configuration for, or null for the default search cluster.
53     * @return string[]|array[] Either a list of hostnames, for default
54     *  connection configuration, or an array of arrays giving full
55     *  connection specifications.
56     */
57    public function getServerList( $cluster = null ): array;
58
59    /**
60     * @return string|null The name to use to refer to this wikis group in cross-cluster-search.
61     */
62    public function getCrossClusterName();
63}