Ejemplo n.º 1
0
 public override IndexUpdater NewUpdater(IndexUpdateMode mode)
 {
     if (LuceneIndex.ReadOnly)
     {
         throw new System.NotSupportedException("Can't create updater for read only index.");
     }
     return(GetIndexUpdater(mode));
 }
Ejemplo n.º 2
0
        public override IndexUpdater GetIndexUpdater(IndexUpdateMode mode)
        {
            IndexUpdater indexUpdater = new FulltextIndexUpdater(this, mode.requiresIdempotency(), mode.requiresRefresh());

            if (_descriptor.EventuallyConsistent)
            {
                indexUpdater = new EventuallyConsistentIndexUpdater(LuceneIndex, indexUpdater, _indexUpdateSink);
            }
            return(indexUpdater);
        }
        internal void Add(T item, IndexUpdateMode indexUpdateMode, bool isUniqueIndex)
        {
            this.Values.Add(item);
            if (indexUpdateMode == IndexUpdateMode.Tentative)
            {
                this.SetTentativeInsert();
                return;
            }

            // No condition check is necessary: if the flag is set, we will unset it, and if it's unset, we will unset it again, which is a no-op.
            this.ClearTentativeFlag();
        }
Ejemplo n.º 4
0
 public override NativeIndexUpdater <KEY, VALUE> NewUpdater(IndexUpdateMode mode)
 {
     assertOpen();
     try
     {
         return(_singleUpdater.initialize(tree.writer()));
     }
     catch (IOException e)
     {
         throw new UncheckedIOException(e);
     }
 }
        internal void Remove(T item, IndexUpdateMode indexUpdateMode, bool isUniqueIndex)
        {
            if (indexUpdateMode == IndexUpdateMode.Tentative)
            {
                this.SetTentativeDelete();
                return;
            }

            // In order to make the index update operations idempotent, non-transactional unique indexes must only do their action if the index entry
            // is still marked as tentative. Otherwise, it means that tentative flag was removed by an earlier attempt and should not be done again.
            // There is no concern about non-unique indexes, because they cannot affect the operations among different grains and therefore
            // cannot fail the operations on other grains.
            if (!isUniqueIndex || indexUpdateMode == IndexUpdateMode.Transactional || this.IsTentative)
            {
                this.ClearTentativeFlag();
                this.Values.Remove(item);
            }
        }
 public void SetStale(IndexUpdateMode stale)
 {
     Stale = stale;
 }
Ejemplo n.º 7
0
 public override IndexUpdater NewUpdater(IndexUpdateMode mode)
 {
     return(new SpatialIndexUpdater(this, mode));
 }
Ejemplo n.º 8
0
		public virtual void SetStale(IndexUpdateMode stale)
		{
			this.stale = stale;
		}
Ejemplo n.º 9
0
 public void SetStale(IndexUpdateMode stale)
 {
     this.stale = stale;
 }
 public MemberUpdateOverriddenMode(IMemberUpdate update, IndexUpdateMode indexUpdateMode)
 {
     this._update    = update;
     this.UpdateMode = indexUpdateMode;
 }
Ejemplo n.º 11
0
 protected internal abstract IndexUpdater GetIndexUpdater(IndexUpdateMode mode);
Ejemplo n.º 12
0
 public override IndexUpdater NewUpdater(IndexUpdateMode mode)
 {
     return(Delegate.newUpdater(mode));
 }
Ejemplo n.º 13
0
 public override IndexUpdater NewUpdater(IndexUpdateMode mode)
 {
     return(SwallowingIndexUpdater.INSTANCE);
 }
Ejemplo n.º 14
0
        public override IndexUpdater NewUpdater(IndexUpdateMode mode)
        {
            LazyInstanceSelector <IndexUpdater> updaterSelector = new LazyInstanceSelector <IndexUpdater>(slot => InstanceSelector.select(slot).newUpdater(mode));

            return(new FusionIndexUpdater(SlotSelector, updaterSelector));
        }
Ejemplo n.º 15
0
 public MemberUpdateWithMode(IMemberUpdate update, IndexUpdateMode indexUpdateMode)
 {
     this._update    = update;
     this.UpdateMode = indexUpdateMode;
 }