Example #1
0
 private void EnsureCorrectBounds()
 {
     if (transaction.updateVersion > version)
     {
         // If version is -1, we force a key position lookup. Version is -1
         // when the range is created or it undergoes a large structural change.
         if (version == -1)
         {
             // Calculate absolute upper bound,
             end = transaction.AbsKeyEndPosition(upperKey);
             // Calculate the lower bound,
             start = transaction.AbsKeyEndPosition(lowerKey);
         }
         else
         {
             if (upperKey.CompareTo(transaction.lowestSizeChangedKey) >= 0)
             {
                 // Calculate absolute upper bound,
                 end = transaction.AbsKeyEndPosition(upperKey);
             }
             if (lowerKey.CompareTo(transaction.lowestSizeChangedKey) > 0)
             {
                 // Calculate the lower bound,
                 start = transaction.AbsKeyEndPosition(lowerKey);
             }
         }
         // Reset the stack and set the version to the most recent
         stack.Reset();
         version = transaction.updateVersion;
     }
 }
 private void EnsureCorrectBounds()
 {
     if (transaction.updateVersion > version)
     {
         // If version is -1, we force a key position lookup.  Version is -1
         // when the file is created or it undergoes a large structural change
         // such as a copy.
         if (version == -1 || key.CompareTo(transaction.lowestSizeChangedKey) >= 0)
         {
             long[] bounds = transaction.GetDataFileBounds(key);
             start = bounds[0];
             end   = bounds[1];
         }
         else
         {
             // If version doesn't equal -1, and this key is lower than the lowest
             // size changed key, then 'start' and 'end' should be correct.
         }
         // Reset the stack and set the version to the most recent
         stack.Reset();
         version = transaction.updateVersion;
     }
 }