Example #1
0
        public bool TryLoad(ulong documentKey, out IEnumerable <IPropertyDatabaseRecord> records)
        {
            records = null;
            using (LockRead())
            {
                if (m_Fs == null)
                {
                    return(false);
                }
                var binarySearchRange = PropertyDatabaseRecordFinder.FindRange(this, documentKey);
                if (binarySearchRange == BinarySearchRange.invalid)
                {
                    return(false);
                }

                var result = new List <IPropertyDatabaseRecord>();
                for (var i = binarySearchRange.startOffset; i < binarySearchRange.endOffset; ++i)
                {
                    var record = GetRecord(i);
                    if (record.IsValid())
                    {
                        result.Add(record);
                    }
                }

                records = result;
                return(true);
            }
        }
Example #2
0
        public void Invalidate(uint documentKeyHiWord, bool sync)
        {
            using (LockUpgradeableRead())
            {
                var binarySearchRange = PropertyDatabaseRecordFinder.FindHiWordRange(this, documentKeyHiWord);
                if (binarySearchRange == BinarySearchRange.invalid)
                {
                    return;
                }

                InvalidateRange(binarySearchRange);
            }
        }
Example #3
0
        public void InvalidateMask(ulong documentKeyMask, bool sync)
        {
            using (LockUpgradeableRead())
            {
                var binarySearchRange = PropertyDatabaseRecordFinder.FindMaskRange(this, documentKeyMask);
                if (binarySearchRange == BinarySearchRange.invalid)
                {
                    return;
                }

                InvalidateMaskRange(binarySearchRange, documentKeyMask);
            }
        }
Example #4
0
        public void Invalidate(ulong documentKey, bool sync)
        {
            using (LockUpgradeableRead())
            {
                if (m_Fs == null)
                {
                    return;
                }
                var binarySearchRange = PropertyDatabaseRecordFinder.FindRange(this, documentKey);
                if (binarySearchRange == BinarySearchRange.invalid)
                {
                    return;
                }

                InvalidateRange(binarySearchRange, sync);
            }
        }
Example #5
0
 public bool Find(PropertyDatabaseRecordKey recordKey, out long index)
 {
     using (LockRead())
         return(PropertyDatabaseRecordFinder.Find(this, recordKey, out index));
 }