Example #1
0
 public override IEnumerable <KeyValuePair <AttributeValue, long> > Enumerate(QueryCriteria value)
 {
     if (_childPredicates.Count > 0)
     {
         var filter = new ClusteredHashSet <long>();
         foreach (var childPredicate in _childPredicates)
         {
             var predicate = (TerminalPredicate)childPredicate;
             if (predicate != null)
             {
                 foreach (var kvp in predicate.Enumerate(value))
                 {
                     if (!value.SortResult)
                     {
                         if (!filter.Contains(kvp.Value))
                         {
                             filter.Add(kvp.Value);
                             yield return(kvp);
                         }
                     }
                     else
                     {
                         yield return(kvp);
                     }
                 }
             }
         }
     }
 }
Example #2
0
        public MetadataIndex(StatsIdentity statsIdentity, IPersistenceProvider metadataPersister)
        {
            _keyToRowIndex  = new DoubleVector <DocumentKey, long>();
            _bucketKeyIndex = new HashVector <int, ClusteredList <DocumentKey> >();
            _enumerationSet = new ClusteredHashSet <long>();

            _statsCollector    = StatsManager.Instance.GetStatsCollector(statsIdentity);
            _metadataPersister = metadataPersister;
        }
        public int GetHashCode(ClusteredHashSet <T> obj)
        {
            int hashCode = 0;

            if (obj != null)
            {
                foreach (T t in obj)
                {
                    hashCode = hashCode ^ (m_comparer.GetHashCode(t) & 0x7FFFFFFF);
                }
            } // else returns hashcode of 0 for null hashsets
            return(hashCode);
        }
 // using m_comparer to keep equals properties in tact; don't want to choose one of the comparers
 public bool Equals(ClusteredHashSet <T> x, ClusteredHashSet <T> y)
 {
     return(ClusteredHashSet <T> .HashSetEquals(x, y, m_comparer));
 }
Example #5
0
 public MetadataIndexDisk(StatsIdentity statsIdentity, IPersistenceProvider metadataPersister)
     : base(statsIdentity, metadataPersister)
 {
     _transactionRowIds = new ClusteredHashSet <long>();
     _keysDeleted       = new ClusteredHashSet <DocumentKey>();
 }