mirror of
https://github.com/apache/druid.git
synced 2025-02-20 00:47:40 +00:00
Fix NPE in PrefetchableTextFilesFirehoseFactory (#5802)
This commit is contained in:
parent
bc0ff251a3
commit
8799d46fe9
@ -28,7 +28,6 @@ public class PrefetchConfig
|
|||||||
public static final long DEFAULT_MAX_CACHE_CAPACITY_BYTES = 1024 * 1024 * 1024; // 1GB
|
public static final long DEFAULT_MAX_CACHE_CAPACITY_BYTES = 1024 * 1024 * 1024; // 1GB
|
||||||
public static final long DEFAULT_MAX_FETCH_CAPACITY_BYTES = 1024 * 1024 * 1024; // 1GB
|
public static final long DEFAULT_MAX_FETCH_CAPACITY_BYTES = 1024 * 1024 * 1024; // 1GB
|
||||||
public static final long DEFAULT_FETCH_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(60);
|
public static final long DEFAULT_FETCH_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(60);
|
||||||
public static final int DEFAULT_MAX_FETCH_RETRY = 3;
|
|
||||||
|
|
||||||
// A roughly max size of total fetched objects, but the actual fetched size can be bigger. The reason is our current
|
// A roughly max size of total fetched objects, but the actual fetched size can be bigger. The reason is our current
|
||||||
// client implementations for cloud storages like s3 don't support range scan yet, so we must download the whole file
|
// client implementations for cloud storages like s3 don't support range scan yet, so we must download the whole file
|
||||||
|
@ -91,6 +91,8 @@ public abstract class PrefetchableTextFilesFirehoseFactory<T>
|
|||||||
{
|
{
|
||||||
private static final Logger LOG = new Logger(PrefetchableTextFilesFirehoseFactory.class);
|
private static final Logger LOG = new Logger(PrefetchableTextFilesFirehoseFactory.class);
|
||||||
|
|
||||||
|
public static final int DEFAULT_MAX_FETCH_RETRY = 3;
|
||||||
|
|
||||||
private final CacheManager<T> cacheManager;
|
private final CacheManager<T> cacheManager;
|
||||||
private final PrefetchConfig prefetchConfig;
|
private final PrefetchConfig prefetchConfig;
|
||||||
|
|
||||||
@ -114,7 +116,7 @@ public abstract class PrefetchableTextFilesFirehoseFactory<T>
|
|||||||
this.cacheManager = new CacheManager<>(
|
this.cacheManager = new CacheManager<>(
|
||||||
prefetchConfig.getMaxCacheCapacityBytes()
|
prefetchConfig.getMaxCacheCapacityBytes()
|
||||||
);
|
);
|
||||||
this.maxFetchRetry = maxFetchRetry;
|
this.maxFetchRetry = maxFetchRetry == null ? DEFAULT_MAX_FETCH_RETRY : maxFetchRetry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
|
Loading…
x
Reference in New Issue
Block a user