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