25 namespace Catalog_Namespace {
34 std::shared_ptr<Catalog>
cat,
37 void erase(
const std::string& session_id);
39 void eraseByDB(
const std::string& db_name);
42 std::vector<SessionInfoPtr>
getUserSessions(
const std::string& user_name);
50 static std::unique_ptr<SessionsStore>
create(
const std::string& base_path,
52 int idle_session_duration,
53 int max_session_duration,
59 int idle_session_duration,
60 int max_session_duration);
63 virtual void eraseUnlocked(
const std::string& session_id) = 0;
65 virtual std::vector<SessionInfoPtr>
getIf(
virtual ~SessionsStore()=default
void erase(const std::string &session_id)
virtual SessionInfoPtr getUnlocked(const std::string &session_id)=0
std::function< void(SessionInfoPtr &session)> DisconnectCallback
virtual void eraseUnlocked(const std::string &session_id)=0
virtual DisconnectCallback getDisconnectCallback()=0
SessionInfo getSessionCopy(const std::string &session_id)
virtual heavyai::shared_mutex & getLock()=0
bool isSessionExpired(const SessionInfoPtr &session_ptr, int idle_session_duration, int max_session_duration)
virtual bool isSessionInUse(const SessionInfoPtr &session_ptr)=0
virtual void eraseIf(std::function< bool(const SessionInfoPtr &)> predicate)=0
virtual SessionInfoPtr add(const Catalog_Namespace::UserMetadata &user_meta, std::shared_ptr< Catalog > cat, ExecutorDeviceType device)=0
static std::unique_ptr< SessionsStore > create(const std::string &base_path, size_t n_workers, int idle_session_duration, int max_session_duration, int capacity, DisconnectCallback disconnect_callback)
virtual std::vector< SessionInfoPtr > getIf(std::function< bool(const SessionInfoPtr &)> predicate)=0
void eraseByUser(const std::string &user_name)
void disconnect(const std::string session_id)
SessionInfoPtr getByPublicID(const std::string &public_id)
std::shared_timed_mutex shared_mutex
std::vector< SessionInfoPtr > getAllSessions()
void eraseByDB(const std::string &db_name)
std::vector< SessionInfoPtr > getUserSessions(const std::string &user_name)
std::shared_ptr< SessionInfo > SessionInfoPtr