use of com.linkedin.pinot.controller.validation.StorageQuotaChecker in project pinot by linkedin.
the class PinotSegmentUploadRestletResource method checkStorageQuota.
/**
* check if the segment represented by segmentFile is within the storage quota
* @param segmentFile untarred segment. This should not be null.
* segmentFile must exist on disk and must be a directory
* @param metadata segment metadata. This should not be null
*/
private StorageQuotaChecker.QuotaCheckerResponse checkStorageQuota(@Nonnull File segmentFile, @Nonnull SegmentMetadata metadata, @Nonnull OfflineTableConfig offlineTableConfig) {
TableSizeReader tableSizeReader = new TableSizeReader(executor, connectionManager, _pinotHelixResourceManager);
StorageQuotaChecker quotaChecker = new StorageQuotaChecker(offlineTableConfig, tableSizeReader);
String offlineTableName = TableNameBuilder.OFFLINE_TABLE_NAME_BUILDER.forTable(metadata.getTableName());
return quotaChecker.isSegmentStorageWithinQuota(segmentFile, offlineTableName, metadata.getName(), _controllerConf.getServerAdminRequestTimeoutSeconds() * 1000);
}
Aggregations