Kùzu C++ API
Loading...
Searching...
No Matches
local_storage.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <unordered_map>
4
5
#include "
copy_constructors.h
"
6
#include "
local_table.h
"
7
8
namespace
kuzu
{
9
namespace
main {
10
class
ClientContext;
11
}
// namespace main
12
namespace
storage {
13
14
class
WAL;
15
// Data structures in LocalStorage are not thread-safe.
16
// For now, we only support single thread insertions and updates. Once we optimize them with
17
// multiple threads, LocalStorage and its related data structures should be reworked to be
18
// thread-safe.
19
class
LocalStorage
{
20
public
:
21
enum class
NotExistAction
{
CREATE
,
RETURN_NULL
};
22
23
explicit
LocalStorage
(
main::ClientContext
& clientContext) : clientContext{clientContext} {}
24
DELETE_COPY_AND_MOVE
(
LocalStorage
);
25
26
LocalTable
*
getLocalTable
(
common::table_id_t
tableID,
27
NotExistAction
action =
NotExistAction::RETURN_NULL
);
28
29
void
commit
();
30
void
rollback
();
31
32
uint64_t
getEstimatedMemUsage
()
const
;
33
34
private
:
35
main::ClientContext
& clientContext;
36
std::unordered_map<common::table_id_t, std::unique_ptr<LocalTable>> tables;
37
};
38
39
}
// namespace storage
40
}
// namespace kuzu
kuzu::main::ClientContext
Contain client side configuration. We make profiler associated per query, so profiler is not maintain...
Definition
client_context.h:51
kuzu::storage::LocalStorage
Definition
local_storage.h:19
kuzu::storage::LocalStorage::commit
void commit()
kuzu::storage::LocalStorage::NotExistAction
NotExistAction
Definition
local_storage.h:21
kuzu::storage::LocalStorage::NotExistAction::CREATE
@ CREATE
kuzu::storage::LocalStorage::NotExistAction::RETURN_NULL
@ RETURN_NULL
kuzu::storage::LocalStorage::DELETE_COPY_AND_MOVE
DELETE_COPY_AND_MOVE(LocalStorage)
kuzu::storage::LocalStorage::getEstimatedMemUsage
uint64_t getEstimatedMemUsage() const
kuzu::storage::LocalStorage::LocalStorage
LocalStorage(main::ClientContext &clientContext)
Definition
local_storage.h:23
kuzu::storage::LocalStorage::getLocalTable
LocalTable * getLocalTable(common::table_id_t tableID, NotExistAction action=NotExistAction::RETURN_NULL)
kuzu::storage::LocalStorage::rollback
void rollback()
kuzu::storage::LocalTable
Definition
local_table.h:25
copy_constructors.h
local_table.h
kuzu::common::table_id_t
uint64_t table_id_t
Definition
internal_id_t.h:14
kuzu
Definition
alter_type.h:5
headers
local_storage.h
Generated by
1.12.0