Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ public Directory newFSDirectory(Path location, LockFactory lockFactory, IndexSet
public Directory newDirectory(IndexSettings indexSettings, ShardPath path) throws IOException {
String repositoryName = indexSettings.getRemoteStoreRepository();
String indexUUID = indexSettings.getIndex().getUUID();

return newDirectory(
repositoryName,
indexUUID,
path.getShardId(),
indexSettings.getRemoteStorePathStrategy(),
null,
RemoteStoreUtils.isServerSideEncryptionEnabledIndex(indexSettings.getIndexMetadata())
RemoteStoreUtils.isServerSideEncryptionEnabledIndex(indexSettings.getIndexMetadata()),
indexSettings.isWarmIndex()
);
}

Expand All @@ -101,6 +101,18 @@ public Directory newDirectory(
RemoteStorePathStrategy pathStrategy,
String indexFixedPrefix,
boolean isServerSideEncryptionEnabled
) throws IOException {
return newDirectory(repositoryName, indexUUID, shardId, pathStrategy, indexFixedPrefix, isServerSideEncryptionEnabled, false);
}

public Directory newDirectory(
String repositoryName,
String indexUUID,
ShardId shardId,
RemoteStorePathStrategy pathStrategy,
String indexFixedPrefix,
boolean isServerSideEncryptionEnabled,
boolean isWarmIndex
) throws IOException {
assert Objects.nonNull(pathStrategy);
// We should be not calling close for repository.
Expand Down Expand Up @@ -128,7 +140,9 @@ public Directory newDirectory(
blobStoreRepository.blobStore(isServerSideEncryptionEnabled).blobContainer(dataPath),
blobStoreRepository::maybeRateLimitRemoteUploadTransfers,
blobStoreRepository::maybeRateLimitLowPriorityRemoteUploadTransfers,
blobStoreRepository::maybeRateLimitRemoteDownloadTransfers,
isWarmIndex
? blobStoreRepository::maybeRateLimitRemoteDownloadTransfersForWarm
: blobStoreRepository::maybeRateLimitRemoteDownloadTransfers,
blobStoreRepository::maybeRateLimitLowPriorityDownloadTransfers,
pendingDownloadMergedSegments
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,15 @@ public InputStream maybeRateLimitRemoteDownloadTransfers(InputStream inputStream
);
}

public InputStream maybeRateLimitRemoteDownloadTransfersForWarm(InputStream inputStream) {
return maybeRateLimit(
inputStream,
() -> remoteDownloadRateLimiter,
remoteDownloadRateLimitingTimeInNanos,
BlobStoreTransferContext.REMOTE_DOWNLOAD
);
}

public InputStream maybeRateLimitLowPriorityDownloadTransfers(InputStream inputStream) {
return maybeRateLimit(
maybeRateLimit(
Expand Down
Loading