// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "sample_attribute_usage_job.h" #include #include #include #include #include namespace proton { SampleAttributeUsageJob:: SampleAttributeUsageJob(IAttributeManagerSP readyAttributeManager, IAttributeManagerSP notReadyAttributeManager, AttributeUsageFilter &attributeUsageFilter, const vespalib::string &docTypeName, vespalib::duration interval) : IMaintenanceJob("sample_attribute_usage." + docTypeName, vespalib::duration::zero(), interval), _readyAttributeManager(std::move(readyAttributeManager)), _notReadyAttributeManager(std::move(notReadyAttributeManager)), _attributeUsageFilter(attributeUsageFilter) { } SampleAttributeUsageJob::~SampleAttributeUsageJob() = default; bool SampleAttributeUsageJob::run() { auto context = std::make_shared (_attributeUsageFilter); _readyAttributeManager->asyncForEachAttribute(std::make_shared(context, "ready")); _notReadyAttributeManager->asyncForEachAttribute(std::make_shared(context, "notready")); return true; } } // namespace proton