com.amazonaws.Request.getOriginalRequestObject()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(139)

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

Request.getOriginalRequestObject介绍

暂无

代码示例

代码示例来源:origin: aws/aws-sdk-java

/**
   * Returned the best-guessed throughput metric type for the given request,
   * or null if there is none or if metric is disabled.
   */
  public static ThroughputMetricType guessThroughputMetricType(
      final Request<?> req,
      final String metricNameSuffix,
      final String byteCountMetricNameSuffix)
  {
    if (!AwsSdkMetrics.isMetricsEnabled())
      return null;    // metric disabled
    Object orig = req.getOriginalRequestObject();
    if (orig.getClass().getName().startsWith("com.amazonaws.services.s3")) {
      return new SimpleThroughputMetricType(
        "S3" + metricNameSuffix,
        req.getServiceName(),
        "S3" + byteCountMetricNameSuffix);
    }
    return null;
  }
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

/**
   * Returned the best-guessed throughput metric type for the given request,
   * or null if there is none or if metric is disabled.
   */
  public static ThroughputMetricType guessThroughputMetricType(
      final Request<?> req,
      final String metricNameSuffix,
      final String byteCountMetricNameSuffix)
  {
    if (!AwsSdkMetrics.isMetricsEnabled())
      return null;    // metric disabled
    Object orig = req.getOriginalRequestObject();
    if (orig.getClass().getName().startsWith("com.amazonaws.services.s3")) {
      return new SimpleThroughputMetricType(
        "S3" + metricNameSuffix,
        req.getServiceName(),
        "S3" + byteCountMetricNameSuffix);
    }
    return null;
  }
}

代码示例来源:origin: Nextdoor/bender

/**
   * Returned the best-guessed throughput metric type for the given request,
   * or null if there is none or if metric is disabled.
   */
  public static ThroughputMetricType guessThroughputMetricType(
      final Request<?> req,
      final String metricNameSuffix,
      final String byteCountMetricNameSuffix)
  {
    if (!AwsSdkMetrics.isMetricsEnabled())
      return null;    // metric disabled
    Object orig = req.getOriginalRequestObject();
    if (orig.getClass().getName().startsWith("com.amazonaws.services.s3")) {
      return new SimpleThroughputMetricType(
        "S3" + metricNameSuffix,
        req.getServiceName(),
        "S3" + byteCountMetricNameSuffix);
    }
    return null;
  }
}

相关文章