X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=include%2Fsdl%2Fsyncstorage.hpp;h=409207f29537ae10f2d5f8d2b8c7ed299611bc1c;hb=faf9fc79e58fa4ace9b0ef317b741afb2c1a8abe;hp=eff5032636aa1467d80aeeed482ee8d8f7da5c38;hpb=a0745d294dcd72f7d78ea4c3accd3b477dd668a5;p=ric-plt%2Fsdl.git diff --git a/include/sdl/syncstorage.hpp b/include/sdl/syncstorage.hpp index eff5032..409207f 100644 --- a/include/sdl/syncstorage.hpp +++ b/include/sdl/syncstorage.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -211,7 +212,7 @@ namespace shareddatalayer const Data& data) = 0; /** - * Find all keys matching search pattern under the namespace. No prior knowledge about the keys in the given + * Find all keys matching search key prefix under the namespace. No prior knowledge about the keys in the given * namespace exists, thus operation is not guaranteed to be atomic or isolated. * * Exceptions thrown (excluding standard exceptions such as std::bad_alloc) are all derived from @@ -249,6 +250,21 @@ namespace shareddatalayer */ virtual void removeAll(const Namespace& ns) = 0; + /** + * Set a timeout value for the synchronous SDL read, write and remove operations. + * By default synchronous read, write and remove operations do not have any timeout + * for the backend data storage readiness, operations are pending interminable to + * finish until backend is ready. With this API function default behaviour can be + * changed and when a timeout happens, an error exception is risen for the SDL + * operation in question. To avoid unnecessary timeout failure due to a temporal + * connection issue, it is recommended not to set too short timeout value. + * Reasonable timeout value is 5 seconds or bigger value. On a side note, timeout + * value 0 means interminable pending time. + * + * @param timeout Timeout value to set. + */ + virtual void setOperationTimeout(const std::chrono::steady_clock::duration& timeout) = 0; + /** * Create a new instance of SyncStorage. *