1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        TmStorage開源存儲引擎

        聯(lián)合創(chuàng)作 · 2023-10-01 04:40

        TmStorage 是一個用 .NET 開發(fā)的虛擬文件系統(tǒng),用來存儲流數(shù)據(jù)。使用扁平結(jié)構(gòu)進行數(shù)據(jù)存儲,通過類型為 GUID 的流 id 來引用數(shù)據(jù)。

        TmStorage 使用一個主文件用來存儲所有流數(shù)據(jù)。主文件被分成多個可變長度的段,每個段只由一個流來占用。每個流由 0 到多個段組成。

        每個段包含一個段的元數(shù)據(jù),這些元數(shù)據(jù)存放在段的起始位置,包含如下信息:

        • 段大小 (Int64)

        • 下一個段的位置,如果是最后一個段則為 null(Int64)

        • 元數(shù)據(jù)的校驗和 (Int)

        為了防止碎片化嚴重,段大小固定為 512 字節(jié)的整數(shù)倍。

        使用實例:

        Image image = Image.FromFile("c:\\image.png");
        Storage storage = new Storage("c:\\images.storage", "c:\\images.storagelog");
        Guid streamId = Guid.NewGuid();
         
        storage.StartTransaction();
        try{
            Stream stream = storage.CreateStream(streamId);
            image.Save(stream, ImageFormat.Png);
            stream.Close();
        
            storage.CommitTransaction();
        }finally{
            storage.RollbackTransaction();
        }
        瀏覽 22
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            免费看骚逼 | 欧美视频在线观看视频91 | 美女大骚逼 | 青久视频在线 | 亚洲五月天色 | 桃色阁av | 中文字幕丰满人妻无码区隔壁人爱 | 竹内纱里奈一88Av在线 | 五月天堂网 | 国产精品伦子伦 |