Esempio n. 1
0
 internal SortedList <string, KeyValueState> GetIndexObject(int?idxCount)
 {
     if (IndexObject == null)
     {
         byte[] idxBytes = ReadData((long)GetNextIndexWriteOffset(),
                                    (idxCount.HasValue && idxCount.Value != 0) ? idxCount.Value : GetIndexRealSize());
         //Console.WriteLine("Idx Len: {0}", idxBytes.Length);
         if (idxBytes.Length > 0)
         {
             //Console.WriteLine("Restore");
             IndexObject = FileWrapHelper.GetObject <SortedList <string, KeyValueState> >(idxBytes);
         }
         else
         {
             IndexObject = new SortedList <string, KeyValueState>(StringComparer.Ordinal);
         }
     }
     return(IndexObject);
 }
Esempio n. 2
0
 internal SortedList <long, DirtyBlock> GetStoreDirtyData()
 {
     if (DirtyObject == null)
     {
         int dCount = GetDirtyBlockRealSize();
         if (dCount > 0)
         {
             byte[] idxBytes = ReadData((long)(HEAD_SUMMARY_BYTES + GetIndexSize()), dCount);
             if (idxBytes.Length > 0)
             {
                 DirtyObject = FileWrapHelper.GetObject <SortedList <long, DirtyBlock> >(idxBytes);
             }
         }
         else
         {
             DirtyObject = new SortedList <long, DirtyBlock>();
         }
     }
     return(DirtyObject);
 }