com.amazonaws.AmazonServiceException.isRetryable()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.amazonaws.AmazonServiceException.isRetryable()方法的一些代码示例,展示了AmazonServiceException.isRetryable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AmazonServiceException.isRetryable()方法的具体详情如下:
包路径:com.amazonaws.AmazonServiceException
类名称:AmazonServiceException
方法名:isRetryable

AmazonServiceException.isRetryable介绍

暂无

代码示例

代码示例来源:origin: apache/nifi

protected List<FlowFile> processServiceException(final ProcessSession session, List<FlowFile> flowFiles,
    AmazonServiceException exception) {
  List<FlowFile> failedFlowFiles = new ArrayList<>();
  for (FlowFile flowFile : flowFiles) {
    Map<String,String> attributes = new HashMap<>();
    attributes.put(DYNAMODB_ERROR_EXCEPTION_MESSAGE, exception.getMessage() );
    attributes.put(DYNAMODB_ERROR_CODE, exception.getErrorCode() );
    attributes.put(DYNAMODB_ERROR_MESSAGE, exception.getErrorMessage() );
    attributes.put(DYNAMODB_ERROR_TYPE, exception.getErrorType().name() );
    attributes.put(DYNAMODB_ERROR_SERVICE, exception.getServiceName() );
    attributes.put(DYNAMODB_ERROR_RETRYABLE, Boolean.toString(exception.isRetryable()));
    attributes.put(DYNAMODB_ERROR_REQUEST_ID, exception.getRequestId() );
    attributes.put(DYNAMODB_ERROR_STATUS_CODE, Integer.toString(exception.getStatusCode()) );
    attributes.put(DYNAMODB_ERROR_EXCEPTION_MESSAGE, exception.getMessage() );
    attributes.put(DYNAMODB_ERROR_RETRYABLE, Boolean.toString(exception.isRetryable()));
    flowFile = session.putAllAttributes(flowFile, attributes);
    failedFlowFiles.add(flowFile);
  }
  return failedFlowFiles;
}

代码示例来源:origin: org.apache.hadoop/hadoop-aws

public boolean isRetryable() {
 return getCause().isRetryable();
}

代码示例来源:origin: com.ibm.stocator/stocator

public boolean isRetryable() {
 return getCause().isRetryable();
}

代码示例来源:origin: CODAIT/stocator

public boolean isRetryable() {
 return getCause().isRetryable();
}

代码示例来源:origin: org.apache.nifi/nifi-aws-abstract-processors

protected List<FlowFile> processServiceException(final ProcessSession session, List<FlowFile> flowFiles,
    AmazonServiceException exception) {
  List<FlowFile> failedFlowFiles = new ArrayList<>();
  for (FlowFile flowFile : flowFiles) {
    Map<String,String> attributes = new HashMap<>();
    attributes.put(DYNAMODB_ERROR_EXCEPTION_MESSAGE, exception.getMessage() );
    attributes.put(DYNAMODB_ERROR_CODE, exception.getErrorCode() );
    attributes.put(DYNAMODB_ERROR_MESSAGE, exception.getErrorMessage() );
    attributes.put(DYNAMODB_ERROR_TYPE, exception.getErrorType().name() );
    attributes.put(DYNAMODB_ERROR_SERVICE, exception.getServiceName() );
    attributes.put(DYNAMODB_ERROR_RETRYABLE, Boolean.toString(exception.isRetryable()));
    attributes.put(DYNAMODB_ERROR_REQUEST_ID, exception.getRequestId() );
    attributes.put(DYNAMODB_ERROR_STATUS_CODE, Integer.toString(exception.getStatusCode()) );
    attributes.put(DYNAMODB_ERROR_EXCEPTION_MESSAGE, exception.getMessage() );
    attributes.put(DYNAMODB_ERROR_RETRYABLE, Boolean.toString(exception.isRetryable()));
    flowFile = session.putAllAttributes(flowFile, attributes);
    failedFlowFiles.add(flowFile);
  }
  return failedFlowFiles;
}

代码示例来源:origin: org.apache.hadoop/hadoop-aws

/**
 * Get low level details of an amazon exception for logging; multi-line.
 * @param e exception
 * @return string details
 */
public static String stringify(AmazonServiceException e) {
 StringBuilder builder = new StringBuilder(
   String.format("%s: %s error %d: %s; %s%s%n",
     e.getErrorType(),
     e.getServiceName(),
     e.getStatusCode(),
     e.getErrorCode(),
     e.getErrorMessage(),
     (e.isRetryable() ? " (retryable)": "")
   ));
 String rawResponseContent = e.getRawResponseContent();
 if (rawResponseContent != null) {
  builder.append(rawResponseContent);
 }
 return builder.toString();
}

相关文章