Clearing code samples from internal API's and asserts.
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- java
調査の方向性
まず、リンクされている code-samples の pull request と AbstractCacheSplitBrainSample.java を確認し、特に 105 行目付近の split-brain の例を確認します。次に、Common Utils の assertions、ノードアクセス、generateKeyOwnedBy の使用箇所、および抽象 SplitBrainSamples クラスを洗い出します。内部 API に依存せずに samples を簡素化するための、合意済みで一貫したスコープが定まれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I don't know if it is discussed before. Our code samples use internal API, which caused compile problem in this release when changed. Fixed here https://github.com/hazelcast/hazelcast-code-samples/pull/303/files
The reason of usage seems to demonstrate some features are working. And it resembles our unit tests.
I think the code sample does not need that much verification. Since it is to show how hazelcast should be used, it is giving wrong advice.
Heaviest usage is around simulating the split brain. That requires access to node. I think this should not be part of the code samples. Configuring split brain on code samples make sense. But simulating the behavior I think is part of the unit tests.
https://github.com/hazelcast/hazelcast-code-samples/blob/master/jcache/src/main/java/com/hazelcast/examples/splitbrain/AbstractCacheSplitBrainSample.java#L105
I see generateKeyOwnedBy usage. I don't think we are advising this to our users. Make sense for tests but users should use affinity features instead of generating the key for a specific partition. And interestingly, this also accesses to node.
I think we also need rules for using assertions. We have the following methods on Common Utils. My gut feeling says that code samples should not do assert.
.assertClusterSizeEventually;
.assertEquals;
.assertOpenEventually;
I am keen to do the following
System.out.println(cache1.get("key1"));//prints 'value'
instead of
assertEquals("value",);
Lastly, I see abstract class usages too much. Especially around SplitBrainSamples. I think code samples should be one class and simple. Using abstractions to demonstrate simple usages will scare of the users. This again seems to be caused by simulating the split brain. When we remove that part, abstractions will go away too.
- 主要言語
- Java
- スター
- 558
- フォーク
- 599
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hazelcast/hazelcast-code-samples のほかの issue
-
[BUG] ClassLoader Leak / Metaspace OOM: Unmanaged static ThreadLocal<Kryo> in PersonKryoSerializerオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
hazelcast code sample for XA transactions no longer works with current Atomikos version (5.0.9)オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
hazelcast/hazelcast-code-samples#553 · コメント 4 件 ·
hazelcast/hazelcast-code-samples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
tchiotludo/akhq#3438 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#266 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ome/bioformats#4509 ·
メンテナーはふだん 2 日以内に返信
-
module/email Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
ballerina-platform/ballerina-library#9758 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Azure/azure-functions-java-worker#909 · リアクション 1 件 ·