Skip to content
Snippets Groups Projects
Commit 6cac3e41 authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Work in progress: add async fetch with no lock for GC.

Make compilation and unit tests pass for checking.
parent d8685e4e
Branches
Tags
No related merge requests found
......@@ -24,6 +24,7 @@
namespace cta { namespace objectstore {
class GenericObject: public ObjectOps<serializers::GenericObject, serializers::GenericObject_t> {
std::unique_ptr <Backend::AsyncLockfreeFetcher> m_asyncLockfreeFetcher;
public:
GenericObject(const std::string & name, Backend & os):
ObjectOps<serializers::GenericObject, serializers::GenericObject_t>(os, name) {};
......@@ -33,11 +34,16 @@ public:
/** Overload of ObjectOps's implementation: this special object tolerates all
* types of objects */
void fetch();
/**
* Asynchronously fetch object without lock.
*/
void asyncLockfreeFetch();
/**
* Performs async fetch, wait, get
* TODO - temporary implementation to test the asyncLockfreeFetch
* wait for async object fetch and get the result.
*/
void lockfreeFetch();
void waitAndGetAsyncLockfreeFetch();
/** Overload of ObjectOps's implementation: we will leave the payload transparently
* untouched and only deal with header parameters */
......@@ -45,6 +51,7 @@ public:
/** Get the object's type (type is forced implicitly in other classes) */
serializers::ObjectType type();
serializers::ObjectType getTypeWithNoLock();
/** Overload of ObjectOps's implementation: this operation is forbidden. Generic
* Object is only used to manipulate existing objects */
......
......@@ -141,6 +141,12 @@ public:
return m_header.owner();
}
std::string getOwnerWithNoLock() {
if (!m_headerInterpreted)
throw NotFetched("In ObjectOps::checkHeaderReadable: header not yet fetched or initialized");
return m_header.owner();
}
void setBackupOwner(const std::string & owner) {
checkHeaderWritable();
m_header.set_backupowner(owner);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment