mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 02:25:53 +00:00
Add fetchBatch Backend interface
This commit is contained in:
committed by
Nik Bougalis
parent
41c68f4bbc
commit
1b49776819
@@ -65,6 +65,16 @@ public:
|
||||
*/
|
||||
virtual Status fetch (void const* key, NodeObject::Ptr* pObject) = 0;
|
||||
|
||||
/** Return `true` if batch fetches are optimized. */
|
||||
virtual
|
||||
bool
|
||||
canFetchBatch() = 0;
|
||||
|
||||
/** Fetch a batch synchronously. */
|
||||
virtual
|
||||
std::vector<std::shared_ptr<NodeObject>>
|
||||
fetchBatch (std::size_t n, void const* const* keys) = 0;
|
||||
|
||||
/** Store a single object.
|
||||
Depending on the implementation this may happen immediately
|
||||
or deferred using a scheduled task.
|
||||
|
||||
@@ -128,6 +128,19 @@ public:
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<NodeObject>>
|
||||
fetchBatch (std::size_t n, void const* const* keys) override
|
||||
{
|
||||
throw std::runtime_error("pure virtual called");
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
store (NodeObject::ref object)
|
||||
{
|
||||
|
||||
@@ -148,6 +148,19 @@ public:
|
||||
return status;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<NodeObject>>
|
||||
fetchBatch (std::size_t n, void const* const* keys) override
|
||||
{
|
||||
throw std::runtime_error("pure virtual called");
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
do_insert (std::shared_ptr <NodeObject> const& no)
|
||||
{
|
||||
|
||||
@@ -53,6 +53,19 @@ public:
|
||||
return notFound;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<NodeObject>>
|
||||
fetchBatch (std::size_t n, void const* const* keys) override
|
||||
{
|
||||
throw std::runtime_error("pure virtual called");
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
store (NodeObject::ref object)
|
||||
{
|
||||
|
||||
@@ -266,6 +266,19 @@ public:
|
||||
return status;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<NodeObject>>
|
||||
fetchBatch (std::size_t n, void const* const* keys) override
|
||||
{
|
||||
throw std::runtime_error("pure virtual called");
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
store (NodeObject::ref object)
|
||||
{
|
||||
|
||||
@@ -250,12 +250,25 @@ public:
|
||||
return status;
|
||||
}
|
||||
|
||||
bool
|
||||
canFetchBatch() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
store (NodeObject::ref object)
|
||||
{
|
||||
storeBatch(Batch{object});
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<NodeObject>>
|
||||
fetchBatch (std::size_t n, void const* const* keys) override
|
||||
{
|
||||
throw std::runtime_error("pure virtual called");
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
storeBatch (Batch const& batch)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user