Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 16
CRAP
0.00% covered (danger)
0.00%
0 / 1
CompletionSuggesterIndexerConfig
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 16
272
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 1
2
 getAllocationExcludeTag
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getIndexBaseName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isAltIndex
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAltIndexId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isRecycle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getIndexChunkSize
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMasterTimeout
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getIndexRetryAttempts
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAllocationIncludeTag
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isOptimizeIndex
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isForce
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getShardCount
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getReplicaCount
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMaxShardPerNode
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getReplicationTimeout
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace CirrusSearch\Maintenance;
4
5class CompletionSuggesterIndexerConfig {
6    private string $indexBaseName;
7    private bool $altIndex;
8    private int $altIndexId;
9    private int $shardCount;
10    private string $replicaCount;
11    private int $maxShardPerNode;
12    private bool $recycle;
13    private int $indexChunkSize;
14    private string $masterTimeout;
15    private int $replicationTimeout;
16    private int $indexRetryAttempts;
17    private ?string $allocationIncludeTag;
18    private ?string $allocationExcludeTag;
19    private bool $optimizeIndex;
20    private bool $force;
21
22    /**
23     * @param string $indexBaseName the base name of the index
24     * @param bool $altIndex true if it's an "alternative" index
25     * @param int $altIndexId the id of the alternative index
26     * @param int $shardCount the number of shards
27     * @param string $replicaCount the number of replicas (auto_expand_replicas format)
28     * @param int $maxShardPerNode max number of shards per node
29     * @param bool $recycle true to recycle the index
30     * @param int $indexChunkSize max number of docs to buffer before writing to the backend
31     * @param string $masterTimeout the master timeouts for operations involving a cluster state change
32     * @param int $replicationTimeout timeout to wait for replication to happen (wait for green)
33     * @param int $indexRetryAttempts number of retries to attempt per bulk requests
34     * @param string|null $allocationIncludeTag optional allocation tag to force allocation on nodes marked with this tag
35     * @param string|null $allocationExcludeTag optional allocation tag to force allocation on nodes not marked with this tag
36     * @param bool $optimizeIndex true to optimize the index
37     * @param bool $force force the promotion of the index even if some checks suggest that the index is broken
38     */
39    public function __construct( string $indexBaseName, bool $altIndex, int $altIndexId,
40        int $shardCount, string $replicaCount, int $maxShardPerNode,
41        bool $recycle, int $indexChunkSize, string $masterTimeout, int $replicationTimeout, int $indexRetryAttempts,
42        ?string $allocationIncludeTag, ?string $allocationExcludeTag, bool $optimizeIndex,
43        bool $force
44    ) {
45        $this->indexBaseName = $indexBaseName;
46        $this->altIndex = $altIndex;
47        $this->altIndexId = $altIndexId;
48        $this->shardCount = $shardCount;
49        $this->replicaCount = $replicaCount;
50        $this->maxShardPerNode = $maxShardPerNode;
51        $this->recycle = $recycle;
52        $this->indexChunkSize = $indexChunkSize;
53        $this->masterTimeout = $masterTimeout;
54        $this->replicationTimeout = $replicationTimeout;
55        $this->indexRetryAttempts = $indexRetryAttempts;
56        $this->allocationIncludeTag = $allocationIncludeTag;
57        $this->allocationExcludeTag = $allocationExcludeTag;
58        $this->optimizeIndex = $optimizeIndex;
59        $this->force = $force;
60    }
61
62    public function getAllocationExcludeTag(): ?string {
63        return $this->allocationExcludeTag;
64    }
65
66    public function getIndexBaseName(): string {
67        return $this->indexBaseName;
68    }
69
70    public function isAltIndex(): bool {
71        return $this->altIndex;
72    }
73
74    public function getAltIndexId(): int {
75        return $this->altIndexId;
76    }
77
78    public function isRecycle(): bool {
79        return $this->recycle;
80    }
81
82    public function getIndexChunkSize(): int {
83        return $this->indexChunkSize;
84    }
85
86    public function getMasterTimeout(): string {
87        return $this->masterTimeout;
88    }
89
90    public function getIndexRetryAttempts(): int {
91        return $this->indexRetryAttempts;
92    }
93
94    public function getAllocationIncludeTag(): ?string {
95        return $this->allocationIncludeTag;
96    }
97
98    public function isOptimizeIndex(): bool {
99        return $this->optimizeIndex;
100    }
101
102    public function isForce(): bool {
103        return $this->force;
104    }
105
106    public function getShardCount(): int {
107        return $this->shardCount;
108    }
109
110    public function getReplicaCount(): string {
111        return $this->replicaCount;
112    }
113
114    public function getMaxShardPerNode(): int {
115        return $this->maxShardPerNode;
116    }
117
118    public function getReplicationTimeout(): int {
119        return $this->replicationTimeout;
120    }
121}