Clearing code samples from internal API's and asserts.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Refactoring
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- documentation
Direzione di ricerca
Inizia esaminando la pull request code-samples collegata e AbstractCacheSplitBrainSample.java, in particolare l'esempio di split-brain intorno alla riga 105. Poi fai un inventario delle assertions di Common Utils, dell'accesso ai nodi, dell'utilizzo di generateKeyOwnedBy e delle classi astratte SplitBrainSamples. Il lavoro è completato quando è stato definito un ambito concordato e coerente per semplificare i samples senza fare affidamento su API interne.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 558
- Fork
- 599
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hazelcast/hazelcast-code-samples
-
[BUG] ClassLoader Leak / Metaspace OOM: Unmanaged static ThreadLocal<Kryo> in PersonKryoSerializerAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
hazelcast code sample for XA transactions no longer works with current Atomikos version (5.0.9)Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
hazelcast/hazelcast-code-samples#553 · 4 commenti ·
Tutte le issue di hazelcast/hazelcast-code-samples
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
tchiotludo/akhq#3438 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#266 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ome/bioformats#4509 ·
I maintainer di solito rispondono entro 2 giorni
-
module/email Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
ballerina-platform/ballerina-library#9758 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Azure/azure-functions-java-worker#909 · 1 reazione ·