You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "zhuqi-lucas (via GitHub)" <gi...@apache.org> on 2023/02/20 07:46:29 UTC

[GitHub] [yunikorn-core] zhuqi-lucas commented on a diff in pull request #506: [YUNIKORN-1578][core] Use zap.Stringer instead of calling String on object

zhuqi-lucas commented on code in PR #506:
URL: https://github.com/apache/yunikorn-core/pull/506#discussion_r1111582256


##########
pkg/common/resources/resources.go:
##########
@@ -909,7 +909,7 @@ func CalculateAbsUsedCapacity(capacity, used *Resource) *Resource {
 	}
 	if missingResources.Len() != 0 {
 		log.Logger().Debug("Absolute usage result is missing resource information",
-			zap.String("missing resource(s)", missingResources.String()))
+			zap.Stringer("missing resource(s)", &missingResources))

Review Comment:
   Thank you @manirajv06 for review, I have checked the code here:
   `
   // String returns the accumulated string.
   func (b *Builder) String() string {
   	return *(*string)(unsafe.Pointer(&b.buf))
   }
   `



##########
pkg/common/resources/resources.go:
##########
@@ -909,7 +909,7 @@ func CalculateAbsUsedCapacity(capacity, used *Resource) *Resource {
 	}
 	if missingResources.Len() != 0 {
 		log.Logger().Debug("Absolute usage result is missing resource information",
-			zap.String("missing resource(s)", missingResources.String()))
+			zap.Stringer("missing resource(s)", &missingResources))

Review Comment:
   Thank you @manirajv06 for review, I have checked the code here:
   ```
   // String returns the accumulated string.
   func (b *Builder) String() string {
   	return *(*string)(unsafe.Pointer(&b.buf))
   }
   ```



-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org