diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-09-28 17:38:19 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-09-28 17:38:19 +0200 |
commit | b12c17ea5e8a738570bc897e0fcd1e7f19688688 (patch) | |
tree | aa48cbfe679e9ca1c5b83812e8e6cf45257784ab /searchcore/src/apps/vespa-feed-bm/storage_api_chain_bm_feed_handler.h | |
parent | af1d10a394b55cc0d31575bf979cecbbc177c568 (diff) | |
parent | 22e2f5ad80aedfe8ed3a9af7c7c11244ef184ed3 (diff) |
Merge branch 'master' into bratseth/autoscaling-reconfiguration-events
Diffstat (limited to 'searchcore/src/apps/vespa-feed-bm/storage_api_chain_bm_feed_handler.h')
-rw-r--r-- | searchcore/src/apps/vespa-feed-bm/storage_api_chain_bm_feed_handler.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/searchcore/src/apps/vespa-feed-bm/storage_api_chain_bm_feed_handler.h b/searchcore/src/apps/vespa-feed-bm/storage_api_chain_bm_feed_handler.h new file mode 100644 index 00000000000..521deddd19e --- /dev/null +++ b/searchcore/src/apps/vespa-feed-bm/storage_api_chain_bm_feed_handler.h @@ -0,0 +1,34 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include "i_bm_feed_handler.h" + +namespace storage { class IStorageChainBuilder; } +namespace storage::api { class StorageCommand; } + +namespace feedbm { + +/* + * Benchmark feed handler for feed to service layer using storage api protocol + * directly on the storage chain. + */ +class StorageApiChainBmFeedHandler : public IBmFeedHandler +{ +public: + struct Context; +private: + std::shared_ptr<Context> _context; + void send_msg(std::shared_ptr<storage::api::StorageCommand> cmd, PendingTracker& tracker); +public: + StorageApiChainBmFeedHandler(std::shared_ptr<Context> context); + ~StorageApiChainBmFeedHandler(); + void put(const document::Bucket& bucket, std::unique_ptr<document::Document> document, uint64_t timestamp, PendingTracker& tracker) override; + void update(const document::Bucket& bucket, std::unique_ptr<document::DocumentUpdate> document_update, uint64_t timestamp, PendingTracker& tracker) override; + void remove(const document::Bucket& bucket, const document::DocumentId& document_id, uint64_t timestamp, PendingTracker& tracker) override; + + static std::shared_ptr<Context> get_context(); + static std::unique_ptr<storage::IStorageChainBuilder> get_storage_chain_builder(std::shared_ptr<Context> context); +}; + +} |