summaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/common/replay_feedtoken_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/vespa/searchcore/proton/common/replay_feedtoken_state.h')
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/replay_feedtoken_state.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/common/replay_feedtoken_state.h b/searchcore/src/vespa/searchcore/proton/common/replay_feedtoken_state.h
new file mode 100644
index 00000000000..512f12a50af
--- /dev/null
+++ b/searchcore/src/vespa/searchcore/proton/common/replay_feedtoken_state.h
@@ -0,0 +1,26 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+#include "feedtoken.h"
+#include <vespa/vespalib/util/shared_operation_throttler.h>
+
+namespace proton::feedtoken {
+
+/*
+ * Feed token state used during replay. It contains a throttler token
+ * which allows the related shared operation throttler to track the completion
+ * of the feed operation.
+ */
+class ReplayState : public IState {
+ vespalib::SharedOperationThrottler::Token _throttler_token;
+public:
+ ~ReplayState() override;
+ ReplayState(vespalib::SharedOperationThrottler::Token throttler_token);
+ bool is_replay() const noexcept override;
+ void fail() override;
+ void setResult(ResultUP result, bool documentWasFound) override;
+ const storage::spi::Result &getResult() override;
+};
+
+}