[jira] [Updated] (KAFKA-8881) Measure thread running time precisely

2020-01-12 Thread huxihx (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-8881?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

huxihx updated KAFKA-8881:
--
Description: Currently, the code uses `System.currentTimeMillis()` to 
measure timeout extensively. However, many situations trigger the thread 
suspend such as gc and context switch. In such cases, the timeout value we 
specify is not strictly honored. I believe many of flaky tests failed with 
timed-out are a result of this. Maybe we should use 
ThreadMXBean#getCurrentThreadCpuTime to precisely measure the thread running 
time.  (was: Currently, the code uses `System.currentTimeMillis()` to measure 
timeout extensively. However, many situations trigger the thread suspend such 
as gc and context switch. In such cases, the timeout value we specify is not 
strictly honored. I believe many of flaky tests failed with timed-out are a 
result of this. Maybe we should use ThreadMXBean#getCurrentThreadUserTime to 
precisely measure the thread running time.)

> Measure thread running time precisely
> -
>
> Key: KAFKA-8881
> URL: https://issues.apache.org/jira/browse/KAFKA-8881
> Project: Kafka
>  Issue Type: Improvement
>Affects Versions: 2.4.0
>Reporter: huxihx
>Priority: Major
>  Labels: needs-discussion
>
> Currently, the code uses `System.currentTimeMillis()` to measure timeout 
> extensively. However, many situations trigger the thread suspend such as gc 
> and context switch. In such cases, the timeout value we specify is not 
> strictly honored. I believe many of flaky tests failed with timed-out are a 
> result of this. Maybe we should use ThreadMXBean#getCurrentThreadCpuTime to 
> precisely measure the thread running time.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9411) Make Client ID More Dynamic and Useful

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013952#comment-17013952
 ] 

ASF GitHub Bot commented on KAFKA-9411:
---

belugabehr commented on pull request #7944: KAFKA-9411: Make Client ID More 
Dynamic and Useful
URL: https://github.com/apache/kafka/pull/7944
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Make Client ID More Dynamic and Useful
> --
>
> Key: KAFKA-9411
> URL: https://issues.apache.org/jira/browse/KAFKA-9411
> Project: Kafka
>  Issue Type: Improvement
>  Components: clients
>Reporter: David Mollitor
>Priority: Major
>
> Clients and producers should be providing useful {{clientId}} information, 
> including software name and version number.  With that said, Kafka Java 
> client should produce a more useful ID to include the word 'Java' and the 
> version number of the JVM.  Also, allow users to take advantage of the same 
> sequence number that is currently available to the default naming scheme.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9411) Make Client ID More Dynamic and Useful

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9411:
-

 Summary: Make Client ID More Dynamic and Useful
 Key: KAFKA-9411
 URL: https://issues.apache.org/jira/browse/KAFKA-9411
 Project: Kafka
  Issue Type: Improvement
  Components: clients
Reporter: David Mollitor


Clients and producers should be providing useful {{clientId}} information, 
including software name and version number.  With that said, Kafka Java client 
should produce a more useful ID to include the word 'Java' and the version 
number of the JVM.  Also, allow users to take advantage of the same sequence 
number that is currently available to the default naming scheme.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9410) Make groupId Optional in KafkaConsumer

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013821#comment-17013821
 ] 

ASF GitHub Bot commented on KAFKA-9410:
---

belugabehr commented on pull request #7943: KAFKA-9410: Make groupId Optional 
in KafkaConsumer
URL: https://github.com/apache/kafka/pull/7943
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Make groupId Optional in KafkaConsumer
> --
>
> Key: KAFKA-9410
> URL: https://issues.apache.org/jira/browse/KAFKA-9410
> Project: Kafka
>  Issue Type: Improvement
>  Components: clients
>Reporter: David Mollitor
>Priority: Minor
>
> ... because it is.
>  
> [https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9410) Make groupId Optional in KafkaConsumer

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9410:
-

 Summary: Make groupId Optional in KafkaConsumer
 Key: KAFKA-9410
 URL: https://issues.apache.org/jira/browse/KAFKA-9410
 Project: Kafka
  Issue Type: Improvement
  Components: clients
Reporter: David Mollitor


... because it is.

 

[https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9409) Increase Immutability of ClusterConfigState

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013818#comment-17013818
 ] 

ASF GitHub Bot commented on KAFKA-9409:
---

belugabehr commented on pull request #7942: KAFKA-9409: Increase Immutability 
of ClusterConfigState
URL: https://github.com/apache/kafka/pull/7942
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Increase Immutability of ClusterConfigState
> ---
>
> Key: KAFKA-9409
> URL: https://issues.apache.org/jira/browse/KAFKA-9409
> Project: Kafka
>  Issue Type: Improvement
>Reporter: David Mollitor
>Priority: Minor
>
> The class claims that it is immutable, but there are some mutable features of 
> this class.
>  
> Increase the immutability of it and add a little cleanup:
>  * Pre-initialize size of ArrayList
>  * Remove superfluous syntax
>  * Use ArrayList instead of LinkedList since the list is created once



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (KAFKA-9409) Increase Immutability of ClusterConfigState

2020-01-12 Thread David Mollitor (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-9409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Mollitor updated KAFKA-9409:
--
Description: 
The class claims that it is immutable, but there are some mutable features of 
this class.

 

Increase the immutability of it and add a little cleanup:
 * Pre-initialize size of ArrayList
 * Remove superfluous syntax
 * Use ArrayList instead of LinkedList since the list is created once

  was:
The class claims that it is immutable, but there are some mutable features of 
this class.

 

Increase the immutability of it and add a little cleanup


> Increase Immutability of ClusterConfigState
> ---
>
> Key: KAFKA-9409
> URL: https://issues.apache.org/jira/browse/KAFKA-9409
> Project: Kafka
>  Issue Type: Improvement
>Reporter: David Mollitor
>Priority: Minor
>
> The class claims that it is immutable, but there are some mutable features of 
> this class.
>  
> Increase the immutability of it and add a little cleanup:
>  * Pre-initialize size of ArrayList
>  * Remove superfluous syntax
>  * Use ArrayList instead of LinkedList since the list is created once



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9409) Increase Immutability of ClusterConfigState

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9409:
-

 Summary: Increase Immutability of ClusterConfigState
 Key: KAFKA-9409
 URL: https://issues.apache.org/jira/browse/KAFKA-9409
 Project: Kafka
  Issue Type: Improvement
Reporter: David Mollitor


The class claims that it is immutable, but there are some mutable features of 
this class.

 

Increase the immutability of it and add a little cleanup



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9181) Flaky test kafka.api.SaslGssapiSslEndToEndAuthorizationTest.testNoConsumeWithoutDescribeAclViaSubscribe

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013814#comment-17013814
 ] 

ASF GitHub Bot commented on KAFKA-9181:
---

rajinisivaram commented on pull request #7941: KAFKA-9181; Ensure 
SubscriptionState.groupSubscription is updated even if onJoinPrepare not 
invoked after subscribe
URL: https://github.com/apache/kafka/pull/7941
 
 
   As described in KAFKA-9181, 
kafka.api.SaslGssapiSslEndToEndAuthorizationTest.testNoConsumeWithoutDescribeAclViaSubscribe
 occasionally hits unexpected TopicAuthorizationException even after the topic 
is removed from the subscription. The test uses small metadata refresh time and 
hence can see metadata responses before JoinGroup is processed. We currently 
rely on `onJoinPrepare` to reset SubscriptionState.groupSubscription, which 
accumulates topics until reset. If we process JoinGroup after a subscribe 
without a new `onJoinPrepare`, we leave the topic in 
`SubscriptionState.groupSubscription` and hence in metadata. This PR resets 
`groupSubscription` when sending JoinGroup request, when 
`ConsumerCoordinator.joinedSubscription` is updated.
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Flaky test 
> kafka.api.SaslGssapiSslEndToEndAuthorizationTest.testNoConsumeWithoutDescribeAclViaSubscribe
> ---
>
> Key: KAFKA-9181
> URL: https://issues.apache.org/jira/browse/KAFKA-9181
> Project: Kafka
>  Issue Type: Test
>  Components: core
>Reporter: Bill Bejeck
>Assignee: Rajini Sivaram
>Priority: Major
>  Labels: flaky-test, tests
>
> Failed in 
> [https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/26571/testReport/junit/kafka.api/SaslGssapiSslEndToEndAuthorizationTest/testNoConsumeWithoutDescribeAclViaSubscribe/]
>  
> {noformat}
> Error Messageorg.apache.kafka.common.errors.TopicAuthorizationException: Not 
> authorized to access topics: 
> [topic2]Stacktraceorg.apache.kafka.common.errors.TopicAuthorizationException: 
> Not authorized to access topics: [topic2]
> Standard OutputAdding ACLs for resource 
> `ResourcePattern(resourceType=CLUSTER, name=kafka-cluster, 
> patternType=LITERAL)`: 
>   (principal=User:kafka, host=*, operation=CLUSTER_ACTION, 
> permissionType=ALLOW) 
> Current ACLs for resource `Cluster:LITERAL:kafka-cluster`: 
>   User:kafka has Allow permission for operations: ClusterAction from 
> hosts: * 
> Adding ACLs for resource `ResourcePattern(resourceType=TOPIC, name=*, 
> patternType=LITERAL)`: 
>   (principal=User:kafka, host=*, operation=READ, permissionType=ALLOW) 
> Current ACLs for resource `Topic:LITERAL:*`: 
>   User:kafka has Allow permission for operations: Read from hosts: * 
> Debug is  true storeKey true useTicketCache false useKeyTab true doNotPrompt 
> false ticketCache is null isInitiator true KeyTab is 
> /tmp/kafka6494439724844851846.tmp refreshKrb5Config is false principal is 
> kafka/localh...@example.com tryFirstPass is false useFirstPass is false 
> storePass is false clearPass is false
> principal is kafka/localh...@example.com
> Will use keytab
> Commit Succeeded 
> [2019-11-13 04:43:16,187] ERROR [ReplicaFetcher replicaId=1, leaderId=0, 
> fetcherId=0] Error for partition __consumer_offsets-0 at offset 0 
> (kafka.server.ReplicaFetcherThread:76)
> org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server 
> does not host this topic-partition.
> [2019-11-13 04:43:16,191] ERROR [ReplicaFetcher replicaId=2, leaderId=0, 
> fetcherId=0] Error for partition __consumer_offsets-0 at offset 0 
> (kafka.server.ReplicaFetcherThread:76)
> org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server 
> does not host this topic-partition.
> [2019-11-13 04:43:16,384] ERROR [ReplicaFetcher replicaId=1, leaderId=2, 
> fetcherId=0] Error for partition e2etopic-0 at offset 0 
> (kafka.server.ReplicaFetcherThread:76)
> org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server 
> does not host this topic-partition.
> [2019-11-13 04:43:16,384] ERROR [ReplicaFetcher replicaId=0, leaderId=2, 
> fetcherId=0] Error for partition e2etopic-0 at offset 0 
> (kafka.server.ReplicaFetcherThread:76)
> org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server 
> does not 

[jira] [Updated] (KAFKA-9408) Use StandardCharsets UTF-8 in ApiUtils

2020-01-12 Thread David Mollitor (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-9408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Mollitor updated KAFKA-9408:
--
Component/s: core

> Use StandardCharsets UTF-8 in ApiUtils
> --
>
> Key: KAFKA-9408
> URL: https://issues.apache.org/jira/browse/KAFKA-9408
> Project: Kafka
>  Issue Type: Improvement
>  Components: core
>Reporter: David Mollitor
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9408) Use StandardCharsets UTF-8 in ApiUtils

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013811#comment-17013811
 ] 

ASF GitHub Bot commented on KAFKA-9408:
---

belugabehr commented on pull request #7940: KAFKA-9408: Use StandardCharsets 
UTF-8 in ApiUtils
URL: https://github.com/apache/kafka/pull/7940
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Use StandardCharsets UTF-8 in ApiUtils
> --
>
> Key: KAFKA-9408
> URL: https://issues.apache.org/jira/browse/KAFKA-9408
> Project: Kafka
>  Issue Type: Improvement
>  Components: core
>Reporter: David Mollitor
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9408) Use StandardCharsets UTF-8 in ApiUtils

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9408:
-

 Summary: Use StandardCharsets UTF-8 in ApiUtils
 Key: KAFKA-9408
 URL: https://issues.apache.org/jira/browse/KAFKA-9408
 Project: Kafka
  Issue Type: Improvement
Reporter: David Mollitor






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (KAFKA-9407) Return Immutable List from SchemaSourceTask

2020-01-12 Thread David Mollitor (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-9407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Mollitor updated KAFKA-9407:
--
Description: Currently returns an empty {{ArrayList}} or a 
{{Collections.singletonList()}}.  Make it a bit more symmetrical by only 
returning immutable lists (and save a few bytes of memory).

> Return Immutable List from SchemaSourceTask
> ---
>
> Key: KAFKA-9407
> URL: https://issues.apache.org/jira/browse/KAFKA-9407
> Project: Kafka
>  Issue Type: Improvement
>  Components: tools
>Reporter: David Mollitor
>Priority: Minor
>
> Currently returns an empty {{ArrayList}} or a 
> {{Collections.singletonList()}}.  Make it a bit more symmetrical by only 
> returning immutable lists (and save a few bytes of memory).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9407) Return Immutable List from SchemaSourceTask

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013810#comment-17013810
 ] 

ASF GitHub Bot commented on KAFKA-9407:
---

belugabehr commented on pull request #7939: KAFKA-9407: Return Immutable List 
from SchemaSourceTask
URL: https://github.com/apache/kafka/pull/7939
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Return Immutable List from SchemaSourceTask
> ---
>
> Key: KAFKA-9407
> URL: https://issues.apache.org/jira/browse/KAFKA-9407
> Project: Kafka
>  Issue Type: Improvement
>  Components: tools
>Reporter: David Mollitor
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9407) Return Immutable List from SchemaSourceTask

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9407:
-

 Summary: Return Immutable List from SchemaSourceTask
 Key: KAFKA-9407
 URL: https://issues.apache.org/jira/browse/KAFKA-9407
 Project: Kafka
  Issue Type: Improvement
  Components: tools
Reporter: David Mollitor






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9406) Modify CreateDelegationTokenOptions Renewers Implementation

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013807#comment-17013807
 ] 

ASF GitHub Bot commented on KAFKA-9406:
---

belugabehr commented on pull request #7938: KAFKA-9406: Modify 
CreateDelegationTokenOptions Renewers Implementation
URL: https://github.com/apache/kafka/pull/7938
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Modify CreateDelegationTokenOptions Renewers Implementation
> ---
>
> Key: KAFKA-9406
> URL: https://issues.apache.org/jira/browse/KAFKA-9406
> Project: Kafka
>  Issue Type: Improvement
>  Components: clients
>Reporter: David Mollitor
>Priority: Trivial
>
> * Use Collections#emptyList
>  * Require nonnull



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9406) Modify CreateDelegationTokenOptions Renewers Implementation

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9406:
-

 Summary: Modify CreateDelegationTokenOptions Renewers 
Implementation
 Key: KAFKA-9406
 URL: https://issues.apache.org/jira/browse/KAFKA-9406
 Project: Kafka
  Issue Type: Improvement
  Components: clients
Reporter: David Mollitor


* Use Collections#emptyList
 * Require nonnull



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9405) Use Map API computeIfAbsent Where Applicable

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013806#comment-17013806
 ] 

ASF GitHub Bot commented on KAFKA-9405:
---

belugabehr commented on pull request #7937: KAFKA-9405: Use Map API 
computeIfAbsent Where Applicable
URL: https://github.com/apache/kafka/pull/7937
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Use Map API computeIfAbsent Where Applicable
> 
>
> Key: KAFKA-9405
> URL: https://issues.apache.org/jira/browse/KAFKA-9405
> Project: Kafka
>  Issue Type: Improvement
>  Components: clients
>Reporter: David Mollitor
>Priority: Minor
>
> {quote}
> to implement a multi-value map, Map>, supporting multiple 
> values per key:
>  
>  map.computeIfAbsent(key, k -> new HashSet()).add(v);
> {quote}
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (KAFKA-9405) Use Map API computeIfAbsent Where Applicable

2020-01-12 Thread David Mollitor (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Mollitor updated KAFKA-9405:
--
Description: 
{quote}
to implement a multi-value map, Map>, supporting multiple 
values per key:
 
 map.computeIfAbsent(key, k -> new HashSet()).add(v);
{quote}

https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-

> Use Map API computeIfAbsent Where Applicable
> 
>
> Key: KAFKA-9405
> URL: https://issues.apache.org/jira/browse/KAFKA-9405
> Project: Kafka
>  Issue Type: Improvement
>  Components: clients
>Reporter: David Mollitor
>Priority: Minor
>
> {quote}
> to implement a multi-value map, Map>, supporting multiple 
> values per key:
>  
>  map.computeIfAbsent(key, k -> new HashSet()).add(v);
> {quote}
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9405) Use Map API computeIfAbsent Where Applicable

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9405:
-

 Summary: Use Map API computeIfAbsent Where Applicable
 Key: KAFKA-9405
 URL: https://issues.apache.org/jira/browse/KAFKA-9405
 Project: Kafka
  Issue Type: Improvement
  Components: clients
Reporter: David Mollitor






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9404) Use ArrayList instead of LinkedList in Sensor Class

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013805#comment-17013805
 ] 

ASF GitHub Bot commented on KAFKA-9404:
---

belugabehr commented on pull request #7936: KAFKA-9404: Use ArrayList instead 
of LinkedList in Sensor Class
URL: https://github.com/apache/kafka/pull/7936
 
 
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Use ArrayList instead of LinkedList in Sensor Class
> ---
>
> Key: KAFKA-9404
> URL: https://issues.apache.org/jira/browse/KAFKA-9404
> Project: Kafka
>  Issue Type: Improvement
>Reporter: David Mollitor
>Priority: Trivial
>
> Since this collection is going to be bulk-built once and not modified, better 
> to use an {{ArrayList}} since its memory requirements are smaller and it is 
> much faster here... just instantiate the internal array once and fill it... 
> as opposed to {{LinkedList}} that must build the nodes for each item 
> inserted.  {{ArrayList}} is also faster for iteration.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9404) Use ArrayList instead of LinkedList in Sensor Class

2020-01-12 Thread David Mollitor (Jira)
David Mollitor created KAFKA-9404:
-

 Summary: Use ArrayList instead of LinkedList in Sensor Class
 Key: KAFKA-9404
 URL: https://issues.apache.org/jira/browse/KAFKA-9404
 Project: Kafka
  Issue Type: Improvement
Reporter: David Mollitor


Since this collection is going to be bulk-built once and not modified, better 
to use an {{ArrayList}} since its memory requirements are smaller and it is 
much faster here... just instantiate the internal array once and fill it... as 
opposed to {{LinkedList}} that must build the nodes for each item inserted.  
{{ArrayList}} is also faster for iteration.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9403) Remove BaseConsumer from Mirrormaker

2020-01-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013765#comment-17013765
 ] 

ASF GitHub Bot commented on KAFKA-9403:
---

highluck commented on pull request #7935: KAFKA-9403: Remove BaseConsumer from 
Mirrormake
URL: https://github.com/apache/kafka/pull/7935
 
 
   BaseConsumerRecord is deprecated
   but MirrorMaker using BaseConsumerRecord
   
   Remove BaseConsumer from Mirrormaker
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove BaseConsumer from Mirrormaker
> 
>
> Key: KAFKA-9403
> URL: https://issues.apache.org/jira/browse/KAFKA-9403
> Project: Kafka
>  Issue Type: Improvement
>Reporter: highluck
>Assignee: highluck
>Priority: Minor
>
> BaseConsumerRecord is deprecated
> but MirrorMaker using BaseConsumerRecord
>  
> Remove BaseConsumer from Mirrormaker



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9403) Remove BaseConsumer from Mirrormaker

2020-01-12 Thread highluck (Jira)
highluck created KAFKA-9403:
---

 Summary: Remove BaseConsumer from Mirrormaker
 Key: KAFKA-9403
 URL: https://issues.apache.org/jira/browse/KAFKA-9403
 Project: Kafka
  Issue Type: Improvement
Reporter: highluck
Assignee: highluck


BaseConsumerRecord is deprecated

but MirrorMaker using BaseConsumerRecord

 

Remove BaseConsumer from Mirrormaker



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (KAFKA-9402) PartitionStates update Improvement Opinion

2020-01-12 Thread highluck (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-9402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

highluck resolved KAFKA-9402.
-
Resolution: Not A Problem

> PartitionStates update Improvement Opinion
> --
>
> Key: KAFKA-9402
> URL: https://issues.apache.org/jira/browse/KAFKA-9402
> Project: Kafka
>  Issue Type: Improvement
>Affects Versions: 2.4.0
>Reporter: highluck
>Assignee: highluck
>Priority: Minor
>  Labels: client
>
> PartitionStates update Improvement Opinion
>  
> PartitionStates#update 
>  
> {code:java}
> //
> LinkedHashMap> topicToPartitions = new 
> LinkedHashMap<>();
> for (TopicPartition tp : partitionToState.keySet()) {
> List partitions = 
> topicToPartitions.computeIfAbsent(tp.topic(), k -> new ArrayList<>());
> partitions.add(tp);
> }
> for (Map.Entry> entry : 
> topicToPartitions.entrySet()) {
> for (TopicPartition tp : entry.getValue()) {
> S state = partitionToState.get(tp);
> map.put(tp, state);
> }
> }
> {code}
> I think it's complicated by order.
>  
> It is a part that can be improved more simply
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (KAFKA-9402) PartitionStates update Improvement Opinion

2020-01-12 Thread highluck (Jira)
highluck created KAFKA-9402:
---

 Summary: PartitionStates update Improvement Opinion
 Key: KAFKA-9402
 URL: https://issues.apache.org/jira/browse/KAFKA-9402
 Project: Kafka
  Issue Type: Improvement
Affects Versions: 2.4.0
Reporter: highluck
Assignee: highluck


PartitionStates update Improvement Opinion

 

PartitionStates#update 

 
{code:java}
//
LinkedHashMap> topicToPartitions = new 
LinkedHashMap<>();
for (TopicPartition tp : partitionToState.keySet()) {
List partitions = 
topicToPartitions.computeIfAbsent(tp.topic(), k -> new ArrayList<>());
partitions.add(tp);
}
for (Map.Entry> entry : 
topicToPartitions.entrySet()) {
for (TopicPartition tp : entry.getValue()) {
S state = partitionToState.get(tp);
map.put(tp, state);
}
}

{code}
I think it's complicated by order.

 

It is a part that can be improved more simply

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KAFKA-9398) Kafka Streams main thread may not exit even after close timeout has passed

2020-01-12 Thread Dongjin Lee (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-9398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17013676#comment-17013676
 ] 

Dongjin Lee commented on KAFKA-9398:


Other related one: https://issues.apache.org/jira/browse/KAFKA-7996 Please 
refer to the comment of 12 Mar 2019. As of now, we can't specify the producer 
close timeout in Kafka Streams and it may hang up. How do you think? If you 
agree, I am eager to rebase to the latest trunk and reopen the discussion 
thread. cc/ [~mjsax]

> Kafka Streams main thread may not exit even after close timeout has passed
> --
>
> Key: KAFKA-9398
> URL: https://issues.apache.org/jira/browse/KAFKA-9398
> Project: Kafka
>  Issue Type: Improvement
>  Components: streams
>Reporter: Bill Bejeck
>Assignee: Bill Bejeck
>Priority: Critical
> Fix For: 2.5.0
>
>
> Kafka Streams offers the KafkaStreams.close() method when shutting down a 
> Kafka Streams application. There are two overloads to this method, one that 
> takes no parameters and another taking a Duration specifying how long the 
> close() method should block waiting for streams shut down operations to 
> complete. The no-arg version of close() sets the timeout to Long.MAX_VALUE.
> The issue is that if a StreamThread is taking to long to complete or if one 
> of the Consumer or Producer clients is in a hung state, the Kafka Streams 
> application won't exit even after the specified timeout has expired.
> For example, consider this scenario:
>  # A sink topic gets deleted by accident 
>  # The user sets Producer max.block.ms config to a high value
> In this case, the Producer will issue a WARN logging statement and will 
> continue to make metadata requests looking for the expected topic. The 
> {{Producer}} will continue making metadata requests up until the max.block.ms 
> expires. If this value is high enough, calling close() with a timeout won't 
> fix the issue as when the timeout expires, the Kafka Streams application's 
> main thread won't exit.
> To prevent this type of issue, we should call Thread.interrupt() on all 
> StreamThread instances once the close() timeout has expired. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)