Mobio scheduler partitioning libs
Project description
Thư viện scheduler multiple partitions của Profiling
nop: maximum partitions now support is 1000
delays: maximum time delays now support is 3600 seconds (1 hour)
sample code:
from mobio.libs.m_scheduler_partitioning.m_scheduler import MobioScheduler
from mobio.libs.m_scheduler_partitioning.scheduler_models.scheduler_state_model import SchedulerStateModel
class SampleScheduler(MobioScheduler):
def process(self):
if self.url_connection:
SchedulerStateModel(self.url_connection).set_busy(
worker_id=self.node_id
)
print("Hi there ! :)")
if __name__ == "__main__":
SampleScheduler(root_node="test-scheduler", nop=100, delays=1, url_connection="mongodb://test_user:test_password@0.0.0.0:27017/test_db", zookeeper_uri="127.0.0.1:2181")
Change logs
-
0.1.2
-
log state of worker
-
get free worker
-
Để không bị mất 50k cho anh Lợi, thêm 2 index này:
* db.scheduler_state.createIndex({"expiry_time": 1}, {expireAfterSeconds: 5, name: "expiry_time_1"}) * db.scheduler_state.createIndex({"root_node": 1, "state":1}, {name: "root_node_1_state_1"})
-
-
0.1.3
- fix issue khi worker rebalance không tự động cập nhật danh sách partitions.
-
0.1.4
- fix issue register worker
- cơ chế đảm bảo việc register worker với hệ thống csdl
-
0.1.5
- Refix issue register worker
- Thử nghiệm cơ chế đảm bảo 1 partition chỉ nằm trên 1 worker.
- NOTE: phần này chưa đảm bảo được việc đủ partitions trên các workers
-
0.1.6
- missing version do nâng cấp CICD
-
0.1.7
- Sử dụng threading để quản lý heart_beat và expiry_time
- Kiểm tra trạng thái subscribe của worker mỗi khi chuẩn bị process data (Đảm bảo rằng việc subscribe phải diễn ra thành công tránh 2 worker cùng xử lý 1 partition)
-
0.1.8
- Cho phép truyền zookeeper_uri vào param khi khởi tạo Schedule, nếu không truyền thì lấy mặc định từ ENV: ZOOKEEPER_CLUSTER
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for m_scheduler_partitioning-0.1.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 210d4256b268b4d0cbffee82b1640943be9d46350bbdcf8a4ffb3e627922af31 |
|
MD5 | 2c01e8701d572247f0311cad86c300da |
|
BLAKE2b-256 | 7640741ba6bdff39920818185045f088a131f520fd4033f492a031376417478d |