aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h')
-rw-r--r--searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h b/searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h
new file mode 100644
index 00000000000..82048b3eb3f
--- /dev/null
+++ b/searchcore/src/vespa/searchcore/proton/flushengine/priority_flush_token.h
@@ -0,0 +1,21 @@
+// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+#include <vespa/vespalib/util/idestructorcallback.h>
+#include <future>
+
+namespace proton {
+
+/*
+ * This token is shared between flushes initiated from a priority flush
+ * strategy (cf. Proton::triggerFLush and Proton::prepareRestart).
+ */
+class PriorityFlushToken : public vespalib::IDestructorCallback {
+ std::promise<void> _promise;
+public:
+ PriorityFlushToken(std::promise<void> promise);
+ ~PriorityFlushToken() override;
+};
+
+}