當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。