Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 committed Apr 9, 2024
1 parent 1e3cdc2 commit 5840b68
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 65 deletions.
5 changes: 0 additions & 5 deletions src/include/storage/wal/wal_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ enum class DBFileType : uint8_t {
METADATA = 2,
};

std::string dbFileTypeToString(DBFileType dbFileType);

// DBFileID start with 1 byte type and 1 byte isOverflow field followed with additional
// bytes needed by the different log types. We don't need these to be byte aligned because they are
// not stored in memory. These are used to serialize and deserialize log entries.
Expand All @@ -54,16 +52,13 @@ enum class WALRecordType : uint8_t {
COMMIT_RECORD = 3,
CATALOG_RECORD = 4,
CREATE_TABLE_RECORD = 6,
CREATE_REL_TABLE_GROUP_RECORD = 7,
CREATE_RDF_GRAPH_RECORD = 8,
COPY_TABLE_RECORD = 19,
DROP_TABLE_RECORD = 20,
DROP_PROPERTY_RECORD = 21,
ADD_PROPERTY_RECORD = 22,
};

std::string walRecordTypeToString(WALRecordType walRecordType);

struct WALRecord {
WALRecordType type;

Expand Down
58 changes: 0 additions & 58 deletions src/storage/wal/wal_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,6 @@ std::unique_ptr<AddPropertyRecord> AddPropertyRecord::deserialize(
return retVal;
}

std::string dbFileTypeToString(DBFileType dbFileType) {
switch (dbFileType) {
case DBFileType::DATA: {
return "DATA";
}
case DBFileType::METADATA: {
return "METADATA";
}
case DBFileType::NODE_INDEX: {
return "NODE_INDEX";
}
default: {
KU_UNREACHABLE;
}
}
}

DBFileID DBFileID::newDataFileID() {
return DBFileID{DBFileType::DATA};
}
Expand All @@ -210,46 +193,5 @@ DBFileID DBFileID::newPKIndexFileID(common::table_id_t tableID) {
return retVal;
}

std::string walRecordTypeToString(WALRecordType walRecordType) {
switch (walRecordType) {
case WALRecordType::PAGE_UPDATE_OR_INSERT_RECORD: {
return "PAGE_UPDATE_OR_INSERT_RECORD";
}
case WALRecordType::TABLE_STATISTICS_RECORD: {
return "TABLE_STATISTICS_RECORD";
}
case WALRecordType::COMMIT_RECORD: {
return "COMMIT_RECORD";
}
case WALRecordType::CATALOG_RECORD: {
return "CATALOG_RECORD";
}
case WALRecordType::CREATE_TABLE_RECORD: {
return "CREATE_TABLE_RECORD";
}
case WALRecordType::CREATE_REL_TABLE_GROUP_RECORD: {
return "REL_TABLE_GROUP_RECORD";
}
case WALRecordType::CREATE_RDF_GRAPH_RECORD: {
return "CREATE_RDF_GRAPH_RECORD";
}
case WALRecordType::COPY_TABLE_RECORD: {
return "COPY_TABLE_RECORD";
}
case WALRecordType::DROP_TABLE_RECORD: {
return "DROP_TABLE_RECORD";
}
case WALRecordType::ADD_PROPERTY_RECORD: {
return "ADD_PROPERTY_RECORD";
}
case WALRecordType::DROP_PROPERTY_RECORD: {
return "DROP_PROPERTY_RECORD";
}
default: {
KU_UNREACHABLE;
}
}
}

} // namespace storage
} // namespace kuzu
3 changes: 1 addition & 2 deletions src/storage/wal_replayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ void WALReplayer::replayWALRecord(WALRecord& walRecord,
replayAddPropertyRecord(walRecord);
} break;
default:
throw RuntimeException("Unrecognized WAL record type inside WALReplayer::replay. type: " +
walRecordTypeToString(walRecord.type));
KU_UNREACHABLE;
}
}

Expand Down

0 comments on commit 5840b68

Please sign in to comment.