Optimize ClassGraph Scanning
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with SerializerRegistryImpl.findAndSetContents() and RoutingRegistryImpl.findAndSetContracts(), then review their ClassGraph scan setup and the ScanResult.toJSON()/fromJSON() APIs. Determine how optional packaged metadata can be shared by both registries while preserving runtime scanning when absent. Done means startup discovers serializers, contracts, and data types without duplicate full-classpath scans when an index is present, with fallback and GraalVM Native Image limitations documented.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current Status
The Java contract API performs two separate ClassGraph scans during startup:
SerializerRegistryImpl.findAndSetContents()scans the runtime classpath for classes annotated with@Serializer.RoutingRegistryImpl.findAndSetContracts()scans the runtime classpath for classes annotated with@Contractand@DataType.
Both scans use new ClassGraph().enableClassInfo().enableAnnotationInfo().scan(). For chaincodes with many dependencies, scanning the full classpath can increase startup time. This work is repeated whenever the chaincode starts, including when a peer restarts and launches its chaincode again.
ClassGraph provides ScanResult.toJSON() and ScanResult.fromJSON(String) APIs that may allow scan metadata to be generated during the build and reused at runtime.
Expected
Chaincode startup should be able to discover serializers, contracts, and data types from pre-generated scan metadata rather than scanning the full runtime classpath each time.
The change should preserve existing behavior for users who do not provide generated metadata. It should also document any limitations or additional requirements for using this approach with GraalVM Native Image, where dynamic class loading and reflection may require build-time configuration.
Solution
Add an optional build-time scan-index mechanism that packages ClassGraph metadata with the chaincode. At runtime, the shim should load that metadata and share the resulting scan information between SerializerRegistryImpl and RoutingRegistryImpl, avoiding duplicate full-classpath scans.
When no index is available, the shim should fall back to the current runtime scanning behavior. The implementation could use ClassGraph's ScanResult.toJSON() and ScanResult.fromJSON(String) APIs, or another generated-index approach, while ensuring discovered classes can still be loaded and instantiated. Any extra GraalVM Native Image configuration needed for those classes should be documented.
Please let us know if you plan to work on this.
Yes!
- Lingua principale
- Java
- Stelle
- 322
- Fork
- 210
- Merge medio
- 15h 16m
- PR unite (30g)
- 29
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la 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 hyperledger/fabric-chaincode-java
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
hyperledger/fabric-chaincode-java#628 ·
I maintainer di solito rispondono entro 1 giorno
-
DataType nested classApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
hyperledger/fabric-chaincode-java#626 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
hyperledger/fabric-chaincode-java#625 ·
I maintainer di solito rispondono entro 1 giorno
-
Read/write batchingForse di nuovo libera @jadebluestar l’ha presa 117 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
hyperledger/fabric-chaincode-java#378 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Publish docs on pushAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
hyperledger/fabric-chaincode-java#372 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hyperledger/fabric-chaincode-java
Issue simili
-
enhancement feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
rsp777/service-pulse-app#28 ·
-
human-required sync-failed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/osdu-spi-file#63 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ysql kind/enhancement priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
yugabyte/yugabyte-db#35578 ·
I maintainer di solito rispondono entro 1 giorno
-
frontend quick win
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
CodeForPhilly/benefit-decision-toolkit#571 ·
I maintainer di solito rispondono entro 1 giorno
-
approved
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
checkstyle/checkstyle#22129 ·
I maintainer di solito rispondono entro 1 giorno