// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "idealstateoperation.h" #include namespace storage::distributor { class PendingMessageTracker; class RemoveBucketOperation : public IdealStateOperation { public: RemoveBucketOperation(const ClusterContext &cluster_context, const BucketAndNodes& nodes) : IdealStateOperation(nodes), _tracker(cluster_context) {} ~RemoveBucketOperation() override; /** Sends messages, returns true if we are done (sent nothing). */ bool onStartInternal(DistributorStripeMessageSender& sender); /** Sends messages, calls done() if we are done (sent nothing). */ void onStart(DistributorStripeMessageSender& sender) override; bool onReceiveInternal(const std::shared_ptr &); void onReceive(DistributorStripeMessageSender& sender, const std::shared_ptr &) override; const char* getName() const noexcept override { return "remove"; }; Type getType() const noexcept override { return DELETE_BUCKET; } bool shouldBlockThisOperation(uint32_t, uint16_t, uint8_t) const override; protected: MessageTracker _tracker; }; }