In class IDiskRemote, all metadata file system operations use os file system api directly.
There is little extendiability if we want store the metadata of HDFS or S3 into distributed file system.
So I suggest change this way by using DiskPtr and will propose a pull request.

In addition, metadata of HDFS or S3 only store local FS which is not sharable.

auto restore_file_operations = [this, &restore_information, &renames, &send_metadata](auto list_result)
    {
        const String rename = "rename";
        const String hardlink = "hardlink";
        for (const auto & row : list_result.GetContents())
        {
            const String & key = row.GetKey();
            const auto [revision, operation] = extractRevisionAndOperationFromKey(key);
            if (revision == UNKNOWN_REVISION)
            {
                LOG_WARNING(log, "Skip key {} with unknown revision", key);
                continue;
            }
            
            
            if (revision > restore_information.revision)
                return false;
            
            if (send_metadata)
                revision_counter = revision - 1;
            auto object_metadata = headObject(restore_information.source_bucket, key).GetMetadata();
            if (operation == rename)
            {
                auto from_path = object_metadata["from_path"];
                auto to_path = object_metadata["to_path"];
                if (exists(from_path))
                {
                    moveFile(from_path, to_path, send_metadata);
                    LOG_TRACE(log, "Revision {}. Restored rename {} -> {}", revision, from_path, to_path);
                    if (restore_information.detached && isDirectory(to_path))