TaskContext   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 34
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setPriority() 0 5 1
A setTaskLockTimeout() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\Context;
5
6
class TaskContext extends Context implements ContextInterface
7
{
8
    /**
9
     * task lock timeout in millisecond. For more details, see Locking.
10
     * Default: 300000
11
     *
12
     * @param int $taskLockTimeout
13
     *
14
     * @return $this
15
     */
16 1
    public function setTaskLockTimeout(int $taskLockTimeout): self
17
    {
18 1
        $this->properties['taskLockTimeout'] = $taskLockTimeout;
19
20 1
        return $this;
21
    }
22
23
    /**
24
     * Different based on task types.
25
     * Defaults:
26
     * Realtime index task    75
27
     * Batch index task    50
28
     * Merge/Append/Compaction task    25
29
     * Other tasks    0
30
     *
31
     * @param int $priority
32
     *
33
     * @return $this
34
     */
35 10
    public function setPriority(int $priority): self
36
    {
37 10
        $this->properties['priority'] = $priority;
38
39 10
        return $this;
40
    }
41
}