首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Flume源代码解读4

2012-07-27 
Flume源代码解读四? ?[ xcly原创于iteye,见http://xcly.iteye.com?]?? ? 今天介绍Flume里面用到的BackoffA

Flume源代码解读四

? ?[ xcly原创于iteye,见http://xcly.iteye.com?]

?

? ? 今天介绍Flume里面用到的BackoffAlgo算法,接口由BackoffPolicy定义,让我们看看下面的几个关键的方法

reset:Reset backoff state. Call this after successful attempts.每一次成功调用之后reset状态。

backoff:Modify state as if a backoff had just happened. Call this after failed?attempts。失败发生时调用的回退犯法。

isFailed:Has so much time passed that we assume the failure is irrecoverable? 如果返回true,不再尝试。

sleepIncrement:Wait time in millis until RetryOk should be true

waitUntilRetryOk:Wait until it's ok to retry.

?

? ? 在InsistentAppendDecorator,?InsistentOpenDecorator中调用了BackoffPolicy的子类CumulativeCappedExponentialBackoff,CumulativeCappedExponentialBackoff中的isfailed总是返回true,永远不会失败;总是不断尝试。

?

?

?

?

?

热点排行