summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2017-09-11 13:01:28 +0000
committerGeir Storli <geirst@oath.com>2017-09-11 13:01:28 +0000
commit7b0399c3c2bf8a68a10ed95b7610284abc3c3a98 (patch)
treeca9788de7e829fd6eb7f786fc1eb34357c631395 /searchlib
parent8d428444659e1ad3b83b2dedcfd5e0bdd20bce89 (diff)
Move read access part of IDocumentMetaStoreContext to searchlib.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h b/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h
new file mode 100644
index 00000000000..7e2e3def0d2
--- /dev/null
+++ b/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h
@@ -0,0 +1,42 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+#include <memory>
+
+namespace search {
+
+class IDocumentMetaStore;
+
+/**
+ * API for providing read interface to the document meta store.
+ */
+struct IDocumentMetaStoreContext {
+
+ /**
+ * Guard for access to the read interface.
+ * This guard should be alive as long as read interface is used.
+ */
+ struct IReadGuard {
+
+ typedef std::unique_ptr<IReadGuard> UP;
+
+ virtual ~IReadGuard() {}
+
+ /**
+ * Access to read interface.
+ */
+ virtual const search::IDocumentMetaStore &get() const = 0;
+ };
+
+ virtual ~IDocumentMetaStoreContext() {}
+
+ /**
+ * Access to read interface.
+ * Should be used by all reader threads.
+ */
+ virtual IReadGuard::UP getReadGuard() const = 0;
+
+};
+
+}