Establish actual relationship of the Python binding's `LogEntry`, `StateMachine` types
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
.pyi ファイル内の一時的な AbstractLogEntry と AbstractStateMachine の宣言を、インストールされている raftify/init.py および Python wheel の内容と比較することから始めます。示されている import エラーを再現し、その後、2 つの型が raftify から利用でき、SetCommand と HashStore のサンプルの関係を import エラーなしでサポートしていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Ideally, the SetCommand and LogEntry in the sample code should be represented as shown below.
class SetCommand(AbstractLogEntry):
"""
Represent simple key-value command.
Use pickle to serialize the data.
"""
def __init__(self, key: str, value: str) -> None:
self.key = key
self.value = value
@override
def encode(self) -> bytes:
return pickle.dumps(self.__dict__)
@override
@classmethod
def decode(cls, packed: bytes) -> "SetCommand":
unpacked = pickle.loads(packed)
return cls(unpacked["key"], unpacked["value"])
class HashStore(AbstractStateMachine):
"""
A simple key-value store that stores data in memory.
Use pickle to serialize the data.
"""
def __init__(self):
self._store = dict()
self._loop = asyncio.get_running_loop()
def get(self, key: str) -> Optional[str]:
return self._store.get(key)
def as_dict(self) -> dict:
return self._store
@override
async def apply(self, msg: bytes) -> bytes:
message = SetCommand.decode(msg)
self._store[message.key] = message.value
return msg
@override
async def snapshot(self) -> bytes:
return pickle.dumps(self._store)
@override
async def restore(self, snapshot: bytes) -> None:
self._store = pickle.loads(snapshot)
However, for now, these two types are only temporarily defined in the .pyi file and are not actually included in the whl, resulting in an import error.
from raftify import AbstractLogEntry, AbstractStateMachine
ImportError: cannot import name 'AbstractLogEntry' from 'raftify' (/opt/homebrew/lib/python3.12/site-packages/raftify/__init__.py)
- 主要言語
- Rust
- スター
- 44
- フォーク
- 14
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lablup/raftify のほかの issue
-
integration-test
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
dx
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
-
feature log-storage snapshot
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
good first issue log-storage test
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
feature
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
似ている issue
-
area:ui effort:medium enhancement P7 source:agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
documentation priority: low tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
nledford/Ladderback#1823 ·
メンテナーはふだん 1 日以内に返信
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)対応中かも @ealwanlee が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
psmux/psmux-plugins#47 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信