Пример #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);
            }
        }
Пример #2
0
        public void Invalidate(ulong documentKey, bool sync)
        {
            using (LockUpgradeableRead())
            {
                var binarySearchRange = PropertyDatabaseRecordFinder.FindRange(this, documentKey);
                if (binarySearchRange == BinarySearchRange.invalid)
                {
                    return;
                }

                InvalidateRange(binarySearchRange);
            }
        }