mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 10:35:50 +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;
|
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.
|
/** Store a single object.
|
||||||
Depending on the implementation this may happen immediately
|
Depending on the implementation this may happen immediately
|
||||||
or deferred using a scheduled task.
|
or deferred using a scheduled task.
|
||||||
|
|||||||
@@ -128,6 +128,19 @@ public:
|
|||||||
return ok;
|
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
|
void
|
||||||
store (NodeObject::ref object)
|
store (NodeObject::ref object)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -148,6 +148,19 @@ public:
|
|||||||
return status;
|
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
|
void
|
||||||
do_insert (std::shared_ptr <NodeObject> const& no)
|
do_insert (std::shared_ptr <NodeObject> const& no)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,6 +53,19 @@ public:
|
|||||||
return notFound;
|
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
|
void
|
||||||
store (NodeObject::ref object)
|
store (NodeObject::ref object)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -266,6 +266,19 @@ public:
|
|||||||
return status;
|
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
|
void
|
||||||
store (NodeObject::ref object)
|
store (NodeObject::ref object)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -250,12 +250,25 @@ public:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
canFetchBatch() override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
store (NodeObject::ref object)
|
store (NodeObject::ref object)
|
||||||
{
|
{
|
||||||
storeBatch(Batch{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
|
void
|
||||||
storeBatch (Batch const& batch)
|
storeBatch (Batch const& batch)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user