当前位置: 首页>>代码示例>>Java>>正文


Java RetryExecutor类代码示例

本文整理汇总了Java中org.embulk.spi.util.RetryExecutor的典型用法代码示例。如果您正苦于以下问题:Java RetryExecutor类的具体用法?Java RetryExecutor怎么用?Java RetryExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RetryExecutor类属于org.embulk.spi.util包,在下文中一共展示了RetryExecutor类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeWithRetry

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
public static <T> T executeWithRetry(int maximumRetries, int initialRetryIntervalMillis, int maximumRetryIntervalMillis, AlwaysRetryRetryable<T> alwaysRetryRetryable) throws RetryExecutor.RetryGiveupException, InterruptedException
{
    return RetryExecutor
            .retryExecutor()
            .withRetryLimit(maximumRetries)
            .withInitialRetryWait(initialRetryIntervalMillis)
            .withMaxRetryWait(maximumRetryIntervalMillis)
            .runInterruptible(alwaysRetryRetryable);
}
 
开发者ID:treasure-data,项目名称:embulk-input-marketo,代码行数:10,代码来源:MarketoUtils.java

示例2: onRetry

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void onRetry(Exception exception, int retryCount, int retryLimit, int retryWait) throws RetryExecutor.RetryGiveupException
{
    LOGGER.info("Retry [{}]/[{}] with retryWait [{}] on exception {}", retryCount, retryLimit, retryWait, exception.getMessage());
}
 
开发者ID:treasure-data,项目名称:embulk-input-marketo,代码行数:6,代码来源:MarketoUtils.java

示例3: onGiveup

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void onGiveup(Exception firstException, Exception lastException) throws RetryExecutor.RetryGiveupException
{
    LOGGER.info("Giving up execution on exception", lastException);
}
 
开发者ID:treasure-data,项目名称:embulk-input-marketo,代码行数:6,代码来源:MarketoUtils.java

示例4: onRetry

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void onRetry(Exception exception, int retryCount, int retryLimit, int retryWait)
        throws RetryExecutor.RetryGiveupException
{
    logger.warn("retrying {}/{} after {} seconds. Message: {}",
            retryCount, retryLimit, retryWait / 1000,
            exception.getMessage());
}
 
开发者ID:takumakanari,项目名称:embulk-input-http,代码行数:9,代码来源:RetryableHandler.java

示例5: onGiveup

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void onGiveup(Exception firstException, Exception lastException)
        throws RetryExecutor.RetryGiveupException
{
    logger.error("giveup {}", lastException.getMessage());
}
 
开发者ID:takumakanari,项目名称:embulk-input-http,代码行数:7,代码来源:RetryableHandler.java

示例6: onRetry

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void onRetry(Exception exception, int retryCount, int retryLimit, int retryWait)
        throws RetryExecutor.RetryGiveupException
{
    String m = String.format(
            "%s. (Retry: Count: %d, Limit: %d, Wait: %d ms)",
            exception.getMessage(),
            retryCount,
            retryLimit,
            retryWait);
    logger.warn(m, exception);
}
 
开发者ID:civitaspo,项目名称:embulk-output-hdfs,代码行数:13,代码来源:HdfsClient.java

示例7: onGiveup

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void onGiveup(Exception firstException, Exception lastException)
        throws RetryExecutor.RetryGiveupException
{
}
 
开发者ID:civitaspo,项目名称:embulk-output-hdfs,代码行数:6,代码来源:HdfsClient.java

示例8: run

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
private <T> T run(Retryable<T> retryable)
{
    try {
        return re.run(retryable);
    }
    catch (RetryExecutor.RetryGiveupException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:civitaspo,项目名称:embulk-output-hdfs,代码行数:10,代码来源:HdfsClient.java

示例9: add

import org.embulk.spi.util.RetryExecutor; //导入依赖的package包/类
@Override
public void add(Buffer buffer)
{
    try {
        // this implementation is for creating file when there is data.
        if (o == null) {
            o = hdfsClient.create(currentPath, overwrite);
            logger.info("Uploading '{}'", currentPath);
        }
        write(buffer);
    }
    catch (RetryExecutor.RetryGiveupException e) {
        throw new RuntimeException(e);
    }
    finally {
        buffer.release();
    }
}
 
开发者ID:civitaspo,项目名称:embulk-output-hdfs,代码行数:19,代码来源:HdfsFileOutput.java


注:本文中的org.embulk.spi.util.RetryExecutor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。