forked from feldera/feldera
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.py
More file actions
40 lines (31 loc) · 1.53 KB
/
resources.py
File metadata and controls
40 lines (31 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from typing import Optional, Any, Mapping
class Resources:
"""
Class used to specify the resource configuration for a pipeline.
:param config: A dictionary containing all the configuration values.
:param cpu_cores_max: The maximum number of CPU cores to reserve for an instance of the pipeline.
:param cpu_cores_min: The minimum number of CPU cores to reserve for an instance of the pipeline.
:param memory_mb_max: The maximum memory in Megabytes to reserve for an instance of the pipeline.
:param memory_mb_min: The minimum memory in Megabytes to reserve for an instance of the pipeline.
:param storage_class: The storage class to use for the pipeline. The class determines storage performance such
as IOPS and throughput.
:param storage_mb_max: The storage in Megabytes to reserve for an instance of the pipeline.
"""
def __init__(
self,
config: Optional[Mapping[str, Any]] = None,
cpu_cores_max: Optional[int] = None,
cpu_cores_min: Optional[int] = None,
memory_mb_max: Optional[int] = None,
memory_mb_min: Optional[int] = None,
storage_class: Optional[str] = None,
storage_mb_max: Optional[int] = None,
):
config = config or {}
self.cpu_cores_max = cpu_cores_max
self.cpu_cores_min = cpu_cores_min
self.memory_mb_max = memory_mb_max
self.memory_mb_min = memory_mb_min
self.storage_class = storage_class
self.storage_mb_max = storage_mb_max
self.__dict__.update(config)