[
https://issues.apache.org/jira/browse/KAFKA-2615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14945641#comment-14945641
]
Jason Gustafson commented on KAFKA-2615:
----------------------------------------
[~enothereska] Could we pull the Time object into NetworkClient? This might let
us avoid unneeded system calls by exposing higher-level methods. For example,
the usual pattern for sending requests looks something like this:
{code}
long now = time.milliseconds();
if (client.ready(node, now)) {
client.send(request, now);
}
{code}
If the Time object was internal to NetworkClient, we could avoid the extra
system call by combining this logic into a single method to avoid the
additional system call:
{code}
boolean sendIfReady(Request request);
{code}
> Poll() method is broken wrt time
> --------------------------------
>
> Key: KAFKA-2615
> URL: https://issues.apache.org/jira/browse/KAFKA-2615
> Project: Kafka
> Issue Type: Bug
> Components: clients, consumer, producer
> Affects Versions: 0.8.2.1
> Reporter: Eno Thereska
> Assignee: Eno Thereska
>
> Initially reported by [~ewencp] and discussed with [~hachikuji]. In
> NetworkClient.java, the poll() method receives as input a "now" parameter,
> does a whole bunch of work (e.g., selector.poll()) and then keeps using "now"
> in all the subsequent method calls.
> Passing Time everywhere instead of "now" is a potential fix, but might be
> expensive since it's a new system call.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)