◆ SingleFileStorageCommitState()
426757 : wal(wal), state(WALCommitState::IN_PROGRESS) {
426758 auto initial_size = storage.GetWALSize();
426759 initial_written = wal.GetTotalWritten();
426760 initial_wal_size = initial_size;
426761}
◆ ~SingleFileStorageCommitState()
| duckdb::SingleFileStorageCommitState::~SingleFileStorageCommitState |
( |
| ) |
|
|
override |
426763 {
426764 if (state != WALCommitState::IN_PROGRESS) {
426765 return;
426766 }
426767 try {
426768
426770 } catch (std::exception &ex) {
426771 ErrorData data(ex);
426772 try {
426773 DUCKDB_LOG_ERROR(wal.GetDatabase().GetDatabase(),
426774 "SingleFileStorageCommitState::~SingleFileStorageCommitState()\t\t" + data.Message());
426775 } catch (...) {
426776 }
426777 } catch (...) {
426778 }
426779}
void RevertCommit() override
Revert the commit.
Definition duckdb.cpp:426781
◆ RevertCommit()
| void duckdb::SingleFileStorageCommitState::RevertCommit |
( |
| ) |
|
|
overridevirtual |
Revert the commit.
Implements duckdb::StorageCommitState.
426781 {
426782 if (state != WALCommitState::IN_PROGRESS) {
426783 return;
426784 }
426785 if (wal.GetTotalWritten() > initial_written) {
426786
426787 wal.Truncate(initial_wal_size);
426788 }
426789 state = WALCommitState::TRUNCATED;
426790}
◆ FlushCommit()
| void duckdb::SingleFileStorageCommitState::FlushCommit |
( |
| ) |
|
|
overridevirtual |
Implements duckdb::StorageCommitState.
426792 {
426793 if (state != WALCommitState::IN_PROGRESS) {
426794 return;
426795 }
426796
426797 wal.Flush();
426798 state = WALCommitState::FLUSHED;
426799}
◆ AddRowGroupData()
Implements duckdb::StorageCommitState.
426802 {
426803 if (row_group_data->HasUpdates()) {
426804
426805 return;
426806 }
426807 auto &entries = optimistically_written_data[table];
426808 auto entry = entries.find(start_index);
426809 if (entry != entries.end()) {
426810 throw InternalException("FIXME: AddOptimisticallyWrittenRowGroup is writing a duplicate row group");
426811 }
426812 entries.insert(
426813 make_pair(start_index, OptimisticallyWrittenRowGroupData(start_index, count, std::move(row_group_data))));
426814}
◆ GetRowGroupData()
Implements duckdb::StorageCommitState.
426817 {
426818 auto entry = optimistically_written_data.find(table);
426819 if (entry == optimistically_written_data.end()) {
426820
426821 return nullptr;
426822 }
426823 auto &row_groups = entry->second;
426824 auto start_entry = row_groups.find(start_index);
426825 if (start_entry == row_groups.end()) {
426826
426827 return nullptr;
426828 }
426829 count = start_entry->second.count;
426830 return start_entry->second.row_group_data.get();
426831}
◆ HasRowGroupData()
| bool duckdb::SingleFileStorageCommitState::HasRowGroupData |
( |
| ) |
|
|
overridevirtual |
The documentation for this class was generated from the following file: