io.airlift.http.client.HttpClient.getMaxContentLength()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(175)

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

HttpClient.getMaxContentLength介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

long maxResponseSizeBytes = (long) (Math.min(httpClient.getMaxContentLength(), maxResponseSize.toBytes()) * 0.75);
this.maxResponseSize = new DataSize(maxResponseSizeBytes, BYTE);

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

public ExchangeClientFactory(
    BlockEncodingSerde blockEncodingSerde,
    DataSize maxBufferedBytes,
    DataSize maxResponseSize,
    int concurrentRequestMultiplier,
    Duration minErrorDuration,
    HttpClient httpClient,
    ScheduledExecutorService executor)
{
  this.blockEncodingSerde = blockEncodingSerde;
  this.maxBufferedBytes = requireNonNull(maxBufferedBytes, "maxBufferedBytes is null");
  this.concurrentRequestMultiplier = concurrentRequestMultiplier;
  this.minErrorDuration = requireNonNull(minErrorDuration, "minErrorDuration is null");
  this.httpClient = requireNonNull(httpClient, "httpClient is null");
  // Use only 0.75 of the maxResponseSize to leave room for additional bytes from the encoding
  // TODO figure out a better way to compute the size of data that will be transferred over the network
  requireNonNull(maxResponseSize, "maxResponseSize is null");
  long maxResponseSizeBytes = (long) (Math.min(httpClient.getMaxContentLength(), maxResponseSize.toBytes()) * 0.75);
  this.maxResponseSize = new DataSize(maxResponseSizeBytes, BYTE);
  this.executor = requireNonNull(executor, "executor is null");
  checkArgument(maxBufferedBytes.toBytes() > 0, "maxBufferSize must be at least 1 byte: %s", maxBufferedBytes);
  checkArgument(maxResponseSize.toBytes() > 0, "maxResponseSize must be at least 1 byte: %s", maxResponseSize);
  checkArgument(concurrentRequestMultiplier > 0, "concurrentRequestMultiplier must be at least 1: %s", concurrentRequestMultiplier);
}

代码示例来源:origin: io.prestosql/presto-main

long maxResponseSizeBytes = (long) (Math.min(httpClient.getMaxContentLength(), maxResponseSize.toBytes()) * 0.75);
this.maxResponseSize = new DataSize(maxResponseSizeBytes, BYTE);

代码示例来源:origin: prestosql/presto

long maxResponseSizeBytes = (long) (Math.min(httpClient.getMaxContentLength(), maxResponseSize.toBytes()) * 0.75);
this.maxResponseSize = new DataSize(maxResponseSizeBytes, BYTE);

相关文章