Optimize ClassGraph Scanning
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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!
- Linguagem predominante
- Java
- Estrelas
- 322
- Forks
- 210
- Merge médio
- 15h 16min
- PRs com merge (30d)
- 29
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de hyperledger/fabric-chaincode-java
-
enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
hyperledger/fabric-chaincode-java#628 ·
Mantenedores costumam responder em até 1 dia
-
DataType nested classAbertabug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 75/100
hyperledger/fabric-chaincode-java#626 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
hyperledger/fabric-chaincode-java#625 ·
Mantenedores costumam responder em até 1 dia
-
Read/write batchingTalvez livre de novo @jadebluestar assumiu há 118 dias e não há nenhum pull request aberto. Abertaenhancement help wanted
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
hyperledger/fabric-chaincode-java#378 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Publish docs on pushAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
hyperledger/fabric-chaincode-java#372 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de hyperledger/fabric-chaincode-java
Issues semelhantes
-
Optimize consumer version heatmap aggregation to avoid repeated scansTalvez já em andamento @praykaria31 assumiu hoje. Abertatype/enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Apicurio/apicurio-registry#10662 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
a:false-positive
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
status: waiting-for-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
spring-projects/spring-boot#52347 ·
Mantenedores costumam responder em até 2 dias
-
bug untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
opensearch-project/opensearch-migrations#3480 ·
Mantenedores costumam responder em até 2 dias
-
[Bug] Certificate expiry sorting can reverse UTC order across a viewer daylight-saving gapTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
apache/rocketmq-dashboard#7318 ·
Mantenedores costumam responder em até 3 dias