MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getObjectMetadataModificationTime

Method getObjectMetadataModificationTime

src/Databases/DatabaseOnDisk.cpp:636–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634}
635
636time_t DatabaseOnDisk::getObjectMetadataModificationTime(const String & object_name) const
637{
638 auto db_disk = getDisk();
639 String table_metadata_path = getObjectMetadataPath(object_name);
640 if (!db_disk->existsFileOrDirectory(table_metadata_path))
641 return static_cast<time_t>(0);
642
643 try
644 {
645 return db_disk->getLastModified(table_metadata_path).epochTime();
646 }
647 catch (const fs::filesystem_error & e)
648 {
649 if (e.code() == std::errc::no_such_file_or_directory)
650 {
651 return static_cast<time_t>(0);
652 }
653 throw;
654 }
655}
656
657void DatabaseOnDisk::iterateMetadataFiles(const IteratingFunction & process_metadata_file) const
658{

Callers 1

generateMethod · 0.45

Calls 4

epochTimeMethod · 0.80
existsFileOrDirectoryMethod · 0.45
getLastModifiedMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected