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
-
0.1.9
- Tự động quản lý và cập nhật state cho worker.
- fix lỗi tự động release worker ở bản 0.1.7
-
0.1.10
- Fix lỗi không release khi set time delay giữa các lần chạy nhỏ hơn 15 seconds :(
-
0.1.11
- Fix lỗi list partitions = [] dẫn đến việc không truy vấn được data trong db
- Bỏ 1 số function validate không cần thiết.
-
0.1.12
- Chuyển luồng update state vào main thread. Do ko reproduce được case trung state vẫn update trên k8s. :'(
-
0.1.13
- reformat code.
-
0.1.14
- Support mongo >= 4
Metadata
Release files for m-scheduler-partitioning 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| m_scheduler_partitioning-0.1.14.tar.gz | 10.9 kB | Without provenance | Details |
Release files / m_scheduler_partitioning-0.1.14.tar.gz
| Download URL | m_scheduler_partitioning-0.1.14.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63a2f2d6c0288e170e45ec703592202aa7f147c017cfd5bf7c4d7db775b704ca
|
|
BLAKE2b-256 checksum How to use checksums |
7b49dfffd50f07cfa0bc2254692c05161f7ee7e37ed408ee7d4b0d28b99ea625
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for m-scheduler-partitioning 0.1.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.