-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcommon.py
More file actions
34 lines (25 loc) · 673 Bytes
/
Copy pathcommon.py
File metadata and controls
34 lines (25 loc) · 673 Bytes
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
# Configs and common utils
from dataclasses import dataclass
import enum
class Config:
chunk_size: int = 4
master_loc: str = "50051"
chunkserver_locs: list = ["50052", "50053", "50054", "50055", "50056", "50057"]
chunkserver_root: str = "root_chunkserver" # root dir in chunk server
class Status:
def __init__(self, v, e) -> None:
self.v = v
self.e = e
if self.e:
print(self.e)
def isInt(e):
try:
e = int(e)
except:
return False
else:
return True
class HeartBeatStatus(enum.Enum):
ok = "SERVING"
error = "NOT_SEVING"
unknown = "UNKNOWN" # not currently used