Technoboy- commented on code in PR #14723:
URL: https://github.com/apache/pulsar/pull/14723#discussion_r848493768
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:
##########
@@ -112,26 +120,64 @@ public CompletableFuture<SchemaAndMetadata>
getSchema(String schemaId, SchemaVer
);
}
- return completableFuture.thenCompose(stored -> {
+ return completableFuture
+ .thenCompose(stored -> {
if (isNull(stored)) {
return completedFuture(null);
} else {
return Functions.bytesToSchemaInfo(stored.data)
.thenApply(Functions::schemaInfoToSchema)
.thenApply(schema -> new
SchemaAndMetadata(schemaId, schema, stored.version));
}
- }
- );
+ })
+ .whenComplete((v, t) -> {
+ if (t != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("[{}] Get schema failed", schemaId);
+ }
+ this.stats.recordGetFailed(schemaId);
+ } else {
+ if (v == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("[{}] Schema not found", schemaId);
+ }
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("[{}] Schema is present", schemaId);
+ }
+ }
Review Comment:
Can combine 141 to 146 with log.debug (v == null ? xxx : xxx)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]