[
https://issues.apache.org/jira/browse/FLUME-1819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13641506#comment-13641506
]
Hari Shreedharan commented on FLUME-1819:
-----------------------------------------
Venkatesh,
Looks good. Some minor nits:
{code}
if(!eventList.isEmpty() &&
(systemClock.currentTimeMillis() -
lastPushToChannel) >= batchTimeout) {
{code}
can be written as
{code}
if(!eventList.isEmpty() && timeout()) {
{code}
Also, the following code repeats at least twice, and a 3rd time the first 2
lines occur (the 3rd & 4th line are harmless if executed at that time):
{code}
channelProcessor.processEventBatch(eventList);
sourceCounter.addToEventAcceptedCount(eventList.size());
eventList.clear();
lastPushToChannel = systemClock.currentTimeMillis();
{code}
This can be replaced with a method.
In the unit test,
{code}
context.put(ExecSourceConfigurationConstants.CONFIG_BATCH_TIME_OUT, "3000");
{code}
This should be slightly less, else this test might be flakey. How about
reducing this to 2500 or so?
Also, in the test, we should probably insert 3 different events - this can be
easily done by changing this to
outputStream.write(String.valueOf(lineNumber).getBytes()); and then inserting a
corresponding assert statements.
> ExecSource don't flush the cache if there is no input entries
> -------------------------------------------------------------
>
> Key: FLUME-1819
> URL: https://issues.apache.org/jira/browse/FLUME-1819
> Project: Flume
> Issue Type: Bug
> Components: Sinks+Sources
> Affects Versions: v1.3.0
> Reporter: Fengdong Yu
> Assignee: Venkatesh Sivasubramanian
> Fix For: v1.4.0
>
> Attachments: FLUME-1819-3.patch, FLUME-1819.patch,
> FLUME-1819.patch.1, FLUME-1819.patch.2
>
>
> ExecSource has a default batchSize: 20, exec source read data from the
> source, then put it into the cache, after the cache is full, push it to the
> channel.
> but if exec source's cache is not full, and there isn't any input for a long
> time, then these entries always kept in the cache, there is no chance to the
> channel until the source's cache is full.
> so, the patch added a new config line: batchTimeout for ExecSource, and
> default is 3 seconds, if batchTimeout exceeded, push all cached data to the
> channel even the cache is not full.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira