brandboat opened a new pull request, #16618:
URL: https://github.com/apache/kafka/pull/16618

   related to https://issues.apache.org/jira/browse/KAFKA-17153,
   
   Java disallow lambdas to implement abstract classes, and hence there are 
many ugly impl of Gague in code base. Those bad looking code will spring up as 
we migrate more and more scala code to java.
   
   Hence, we should offer a variety to accept functional interface for java 
code. For example:
   
   ```java
       public final <T> Gauge<T> newGauge(String name, Supplier<T> metric) {
           return newGauge(name, new Gauge<T>() {
               @Override
               public T value() {
                   return metric.get();
               }
           }, Collections.emptyMap());
       }
   ```
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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]

Reply via email to